STK++ 0.9.13
|
Computation of the univariate Statistics of a Real Variable. More...
#include <STK_Stat_UnivariateReal.h>
Public Member Functions | |
Univariate (TContainer1D const &V, bool sorted=false) | |
Default constructor Copy locally the variable V and set dimensions. | |
Univariate (TContainer1D const &V, TContainer1D const &W, bool sorted=false) | |
Default constructor for weighted variables. | |
Univariate (const Univariate &stat) | |
Copy constructor. | |
~Univariate () | |
destructor. | |
Univariate & | operator= (const Univariate &stat) |
Operator = : overwrite the Univariate with stat. | |
template<class Vector > | |
void | setData (Vector const &V, bool sorted=false) |
Compute the statistics of a new Variable. | |
template<class Vector , class Weights > | |
void | setData (Vector const &V, Weights const &W, bool sorted=false) |
Compute the statistics of a new weighted Variable. | |
const int | nbSamples () const |
get the number of samples | |
const int | nbAvailableSamples () const |
get the number of available samples (not missing) | |
const int | nbMissingSamples () const |
get the number of missing samples | |
const Real | min () const |
get the min of the variable | |
const Real | max () const |
get the max of the variable | |
const Real | aMax () const |
get the absolute maximal value | |
const Real | mean () const |
get the mean of the variable | |
const Real | median () const |
get the median of the variable | |
const Real | variance () const |
get the variance of the variable (division by n) | |
const Real | unbiasedVariance () const |
get the unbiased Variance of the variable (division by n-1) | |
const Real | std () const |
get the standard deviation of the variable | |
const Real | unbiasedStd () const |
get the sample standard deviation of the variable | |
const Real | mad () const |
get the median absolute deviation of the variable | |
const Real | kurtosis () const |
get the kurtosis of the variable | |
const Real | skewness () const |
get the skewness of the variable | |
Variable< Real > const & | quartiles () const |
get the quartiles of the variable (25%) | |
Variable< Real > const & | deciles () const |
get the deciles of the varibales (10%) | |
Variable< Real > const & | viceciles () const |
get the viceciles of the variable (5%) | |
Variable< Real > const & | percentiles () const |
get the percentiles of the variable (1%) | |
template<class OtherArray > | |
void | compQuantiles (OtherArray &T) |
Compute the quantiles of the sorted variable V_ and store the result in the array T. | |
Protected Attributes | |
int | nbSamples_ |
Number of samples. | |
int | nbAvailable_ |
Number of Available samples. | |
int | nbMiss_ |
Number of missing samples. | |
TContainer1D | V_ |
local copy of the variable | |
TContainer1D | W_ |
local copy of the weights | |
bool | weighted_ |
Samples are weighted ? | |
bool | sorted_ |
Samples are sorted ? | |
bool | comporder_ |
Orders Statistics are computed ? | |
bool | compstat_ |
Usuals Statistics are computed ? | |
Real | sumweights_ |
Sum of the weights. | |
Real | sum2weights_ |
Sum of the square of the weights. | |
Real | min_ |
Min of the variable. | |
Real | max_ |
Max of the variable. | |
Real | amax_ |
Absolute maximal value. | |
Real | mean_ |
mean of the variable | |
Real | median_ |
median of the variable | |
Real | var_ |
Variance of the variable (division by n) | |
Real | uvar_ |
Unbiased Variance of the variable (division by n-1) | |
Real | std_ |
Standard deviation of the variable (n) | |
Real | ustd_ |
Sample standard deviation of the variable (n-1) | |
Real | mad_ |
absolute deviation of the variable | |
Real | kurtosis_ |
kurtosis of the variable | |
Real | skewness_ |
Skewness of the variable. | |
Variable< Real > | quartiles_ |
Quartiles (25%) | |
Variable< Real > | deciles_ |
Deciles (10%) | |
Variable< Real > | viceciles_ |
viceciles (5%) | |
Variable< Real > | percentiles_ |
percentiles (1%) | |
Private Member Functions | |
void | initializeVariable () |
Initialize the container in order to discard the missing elements in the non weighted case. | |
void | initializeVariableAndWeights () |
Initialize the containers in order to discard the missing elements in the weighted case. | |
void | compStatistics () |
Compute the usual statistics of the variable: | |
void | compWeightedStatistics () |
Compute the usual weighted statistics of the variable. | |
void | compOrderStatistics () |
Compute the Order Statistics of the variable. | |
Computation of the univariate Statistics of a Real Variable.
This is a specialization of the class Univariate for the type Real
.
The template parameter TContainer1D
is the type of container used for storing the data : It should derive from ITContainer
and contain elements of type Real.
This specialization propose also statics methods for computing the (weighted) mean and the (weighted) variance.
Definition at line 63 of file STK_Stat_UnivariateReal.h.
|
inline |
Default constructor Copy locally the variable V and set dimensions.
The statistics are then computed.
V | variable |
sorted | true if the variable is sorted, false otherwise |
Definition at line 72 of file STK_Stat_UnivariateReal.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.
|
inline |
Default constructor for weighted variables.
Copy locally the variable V, the weights W and set dimensions. No statistics except min_, max_ and amax_ are calculated at this stage.
V,W | the variable and the weights |
sorted | true if the variable is sorted, false otherwise |
Definition at line 111 of file STK_Stat_UnivariateReal.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKRUNTIME_ERROR_NO_ARG.
|
inline |
Copy constructor.
stat | the univariate statistics to copy |
Definition at line 148 of file STK_Stat_UnivariateReal.h.
|
inline |
|
inline |
|
inlineprivate |
Compute the Order Statistics of the variable.
Definition at line 624 of file STK_Stat_UnivariateReal.h.
References STK::applySort1D(), STK::heapSort(), and STK::Arithmetic< Type >::NA().
|
inline |
Compute the quantiles of the sorted variable V_ and store the result in the array T.
The number of quantiles is given by the size of T. For exemple, if T.size() == 9, compQuantiles will return the deciles.
T | TContainer1Ds of the *tiles |
Definition at line 352 of file STK_Stat_UnivariateReal.h.
References STKRUNTIME_ERROR_NO_ARG.
|
inlineprivate |
Compute the usual statistics of the variable:
Definition at line 460 of file STK_Stat_UnivariateReal.h.
References STK::Arithmetic< Type >::NA(), and STK::Stat::sum().
|
inlineprivate |
Compute the usual weighted statistics of the variable.
Definition at line 546 of file STK_Stat_UnivariateReal.h.
References STK::Arithmetic< Type >::NA(), and STK::Stat::sum().
|
inline |
|
inlineprivate |
Initialize the container in order to discard the missing elements in the non weighted case.
Definition at line 378 of file STK_Stat_UnivariateReal.h.
References STK::isNA(), and STK::Arithmetic< Type >::NA().
|
inlineprivate |
Initialize the containers in order to discard the missing elements in the weighted case.
Definition at line 417 of file STK_Stat_UnivariateReal.h.
References STK::isNA(), and STK::Arithmetic< Type >::NA().
|
inline |
|
inline |
get the median absolute deviation of the variable
Definition at line 329 of file STK_Stat_UnivariateReal.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
get the number of available samples (not missing)
Definition at line 304 of file STK_Stat_UnivariateReal.h.
|
inline |
|
inline |
|
inline |
Operator = : overwrite the Univariate with stat.
Definition at line 182 of file STK_Stat_UnivariateReal.h.
|
inline |
|
inline |
|
inline |
Compute the statistics of a new Variable.
V | the variable to set |
sorted | true if the variable is sorted |
Definition at line 220 of file STK_Stat_UnivariateReal.h.
References STK::IArray2D< Derived >::clear(), STK::Arithmetic< Type >::NA(), and STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.
|
inline |
Compute the statistics of a new weighted Variable.
V,W | the variable and the weights to set |
sorted | true if the variable is sorted |
Definition at line 261 of file STK_Stat_UnivariateReal.h.
References STK::Arithmetic< Type >::NA(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKRUNTIME_ERROR_NO_ARG.
|
inline |
|
inline |
get the standard deviation of the variable
Definition at line 325 of file STK_Stat_UnivariateReal.h.
|
inline |
get the sample standard deviation of the variable
Definition at line 327 of file STK_Stat_UnivariateReal.h.
|
inline |
get the unbiased Variance of the variable (division by n-1)
Definition at line 323 of file STK_Stat_UnivariateReal.h.
|
inline |
get the variance of the variable (division by n)
Definition at line 321 of file STK_Stat_UnivariateReal.h.
|
inline |
|
protected |
Absolute maximal value.
Definition at line 692 of file STK_Stat_UnivariateReal.h.
|
protected |
Orders Statistics are computed ?
Definition at line 684 of file STK_Stat_UnivariateReal.h.
|
protected |
Usuals Statistics are computed ?
Definition at line 685 of file STK_Stat_UnivariateReal.h.
|
protected |
Deciles (10%)
Definition at line 705 of file STK_Stat_UnivariateReal.h.
|
protected |
kurtosis of the variable
Definition at line 701 of file STK_Stat_UnivariateReal.h.
|
protected |
absolute deviation of the variable
Definition at line 700 of file STK_Stat_UnivariateReal.h.
|
protected |
Max of the variable.
Definition at line 691 of file STK_Stat_UnivariateReal.h.
|
protected |
mean of the variable
Definition at line 694 of file STK_Stat_UnivariateReal.h.
|
protected |
median of the variable
Definition at line 695 of file STK_Stat_UnivariateReal.h.
|
protected |
Min of the variable.
Definition at line 690 of file STK_Stat_UnivariateReal.h.
|
protected |
Number of Available samples.
Definition at line 674 of file STK_Stat_UnivariateReal.h.
|
protected |
Number of missing samples.
Definition at line 675 of file STK_Stat_UnivariateReal.h.
|
protected |
Number of samples.
Definition at line 673 of file STK_Stat_UnivariateReal.h.
|
protected |
percentiles (1%)
Definition at line 707 of file STK_Stat_UnivariateReal.h.
|
protected |
Quartiles (25%)
Definition at line 704 of file STK_Stat_UnivariateReal.h.
|
protected |
Skewness of the variable.
Definition at line 702 of file STK_Stat_UnivariateReal.h.
|
protected |
Samples are sorted ?
Definition at line 683 of file STK_Stat_UnivariateReal.h.
|
protected |
Standard deviation of the variable (n)
Definition at line 698 of file STK_Stat_UnivariateReal.h.
|
protected |
Sum of the square of the weights.
Definition at line 689 of file STK_Stat_UnivariateReal.h.
|
protected |
Sum of the weights.
Definition at line 688 of file STK_Stat_UnivariateReal.h.
|
protected |
Sample standard deviation of the variable (n-1)
Definition at line 699 of file STK_Stat_UnivariateReal.h.
|
protected |
Unbiased Variance of the variable (division by n-1)
Definition at line 697 of file STK_Stat_UnivariateReal.h.
|
protected |
local copy of the variable
Definition at line 678 of file STK_Stat_UnivariateReal.h.
|
protected |
Variance of the variable (division by n)
Definition at line 696 of file STK_Stat_UnivariateReal.h.
|
protected |
viceciles (5%)
Definition at line 706 of file STK_Stat_UnivariateReal.h.
|
protected |
local copy of the weights
Definition at line 679 of file STK_Stat_UnivariateReal.h.
|
protected |
Samples are weighted ?
Definition at line 682 of file STK_Stat_UnivariateReal.h.