npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
polyExpectation.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_POLYEXPECTATION_HH_
2 #define NPSTAT_POLYEXPECTATION_HH_
3 
4 /*!
5 // \file polyExpectation.hh
6 //
7 // \brief Calculate expectation value of some polynomial w.r.t.
8 // a density function
9 //
10 // Author: I. Volobouev
11 //
12 // October 2022
13 */
14 
16 
17 namespace npstat {
18  // Currently, "Poly" should be one of the AbsClassicalOrthoPoly1D,
19  // ContOrthoPoly1D, or ScalableClassicalOrthoPoly1D classes.
20  //
21  // The expectation is calculated on the support interval
22  // of the distribution. If this interval is different from
23  // the support interval of the polynomial system, results
24  // returned by this function can be substantially different
25  // from the results obtained with the "extWeightAverages"
26  // method of the polynomial system (with the weight set to
27  // the corresponding density functor).
28  //
29  template<class Poly>
30  double polyExpectation(const AbsDistribution1D& distro,
31  const Poly& poly,
32  unsigned degree,
33  unsigned nIntegrationPoints = 256U,
34  bool useFejerQuadrature = false);
35 }
36 
37 #include "npstat/stat/polyExpectation.icc"
38 
39 #endif // NPSTAT_POLYEXPECTATION_HH_
Interface definition for 1-d continuous statistical distributions.
Definition: AbsArrayProjector.hh:14