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

#include <BandwidthCVPseudoLogli1D.hh>

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

Public Member Functions

 BandwidthCVPseudoLogli1D (double regularizationPower=0.5)
 
unsigned long getNonZeroCount () const
 
unsigned long getRenormCount () const
 
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>
class npstat::BandwidthCVPseudoLogli1D< Numeric, Num2, Num3, Num4 >

Class for calculating KDE or LOrPE cross-validation pseudo log-likelihood, for 1-dimensional density estimates. This class is intended for use inside degree and/or bandwidth scans.

Constructor & Destructor Documentation

◆ BandwidthCVPseudoLogli1D()

template<typename Numeric , typename Num2 , typename Num3 = double, typename Num4 = double>
npstat::BandwidthCVPseudoLogli1D< Numeric, Num2, Num3, Num4 >::BandwidthCVPseudoLogli1D ( double  regularizationPower = 0.5)
inlineexplicit

Parameter "regularizationPower" is used to limit the contributions into the overall pseudo log likelihood from points for which the "leaving one out" density is very low. For those points, instead of "leaving one out" density, we will use the density generated by that point itself divided by pow(N, regularizationPower). This method limits the effect of tails on bandwidth determination.

Member Function Documentation

◆ operator()() [1/2]

template<typename Numeric , typename Num2 , typename Num3 = double, typename Num4 = double>
virtual double npstat::BandwidthCVPseudoLogli1D< 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::BandwidthCVPseudoLogli1D< 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 class was generated from the following file: