npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
BandwidthCVLeastSquares1D.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_BANDWIDTHCVLEASTSQUARES1D_HH_
2 #define NPSTAT_BANDWIDTHCVLEASTSQUARES1D_HH_
3 
4 /*!
5 // \file BandwidthCVLeastSquares1D.hh
6 //
7 // \brief Cross-validating one-dimensional density estimates by optimizing
8 // the L2 distance (MISE)
9 //
10 // Author: I. Volobouev
11 //
12 // September 2010
13 */
14 
16 
17 namespace npstat {
18  /**
19  // Class for calculating KDE or LOrPE cross-validation MISE approximations
20  // for 1-dimensional density estimates. operator() returns -MISE estimate
21  // (a quantity to be maximized). This class is intended for use inside
22  // degree and/or bandwidth scans.
23  */
24  template<
25  typename Numeric,
26  typename Num2,
27  typename Num3 = double,
28  typename Num4 = double
29  >
31  public AbsBandwidthCV1D<Numeric,Num2,Num3,Num4>
32  {
33  inline virtual ~BandwidthCVLeastSquares1D() {}
34 
35  // Unweighted samples
36  virtual double operator()(
37  const HistoND<Numeric>& histo,
38  const Num2* densityEstimate,
39  unsigned lenEstimate,
40  const AbsPolyFilter1D& filterUsed) const;
41 
42  // Weighted samples
43  virtual double operator()(
44  const HistoND<Numeric>& histo,
45  double effectiveSampleSize,
46  const Num2* densityEstimate,
47  unsigned lenEstimate,
48  const AbsPolyFilter1D& filterUsed) const;
49 
50  // Weighted samples in case the sample is available
51  virtual double operator()(
52  const HistoND<Numeric>& histo,
53  const std::pair<Num3, Num4>* sample,
54  unsigned long lenSample,
55  const Num2* densityEstimate,
56  unsigned lenEstimate,
57  const AbsPolyFilter1D& filterUsed) const;
58  };
59 }
60 
61 #include "npstat/stat/BandwidthCVLeastSquares1D.icc"
62 
63 #endif // NPSTAT_BANDWIDTHCVLEASTSQUARES1D_HH_
Interface definitions for KDE or LOrPE cross-validation calculations.
Definition: HistoND.hh:46
Definition: AbsArrayProjector.hh:14
Definition: AbsBandwidthCV.hh:48
Definition: AbsPolyFilter1D.hh:27
Definition: BandwidthCVLeastSquares1D.hh:32
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 Num2 *densityEstimate, unsigned lenEstimate, const AbsPolyFilter1D &filterUsed) const