npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
directedCDTestCumulants.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_DIRECTEDCDTESTCUMULANTS_HH_
2 #define NPSTAT_DIRECTEDCDTESTCUMULANTS_HH_
3 
4 /*!
5 // \file directedCDTestCumulants.hh
6 //
7 // \brief The 3rd and 4th cumulants for the distribution of the
8 // statistic for the directed comparison density test based on
9 // shifted Legendre polynomials under the null hypothesis
10 //
11 // Author: I. Volobouev
12 //
13 // July 2023
14 */
15 
16 #include <utility>
17 
18 namespace npstat {
19  // Note that the time needed to calculate these cumulants
20  // scales as O(nTerms^4). Memoization of intermediate results
21  // might help for large "nTerms" -- you should time your code both
22  // with and without memoization and decide whether you want to
23  // use it.
24  //
25  // The input direction array does not have to be normalized --
26  // it will be normalized internally. It is assumed that the
27  // first array element is the direction component for the
28  // polynomial of degree 1, the second element corresponds
29  // to degree 2, etc.
30  //
31  // In the returned pair, the first element is the skewness (the
32  // 3rd cumulant, as the variance is 1) and the second element
33  // is the excess kurtosis (the 4th cumulant).
34  //
35  std::pair<double,double> directedCDTestCumulants(
36  const double* direction, unsigned nTerms,
37  unsigned sampleSize, bool memoize = false);
38 }
39 
40 #endif // NPSTAT_DIRECTEDCDTESTCUMULANTS_HH_
Definition: AbsArrayProjector.hh:14