|
#include <AbsBandwidthCV.hh>
|
typedef Numeric | bin_type |
|
typedef Num2 | density_type |
|
typedef Num3 | coord_type |
|
typedef Num4 | weight_type |
|
|
virtual double | operator() (const HistoND< Numeric > &histo, const Num2 *densityEstimate, unsigned lenEstimate, const AbsPolyFilter1D &filterUsed) const =0 |
|
virtual double | operator() (const HistoND< Numeric > &histo, double effectiveSampleSize, const Num2 *densityEstimate, unsigned lenEstimate, const AbsPolyFilter1D &filterUsed) const =0 |
|
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 =0 |
|
double | operator() (const HistoND< Numeric > &histo, const std::vector< std::pair< Num3, Num4 > > &sample, const Num2 *densityEstimate, unsigned lenEstimate, const AbsPolyFilter1D &filterUsed) const |
|
template<typename Numeric, typename Num2, typename Num3 = double, typename Num4 = double>
struct npstat::AbsBandwidthCV1D< Numeric, Num2, Num3, Num4 >
Cross-validation for univariate densities. "Numeric" template parameter is the type of histogram bins. "Num2" is the type produced by the density estimation code (usually just double). "Num3" is the type of point coordinates used to fill the histogram (normally, float or double), and "Num4" is the type of point weights.
◆ operator()() [1/3]
template<typename Numeric , typename Num2 , typename Num3 = double, typename Num4 = double>
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.
Implemented in npstat::BandwidthCVPseudoLogli1D< Numeric, Num2, Num3, Num4 >, and npstat::BandwidthCVLeastSquares1D< Numeric, Num2, Num3, Num4 >.
◆ operator()() [2/3]
template<typename Numeric , typename Num2 , typename Num3 = double, typename Num4 = double>
virtual double npstat::AbsBandwidthCV1D< Numeric, Num2, Num3, Num4 >::operator() |
( |
const HistoND< Numeric > & |
histo, |
|
|
const std::pair< Num3, Num4 > * |
sample, |
|
|
unsigned long |
lenSample, |
|
|
const Num2 * |
densityEstimate, |
|
|
unsigned |
lenEstimate, |
|
|
const AbsPolyFilter1D & |
filterUsed |
|
) |
| const |
|
pure virtual |
Cross-validation for samples of univariate weighted points which can be used when the original sample is available. For the sample points, the first element of the pair is the point coordinate and the second element is the weight. The histogram must be created in advance using that particular sample.
◆ operator()() [3/3]
template<typename Numeric , typename Num2 , typename Num3 = double, typename Num4 = double>
virtual double npstat::AbsBandwidthCV1D< Numeric, Num2, Num3, Num4 >::operator() |
( |
const HistoND< Numeric > & |
histo, |
|
|
double |
effectiveSampleSize, |
|
|
const Num2 * |
densityEstimate, |
|
|
unsigned |
lenEstimate, |
|
|
const AbsPolyFilter1D & |
filterUsed |
|
) |
| const |
|
pure virtual |
The documentation for this struct was generated from the following file:
|