npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::WeightedLTSLoss< MaxDim, MaxReplace, MaxDeg > Class Template Reference

#include <WeightedLTSLoss.hh>

Inheritance diagram for npstat::WeightedLTSLoss< MaxDim, MaxReplace, MaxDeg >:
npstat::AbsLossCalculator< MaxDim, MaxReplace >

Public Types

typedef ReplacementBlock< MaxDim, MaxReplace > BlockReplacement
 

Public Member Functions

 WeightedLTSLoss (const AbsDistributionND &weight, unsigned deg)
 
virtual LocalLoss operator() (const ArrayND< double > &slidingWindow, const unsigned *indexInWindow, const unsigned *indexInDataset, BlockReplacement *block) const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ WeightedLTSLoss()

template<unsigned MaxDim, unsigned MaxReplace, unsigned MaxDeg>
npstat::WeightedLTSLoss< MaxDim, MaxReplace, MaxDeg >::WeightedLTSLoss ( const AbsDistributionND weight,
unsigned  deg 
)
inline

"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").

Member Function Documentation

◆ operator()()

template<unsigned MaxDim, unsigned MaxReplace, unsigned MaxDeg>
virtual LocalLoss npstat::WeightedLTSLoss< MaxDim, MaxReplace, MaxDeg >::operator() ( const ArrayND< double > &  slidingWindow,
const unsigned *  indexInWindow,
const unsigned *  indexInDataset,
BlockReplacement block 
) const
virtual

In addition to returning the loss, the following function must fill out the suggested replacement block

Implements npstat::AbsLossCalculator< MaxDim, MaxReplace >.


The documentation for this class was generated from the following file: