libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
Statistics
+ Collaboration diagram for Statistics:

Classes

class  crn::Histogram
 Mother class for integer histograms. More...
 
class  crn::PCA
 Class to perform Principal Componant Analysis. More...
 

Functions

template<typename T >
crn::Max (const std::vector< T > &v)
 Data analysis. More...
 
template<typename T >
crn::Max (const std::vector< std::vector< T >> &m)
 Returns max. More...
 
template<typename T >
crn::Min (const std::vector< T > &v)
 Returns min. More...
 
template<typename T >
crn::Min (const std::vector< std::vector< T >> &m)
 Returns min. More...
 
template<typename T >
std::tuple< T, T > crn::MinMax (const std::vector< T > &v)
 Returns min and max. More...
 
template<typename T >
std::tuple< T, T > crn::MinMax (const std::vector< std::vector< T >> &m)
 Returns min and max. More...
 
template<typename T >
size_t crn::Argmax (const std::vector< T > &v)
 Return index of a maximal. More...
 
template<typename T >
size_t crn::Argmin (const std::vector< T > &v)
 Return index of a minimal. More...
 
template<typename T >
size_t crn::ColumnArgmax (const std::vector< std::vector< T >> &m, size_t col)
 Return index of a maximal on a column. More...
 
template<typename T >
size_t crn::ColumnArgmin (const std::vector< std::vector< T >> &m, size_t col)
 Return index of a minimal on a column. More...
 
double crn::Mean (const std::vector< double > &v)
 Return mean value of sample. More...
 
template<typename ITER >
std::iterator_traits< ITER >
::value_type 
crn::Mean (ITER be, ITER en)
 Return mean value of sample. More...
 
template<typename ITER >
double crn::MeanAsDouble (ITER be, ITER en)
 Return mean value of sample as a double value. More...
 
std::vector< double > crn::MeanPattern (const std::vector< std::vector< double >> &m)
 Return mean pattern of sample. More...
 
template<typename ITER >
std::vector< double > crn::MeanPattern (ITER it_begin, ITER it_end)
 
double crn::StdDeviation (const std::vector< double > &v)
 Return deviation of sample. More...
 
double crn::Variance (const std::vector< double > &v)
 Return variance of sample. More...
 
std::vector< std::vector
< double > > 
crn::MakeCovariance (const std::vector< std::vector< double >> &m)
 Return covariance for sample. More...
 
template<typename ITER >
std::vector< std::vector
< double > > 
crn::MakeCovariance (ITER it_begin, ITER it_end)
 
std::tuple< double, double,
double > 
crn::MeanVarDev (const std::vector< double > &v)
 Return mean, variance and standard deviation of sample. More...
 
template<typename ITER >
std::tuple< double, double,
double > 
crn::MeanVarDev (ITER it_begin, ITER it_end)
 
std::vector< double > crn::Quantiles (const std::vector< double > &v, size_t q, bool sort_flag=true)
 Return quantile values of sample. More...
 
template<typename T >
crn::MedianValue (const std::vector< T > &v)
 Median value. More...
 
template<typename T >
bool crn::AllEqual (const std::vector< T > &v)
 Test if all data values are equal. More...
 
template<typename T >
bool crn::AllEqual (const std::vector< std::vector< T >> &m)
 Test if all data values are equal. More...
 
Histogram crn::MakeHistogram (const std::vector< double > &v, size_t nb_bins)
 Returns count histogram. More...
 
Histogram crn::MakeHistogramSquareRoot (const std::vector< double > &v)
 Returns count histogram (#bins = sqrt(pop) ) More...
 
Histogram crn::MakeHistogramSturges (const std::vector< double > &v)
 Returns count histogram (#bins = 1+log_2(pop) ) More...
 
Histogram crn::MakeHistogramRice (const std::vector< double > &v)
 Returns count histogram (#bins = 2n^(1/3) ) More...
 
Histogram crn::MakeHistogramScott (const std::vector< double > &v)
 Returns count histogram (bin width = 3.5 * stddev / pop^(1/3)) More...
 
Histogram crn::MakeHistogramFreedmanDiaconis (const std::vector< double > &v, bool sort_flag=true)
 Returns count histogram (bin width = 2 * IQR(v) / pop^(1/3)) More...
 
UnivariateGaussianMixture crn::MakeGaussianMixtureModel (const std::vector< double > &v, size_t nb_seeds=2)
 Return Gaussian mixture model modeling current (univariate) sample. More...
 
MultivariateGaussianMixture crn::MakeGaussianMixtureModel (const std::vector< std::vector< double >> &patterns, size_t nb_seeds=2)
 Return Gaussian mixture model modeling current (multivariate) sample. More...
 

Detailed Description

Function Documentation

template<typename T >
bool crn::AllEqual ( const std::vector< T > &  v)
inline

Test if all data values are equal.

Definition at line 348 of file CRNStatisticSample.h.

template<typename T >
bool crn::AllEqual ( const std::vector< std::vector< T >> &  m)
inline

Test if all data values are equal.

Definition at line 350 of file CRNStatisticSample.h.

template<typename T >
size_t crn::Argmax ( const std::vector< T > &  v)
inline

Return index of a maximal.

Definition at line 102 of file CRNStatisticSample.h.

template<typename T >
size_t crn::Argmin ( const std::vector< T > &  v)
inline

Return index of a minimal.

Definition at line 104 of file CRNStatisticSample.h.

template<typename T >
size_t crn::ColumnArgmax ( const std::vector< std::vector< T >> &  m,
size_t  col 
)

Return index of a maximal on a column.

Definition at line 106 of file CRNStatisticSample.h.

template<typename T >
size_t crn::ColumnArgmin ( const std::vector< std::vector< T >> &  m,
size_t  col 
)

Return index of a minimal on a column.

Definition at line 119 of file CRNStatisticSample.h.

std::vector< std::vector< double > > crn::MakeCovariance ( const std::vector< std::vector< double >> &  m)

Return covariance for sample.

Parameters
[in]ma matrix of doubles
Returns
covariance for sample

Definition at line 129 of file CRNStatisticSample.cpp.

template<typename ITER >
std::vector<std::vector<double> > crn::MakeCovariance ( ITER  it_begin,
ITER  it_end 
)

Definition at line 240 of file CRNStatisticSample.h.

UnivariateGaussianMixture crn::MakeGaussianMixtureModel ( const std::vector< double > &  v,
size_t  nb_seeds = 2 
)

Return Gaussian mixture model modeling current (univariate) sample.

Parameters
[in]va vector of doubles
[in]nb_seedsthe number of desired Gaussians
Returns
Gaussian mixture model modeling an univariate sample

Definition at line 326 of file CRNStatisticSample.cpp.

MultivariateGaussianMixture crn::MakeGaussianMixtureModel ( const std::vector< std::vector< double >> &  patterns,
size_t  nb_seeds = 2 
)

Return Gaussian mixture model modeling current (multivariate) sample.

Create a gaussian mixture to model a given set of data

Parameters
[in]patternsa matrix of doubles
[in]nb_seedsthe number of desired Gaussians
Returns
Gaussian mixture model modeling a multivariate sample

Definition at line 348 of file CRNStatisticSample.cpp.

Histogram crn::MakeHistogram ( const std::vector< double > &  v,
size_t  nb_bins 
)

Returns count histogram.

Parameters
[in]va vector of doubles
[in]nb_binsthe desired size of the histogram
Returns
count histogram

Definition at line 250 of file CRNStatisticSample.cpp.

Histogram crn::MakeHistogramFreedmanDiaconis ( const std::vector< double > &  v,
bool  sort_flag = true 
)

Returns count histogram (bin width = 2 * IQR(v) / pop^(1/3))

Parameters
[in]va vector of doubles
Returns
count histogram (Freedman-Diaconis rule: bin width = 2 * IQR(v) / pop^(1/3))

Definition at line 313 of file CRNStatisticSample.cpp.

Histogram crn::MakeHistogramRice ( const std::vector< double > &  v)

Returns count histogram (#bins = 2n^(1/3) )

Parameters
[in]va vector of doubles
Returns
count histogram (Riche rule: nb bins = 2 * pop^(1/3))

Definition at line 293 of file CRNStatisticSample.cpp.

Histogram crn::MakeHistogramScott ( const std::vector< double > &  v)

Returns count histogram (bin width = 3.5 * stddev / pop^(1/3))

Parameters
[in]va vector of doubles
Returns
count histogram (Scott rule: bin width = 3.5 * stddev / pop^(1/3))

Definition at line 302 of file CRNStatisticSample.cpp.

Histogram crn::MakeHistogramSquareRoot ( const std::vector< double > &  v)

Returns count histogram (#bins = sqrt(pop) )

Parameters
[in]va vector of doubles
Returns
count histogram (Square root rule: nb bins = sqrt(pop))

Definition at line 275 of file CRNStatisticSample.cpp.

Histogram crn::MakeHistogramSturges ( const std::vector< double > &  v)

Returns count histogram (#bins = 1+log_2(pop) )

Parameters
[in]va vector of doubles
Returns
count histogram (Sturges rule: nb bins = 1 + log_2(pop))

Definition at line 284 of file CRNStatisticSample.cpp.

template<typename T >
T crn::Max ( const std::vector< T > &  v)
inline

Data analysis.

Data analysis

Author
Jean DUONG, Yann LEYDIER
Date
Dec 2014
Version
0.1

Returns max

Definition at line 57 of file CRNStatisticSample.h.

template<typename T >
T crn::Max ( const std::vector< std::vector< T >> &  m)
inline

Returns max.

Definition at line 59 of file CRNStatisticSample.h.

double crn::Mean ( const std::vector< double > &  v)

Return mean value of sample.

Parameters
[in]va vector of doubles
Returns
mean value of sample

Definition at line 40 of file CRNStatisticSample.cpp.

template<typename ITER >
std::iterator_traits<ITER>::value_type crn::Mean ( ITER  be,
ITER  en 
)

Return mean value of sample.

Warning
Use only with small ranges. For big samples, use double version.
Integral sequences will return an integral mean.
Parameters
[in]bebegin iterator
[in]enend iterator
Returns
the mean value

Definition at line 142 of file CRNStatisticSample.h.

template<typename ITER >
double crn::MeanAsDouble ( ITER  be,
ITER  en 
)

Return mean value of sample as a double value.

Parameters
[in]bebegin iterator
[in]enend iterator
Returns
the mean value

Definition at line 155 of file CRNStatisticSample.h.

std::vector< double > crn::MeanPattern ( const std::vector< std::vector< double >> &  m)

Return mean pattern of sample.

Parameters
[in]ma vector of vector doubles
Returns
mean pattern of sample

Definition at line 60 of file CRNStatisticSample.cpp.

template<typename ITER >
std::vector<double> crn::MeanPattern ( ITER  it_begin,
ITER  it_end 
)

Average pattern

Parameters
[in]it_beginiterator pointing to first double-size_t pair of input data
[in]it_endending iterator
Returns
mean pattern of sample

Definition at line 181 of file CRNStatisticSample.h.

std::tuple< double, double, double > crn::MeanVarDev ( const std::vector< double > &  v)

Return mean, variance and standard deviation of sample.

Parameters
[in]va vector of doubles
Returns
mean, variance and standard deviation of sample

Definition at line 152 of file CRNStatisticSample.cpp.

template<typename ITER >
std::tuple<double, double, double> crn::MeanVarDev ( ITER  it_begin,
ITER  it_end 
)

Mean, variance and deviation for a sample

Parameters
[in]it_beginiterator pointing to first pair of input data
[in]it_endending iterator
Returns
mean pattern of sample

Definition at line 273 of file CRNStatisticSample.h.

template<typename T >
T crn::MedianValue ( const std::vector< T > &  v)

Median value.

Definition at line 340 of file CRNStatisticSample.h.

template<typename T >
T crn::Min ( const std::vector< T > &  v)
inline

Returns min.

Definition at line 70 of file CRNStatisticSample.h.

template<typename T >
T crn::Min ( const std::vector< std::vector< T >> &  m)
inline

Returns min.

Definition at line 72 of file CRNStatisticSample.h.

template<typename T >
std::tuple<T, T> crn::MinMax ( const std::vector< T > &  v)
inline

Returns min and max.

Definition at line 83 of file CRNStatisticSample.h.

template<typename T >
std::tuple<T, T> crn::MinMax ( const std::vector< std::vector< T >> &  m)
inline

Returns min and max.

Definition at line 89 of file CRNStatisticSample.h.

std::vector< double > crn::Quantiles ( const std::vector< double > &  v,
size_t  q,
bool  sort_flag = true 
)

Return quantile values of sample.

Get quantile values

Exceptions
ExceptionDomainillegal range
Parameters
[in]vstatistic sample
[in]qnumber of bins required
[in]sort_flagshall the statistic sample be sorted?
Returns
quantile values of sample

Definition at line 216 of file CRNStatisticSample.cpp.

double crn::StdDeviation ( const std::vector< double > &  v)

Return deviation of sample.

Parameters
[in]va vector of doubles
Returns
deviation of sample

Definition at line 95 of file CRNStatisticSample.cpp.

double crn::Variance ( const std::vector< double > &  v)

Return variance of sample.

Parameters
[in]va vector of doubles
Returns
variance of sample

Definition at line 104 of file CRNStatisticSample.cpp.