npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
spearmansRho.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_SPEARMANSRHO_HH_
2 #define NPSTAT_SPEARMANSRHO_HH_
3 
4 /*!
5 // \file spearmansRho.hh
6 //
7 // \brief Spearman's rank correlation coefficient (Spearman's rho)
8 //
9 // Calculation of the Spearman's rho measure of association of two
10 // variables. Here, rho can be estimated either from a sample of points
11 // or from an empirical copula.
12 //
13 // Author: I. Volobouev
14 //
15 // April 2012
16 */
17 
18 #include <vector>
19 
20 namespace npstat {
21  /**
22  // Estimate Spearman's rho from a sample of multivariate points.
23  // Class Point should be subscriptable.
24  */
25  template <class Point>
26  double sampleSpearmansRho(const std::vector<Point>& data,
27  unsigned firstDim, unsigned secondDim);
28 
29  /**
30  // Estimate Spearman's rho from an empirical copula.
31  //
32  // In this function, the array should represent an empirical 2-d
33  // copula (constructed, for example, by the calculateEmpiricalCopula
34  // function -- see header file empiricalCopula.hh). Do not confuse it
35  // with the copula density.
36  */
37  template <class Array>
38  double spearmansRhoFromCopula(const Array& copula);
39 
40  /**
41  // Estimate Spearman's rho from an empirical copula density.
42  //
43  // In this function, the array should represent an empirical
44  // 2-d copula density (constructed, for example, by the
45  // empiricalCopulaDensity function -- see header file
46  // empiricalCopula.hh). Do not confuse it with the copula.
47  */
48  template <class Array>
49  double spearmansRhoFromCopulaDensity(const Array& copulaDensity);
50 }
51 
52 #include "npstat/stat/spearmansRho.icc"
53 
54 #endif // NPSTAT_SPEARMANSRHO_HH_
Definition: AbsArrayProjector.hh:14
double spearmansRhoFromCopula(const Array &copula)
double spearmansRhoFromCopulaDensity(const Array &copulaDensity)
double sampleSpearmansRho(const std::vector< Point > &data, unsigned firstDim, unsigned secondDim)