npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
VariableBandwidthSmoother1D.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_VARIABLEBANDWIDTHSMOOTHER1D_HH_
2 #define NPSTAT_VARIABLEBANDWIDTHSMOOTHER1D_HH_
3 
4 /*!
5 // \file VariableBandwidthSmoother1D.hh
6 //
7 // \brief Variable bandwidth smoother inheriting from AbsMarginalSmootherBase
8 //
9 // Author: I. Volobouev
10 //
11 // June 2015
12 */
13 
15 
16 namespace npstat {
18  {
19  public:
20  /**
21  // Constructor arguments are as follows:
22  //
23  // nbins, xmin, xmax -- Parameters for the histogram which will
24  // be accumulated using the data sample to be
25  // smoothed. nbins should preferrably be
26  // a power of 2 (for subsequent FFT).
27  //
28  // symbetaPower -- Power of the symmetric beta kernel to use.
29  // Gaussian kernel chopped of at 12 sigma will
30  // be used in case this parameter is negative.
31  // This parameter must not exceed 10.
32  //
33  // bwFactor -- Fudge factor for the bandwidth used for
34  // the density estimate.
35  //
36  // label -- Label for the axis. Useful in case
37  // smoothing results are stored for inspection.
38  */
39  VariableBandwidthSmoother1D(unsigned nbins, double xmin, double xmax,
40  int symbetaPower, double bwFactor = 1.0,
41  const char* label = 0);
42 
43  inline virtual ~VariableBandwidthSmoother1D() {}
44 
45  //@{
46  /** Simple inspector of object properties */
47  inline int symbetaPower() const {return symbetaPower_;}
48  inline double bwFactor() const {return bwFactor_;}
49  //@}
50 
51  private:
52  virtual void smoothHisto(HistoND<double>& histo,
53  double effectiveSampleSize,
54  double* bandwidthUsed,
55  bool isSampleWeighted);
56  std::vector<double> databuf_;
57  int symbetaPower_;
58  double bwFactor_;
59  };
60 }
61 
62 #endif // NPSTAT_VARIABLEBANDWIDTHSMOOTHER1D_HH_
Interface definition for 1-d nonparametric density estimation.
Definition: AbsMarginalSmootherBase.hh:29
Definition: VariableBandwidthSmoother1D.hh:18
int symbetaPower() const
Definition: VariableBandwidthSmoother1D.hh:47
VariableBandwidthSmoother1D(unsigned nbins, double xmin, double xmax, int symbetaPower, double bwFactor=1.0, const char *label=0)
Definition: AbsArrayProjector.hh:14