npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::BandwidthCVLeastSquares1D< Numeric, Num2, Num3, Num4 > Struct Template Reference

#include <BandwidthCVLeastSquares1D.hh>

Inheritance diagram for npstat::BandwidthCVLeastSquares1D< Numeric, Num2, Num3, Num4 >:
npstat::AbsBandwidthCV1D< Numeric, Num2, double, double >

Public Member Functions

virtual double operator() (const HistoND< Numeric > &histo, const Num2 *densityEstimate, unsigned lenEstimate, const AbsPolyFilter1D &filterUsed) const
 
virtual double operator() (const HistoND< Numeric > &histo, double effectiveSampleSize, const Num2 *densityEstimate, unsigned lenEstimate, const AbsPolyFilter1D &filterUsed) const
 
virtual double operator() (const HistoND< Numeric > &histo, const std::pair< Num3, Num4 > *sample, unsigned long lenSample, const Num2 *densityEstimate, unsigned lenEstimate, const AbsPolyFilter1D &filterUsed) const
 
- Public Member Functions inherited from npstat::AbsBandwidthCV1D< Numeric, Num2, double, double >
virtual double operator() (const HistoND< Numeric > &histo, const std::pair< double, double > *sample, unsigned long lenSample, const Num2 *densityEstimate, unsigned lenEstimate, const AbsPolyFilter1D &filterUsed) const=0
 
double operator() (const HistoND< Numeric > &histo, const std::vector< std::pair< double, double > > &sample, const Num2 *densityEstimate, unsigned lenEstimate, const AbsPolyFilter1D &filterUsed) const
 

Additional Inherited Members

- Public Types inherited from npstat::AbsBandwidthCV1D< Numeric, Num2, double, double >
typedef Numeric bin_type
 
typedef Num2 density_type
 
typedef double coord_type
 
typedef double weight_type
 

Detailed Description

template<typename Numeric, typename Num2, typename Num3 = double, typename Num4 = double>
struct npstat::BandwidthCVLeastSquares1D< Numeric, Num2, Num3, Num4 >

Class for calculating KDE or LOrPE cross-validation MISE approximations for 1-dimensional density estimates. operator() returns -MISE estimate (a quantity to be maximized). This class is intended for use inside degree and/or bandwidth scans.

Member Function Documentation

◆ operator()() [1/2]

template<typename Numeric , typename Num2 , typename Num3 = double, typename Num4 = double>
virtual double npstat::BandwidthCVLeastSquares1D< Numeric, Num2, Num3, Num4 >::operator() ( const HistoND< Numeric > &  histo,
const Num2 *  densityEstimate,
unsigned  lenEstimate,
const AbsPolyFilter1D filterUsed 
) const
virtual

It should be assumed that the "nFillsInRange" method of the argument histogram returns the actual number of fills (that is, the histogram represents an actual collection of points, has possible bin values of 0, 1, 2, ..., and it is not scaled).

"densityEstimate" is allowed to be an estimate without truncation (even if it includes negative values). Dependence of the optimized quantity on the bandwidth should be smoother without truncation. Naturally, the order of values in "densityEstimate" is the same as the order of bins in "histo".

The "filterUsed" parameter is needed in order to be able to do "leave-one-out" type of cross-validation. In such calculations one has to know how much of the density estimate at coordinate x is contributed by the source point at x. When density estimates are done on the grid, the filters differ for the center of the grid and on the border. Because of this, we will need to have an access to the complete filter collection.

Implements npstat::AbsBandwidthCV1D< Numeric, Num2, double, double >.

◆ operator()() [2/2]

template<typename Numeric , typename Num2 , typename Num3 = double, typename Num4 = double>
virtual double npstat::BandwidthCVLeastSquares1D< Numeric, Num2, Num3, Num4 >::operator() ( const HistoND< Numeric > &  histo,
double  effectiveSampleSize,
const Num2 *  densityEstimate,
unsigned  lenEstimate,
const AbsPolyFilter1D filterUsed 
) const
virtual

Cross-validation for samples of univariate weighted points

Implements npstat::AbsBandwidthCV1D< Numeric, Num2, double, double >.


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