npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
histoStats.hh File Reference

Calculate various descriptive statistics for histograms. More...

#include <vector>
#include "geners/CPP11_auto_ptr.hh"
#include "npstat/nm/Matrix.hh"
#include "npstat/stat/Distributions1D.hh"
#include "npstat/stat/DistributionsND.hh"
#include "npstat/stat/histoStats.icc"

Go to the source code of this file.

Namespaces

 npstat
 

Functions

template<class Histo >
void npstat::histoMean (const Histo &histo, double *mean, unsigned lengthMean)
 
template<class Histo >
void npstat::histoQuantiles (const Histo &histo, unsigned axisNumber, const double *qvalues, double *quantiles, unsigned nqvalues)
 
template<class Histo , unsigned Len>
void npstat::histoCovariance (const Histo &histo, Matrix< double, Len > *covariance)
 
template<class Histo >
CPP11_auto_ptr< BinnedDensity1D > npstat::histoDensity1D (const Histo &histo, unsigned interpolationDegree=0)
 
template<class Histo >
CPP11_auto_ptr< BinnedDensityND > npstat::histoDensityND (const Histo &histo, unsigned interpolationDegree=0)
 

Detailed Description

Calculate various descriptive statistics for histograms.

Helper functions for calculating simple stats of multivariate histograms. Histogram bin centers are used as coordinates for which the statistical info is calculated and bin contents are used as weights. Naturally, a numerically sound two-pass algorithm is used to calculate the covariance matrix.

The code is not going to verify that every bin entry is non-negative (very often, this is already guaranteed by the manner in which the histogram is accumulated). Note, however, that in the presence of negative weights the results can not be easily interpreted.

Author: I. Volobouev

December 2011