template<unsigned MaxDim, unsigned MaxReplace, unsigned MaxDeg>
class npstat::WeightedLTSLoss< MaxDim, MaxReplace, MaxDeg >
Calculator of windowed least trimmed squares for use with gridded robust regression. The chi-squared is calculated for the whole window with the central point excluded. The loss improvement is estimated only for the point in the window center.
Template parameters MaxDim and MaxReplace are just like those in griddedRobustRegression.hh. For use with this particular loss calculator, MaxReplace value of 1 is the most appropriate. Template parameter MaxDeg is the maximum local polynomial degree.
template<unsigned MaxDim, unsigned MaxReplace, unsigned MaxDeg>
"weight" is the function used to generate local polynomials. It will be called on the local window using window coordinate system. For example, the point in the window center will be at the origin, and coordinates of all points neighboring the origin in each dimension will be either 0 or 1. The weight therefore must have an appropriate bandwidth, consistent with the expected local window width. If the bandwidth is too small (weight on the edges of the window is exactly 0) then the code will still work but will be inefficient.
"deg" is the actual degree of these polynomials (must not exceed "maxdeg").