npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
KDECopulaSmoother.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_KDECOPULASMOOTHER_HH_
2 #define NPSTAT_KDECOPULASMOOTHER_HH_
3 
4 /*!
5 // \file KDECopulaSmoother.hh
6 //
7 // \brief Constant bandwidth multivariate KDE smoother with cross-validation
8 //
9 // The cross-validation is implemented in the base class, this class only
10 // needs to build the filters for different bandwidth values.
11 //
12 // Author: I. Volobouev
13 //
14 // December 2011
15 */
16 
20 
22 
23 namespace npstat {
24  /** Class which builds KDE filters for different bandwidth values */
25  template <unsigned MaxKDEDeg>
26  class KDECopulaSmoother : public CVCopulaSmoother<KDEFilterND<MaxKDEDeg> >
27  {
28  public:
30 
31  /**
32  // Constructor arguments are as follows:
33  //
34  // nBinsInEachDim -- number of copula bins in each dimension
35  //
36  // dim -- copula dimensionality
37  //
38  // marginTolerance -- tolerance for the margin to be uniform
39  //
40  // maxNormCycles -- max number of copula normalization cycles
41  //
42  // kernel -- kernel to use for generating the filters.
43  // This should be a standard kernel, with
44  // location of 0 in each dimension. The scales
45  // should normally be set to 1 (unless you
46  // want different scale factors for different
47  // dimensions).
48  //
49  // taper, maxDegree -- KDEFilterND parameters
50  //
51  // initialBw -- "central" bandwidth for cross validation
52  // calculations (or the actual bandwidth used
53  // in case cross validation is not performed).
54  // Set this parameter to 0.0 in order to
55  // disable filtering altogether.
56  //
57  // cvCalc -- calculator for the quantity being optimized
58  // in the cross validation process. May be NULL
59  // in which case cross validation will not
60  // be used.
61  //
62  // becomeCvCalcOwner -- tells us whether we should destroy cvCalc
63  // in the destructor of the base class.
64  //
65  // cvRange -- we will scan bandwidth values between
66  // initialBw/cvRange and initialBw*cvRange
67  // uniformly in the log space.
68  //
69  // nCV -- number of bandwidth values to try in the
70  // bandwidth scan. If this number is even, it
71  // will be increased by 1 internally so that
72  // the "central" bandwidth is included in
73  // the scan. If this parameter is 0 or 1, the
74  // value given by "initialBw" will be used.
75  //
76  // dummy -- unused. Included for consistency with
77  // arguments of LOrPECopulaSmoother, etc.
78  */
80  const unsigned* nBinsInEachDim, unsigned dim,
81  double marginTolerance, unsigned maxNormCycles,
82  const AbsDistributionND& kernel,
83  const double* taper, unsigned maxDegree, double initialBw,
84  const typename Base::CVCalc* cvCalc, bool becomeCvCalcOwner,
85  double cvRange, unsigned nCV, bool dummy);
86 
87  virtual ~KDECopulaSmoother();
88 
89  private:
90  ArrayND<double> buffer_;
91  ConvolutionEngineND engine_;
92  };
93 }
94 
95 #include "npstat/stat/KDECopulaSmoother.icc"
96 
97 #endif // NPSTAT_KDECOPULASMOOTHER_HH_
Interface definition for multivariate continuous statistical distributions.
Smoothing copulas with AbsBandwidthCVND cross-validation.
Fast multidimensional convolutions via Fourier transforms (FFTW interface)
KDE on a regularly spaced multivariate grid with symmetric kernels.
Definition: AbsDistributionND.hh:26
Definition: CVCopulaSmoother.hh:20
Definition: ConvolutionEngineND.hh:31
Definition: KDECopulaSmoother.hh:27
KDECopulaSmoother(const unsigned *nBinsInEachDim, unsigned dim, double marginTolerance, unsigned maxNormCycles, const AbsDistributionND &kernel, const double *taper, unsigned maxDegree, double initialBw, const typename Base::CVCalc *cvCalc, bool becomeCvCalcOwner, double cvRange, unsigned nCV, bool dummy)
Definition: AbsArrayProjector.hh:14
Definition: AbsBandwidthCV.hh:176