npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
cdKernelSensitivityMatrix.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_CDKERNELSENSITIVITYMATRIX_HH_
2 #define NPSTAT_CDKERNELSENSITIVITYMATRIX_HH_
3 
4 /*!
5 // \file cdKernelSensitivityMatrix.hh
6 //
7 // \brief Calculate kernel sensitivity matrix for KDE-like density estimation
8 // using the definition based on comparison density
9 //
10 // Author: I. Volobouev
11 //
12 // December 2022
13 */
14 
15 #include "npstat/nm/Matrix.hh"
18 
19 namespace npstat {
20  /**
21  // Template class Fcn2D should provide a method
22  // "Real operator()(Real x, Real y) const", where "Real" is one of
23  // floating point types (long double works best).
24  //
25  // It is assumed that the interface of class "InPoly" is similar to that of
26  // npstat classes AbsClassicalOrthoPoly1D or ScalableClassicalOrthoPoly1D.
27  //
28  // In the returned matrix, row numbers correspond to the "output"
29  // polynomial degrees (y space) and column numbers to the "input"
30  // polynomial degrees (x space).
31  //
32  // "chebyshevDegree" is the degree to use for modeling the convolved
33  // density with Chebyshev polynomials (this is needed for fast
34  // calculation of its cumulative distribution function).
35  //
36  // Set "normalizeKernel" parameter to "false" if the kernel is already known
37  // to be normalized, that is, Int_ymin^ymax K(x, y) dy = 1 for every x.
38  */
39  template <class Fcn2D, class InPoly>
41  const Fcn2D& kernel, const InPoly& inputPoly,
42  unsigned maxdegInputPoly, unsigned maxdegOutPoly,
43  long double ymin, long double ymax,
44  const AbsIntervalQuadrature1D& xIntegrator,
45  const AbsIntervalQuadrature1D& yIntegrator,
46  unsigned chebyshevDegree, bool normalizeKernel=true);
47 
48  /**
49  // Template class Fcn2D should provide a method
50  // "Real operator()(Real x, Real y) const", where "Real" is one of
51  // floating point types (long double works best).
52  //
53  // In the returned matrix, row numbers correspond to the "output"
54  // polynomial degrees (y space) and column numbers to the "input"
55  // polynomial degrees (x space).
56  //
57  // "chebyshevDegree" is the degree to use for modeling the convolved
58  // density with Chebyshev polynomials (this is needed for fast
59  // calculation of its cumulative distribution function).
60  //
61  // Set "normalizeKernel" parameter to "false" if the kernel is already known
62  // to be normalized, that is, Int_ymin^ymax K(x, y) dy = 1 for every x.
63  */
64  template <class Fcn2D>
66  const Fcn2D& kernel, const ContOrthoPoly1D& inputPoly,
67  unsigned maxdegInputPoly, unsigned maxdegOutPoly,
68  long double ymin, long double ymax,
69  const AbsIntervalQuadrature1D& yIntegrator,
70  unsigned chebyshevDegree, bool normalizeKernel=true);
71 }
72 
73 #include "npstat/nm/cdKernelSensitivityMatrix.icc"
74 
75 #endif // NPSTAT_CDKERNELSENSITIVITYMATRIX_HH_
Base class for quadratures on the [-1, 1] interval.
Continuous orthogonal polynomial series in one dimension generated for a discrete measure.
Template matrix class.
Definition: AbsIntervalQuadrature1D.hh:19
Definition: ContOrthoPoly1D.hh:40
Definition: AbsArrayProjector.hh:14
Matrix< double > cdKernelSensitivityMatrix(const Fcn2D &kernel, const InPoly &inputPoly, unsigned maxdegInputPoly, unsigned maxdegOutPoly, long double ymin, long double ymax, const AbsIntervalQuadrature1D &xIntegrator, const AbsIntervalQuadrature1D &yIntegrator, unsigned chebyshevDegree, bool normalizeKernel=true)