SAGA API  v9.6
CSG_Simple_Statistics Class Reference

#include <mat_tools.h>

Public Member Functions

 CSG_Simple_Statistics (void)
 
 CSG_Simple_Statistics (bool bHoldValues)
 
 CSG_Simple_Statistics (const CSG_Simple_Statistics &Statistics)
 
 CSG_Simple_Statistics (double Mean, double StdDev, sLong Count=1000)
 
 CSG_Simple_Statistics (const CSG_Vector &Values, bool bHoldValues=false)
 
bool Create (bool bHoldValues=false)
 
bool Create (const CSG_Simple_Statistics &Statistics)
 
bool Create (double Mean, double StdDev, sLong Count=1000)
 
bool Create (const CSG_Vector &Values, bool bHoldValues=false)
 
void Invalidate (void)
 
bool Evaluate (void)
 
int is_Evaluated (void) const
 
bool Set_Count (sLong Count)
 
sLong Get_Count (void) const
 
double Get_Weights (void) const
 
double Get_Minimum (void)
 
double Get_Maximum (void)
 
double Get_Range (void)
 
double Get_Sum (void)
 
double Get_Sum_Of_Squares (void)
 
double Get_Mean (void)
 
double Get_Variance (void)
 
double Get_StdDev (void)
 
double Get_Kurtosis (void)
 
double Get_Skewness (void)
 
double Get_SkewnessPearson (void)
 
double Get_Quantile (double Quantile)
 
double Get_Percentile (double Percentile)
 
double Get_Median (void)
 
double Get_Gini (void)
 
sLong Get_IndexOfMinimum (void)
 
sLong Get_IndexOfMaximum (void)
 
sLong Get_nValues_Above (double Threshold, bool bEquals=false)
 
sLong Get_nValues_Below (double Threshold, bool bEquals=false)
 
void Add (const CSG_Simple_Statistics &Statistics)
 
void Add_Value (double Value, double Weight=1.)
 
double * Get_Values (void) const
 
double Get_Value (sLong i) const
 
double operator[] (sLong i) const
 
CSG_Simple_Statisticsoperator= (const CSG_Simple_Statistics &Statistics)
 
CSG_Simple_Statisticsoperator+= (const CSG_Simple_Statistics &Statistics)
 
CSG_Simple_Statisticsoperator+= (double Value)
 

Protected Member Functions

void _Evaluate (int Level=1)
 

Protected Attributes

bool m_bSorted
 
int m_bEvaluated
 
sLong m_nValues
 
double m_Weights
 
double m_Sum
 
double m_Sum2
 
double m_Minimum
 
double m_Maximum
 
double m_Range
 
double m_Mean
 
double m_Variance
 
double m_StdDev
 
double m_Kurtosis
 
double m_Skewness
 
double m_Gini
 
CSG_Array m_Values
 

Detailed Description

Definition at line 722 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Simple_Statistics() [1/5]

CSG_Simple_Statistics::CSG_Simple_Statistics ( void  )

Definition at line 324 of file mat_tools.cpp.

References Create().

◆ CSG_Simple_Statistics() [2/5]

CSG_Simple_Statistics::CSG_Simple_Statistics ( bool  bHoldValues)

Definition at line 329 of file mat_tools.cpp.

References Create().

◆ CSG_Simple_Statistics() [3/5]

CSG_Simple_Statistics::CSG_Simple_Statistics ( const CSG_Simple_Statistics Statistics)

Definition at line 334 of file mat_tools.cpp.

References Create().

◆ CSG_Simple_Statistics() [4/5]

CSG_Simple_Statistics::CSG_Simple_Statistics ( double  Mean,
double  StdDev,
sLong  Count = 1000 
)

Definition at line 339 of file mat_tools.cpp.

References Create().

◆ CSG_Simple_Statistics() [5/5]

CSG_Simple_Statistics::CSG_Simple_Statistics ( const CSG_Vector Values,
bool  bHoldValues = false 
)

Definition at line 344 of file mat_tools.cpp.

References Create().

Member Function Documentation

◆ _Evaluate()

void CSG_Simple_Statistics::_Evaluate ( int  Level = 1)
protected

◆ Add()

◆ Add_Value()

void CSG_Simple_Statistics::Add_Value ( double  Value,
double  Weight = 1. 
)

◆ Create() [1/4]

bool CSG_Simple_Statistics::Create ( bool  bHoldValues = false)

◆ Create() [2/4]

bool CSG_Simple_Statistics::Create ( const CSG_Simple_Statistics Statistics)

◆ Create() [3/4]

bool CSG_Simple_Statistics::Create ( const CSG_Vector Values,
bool  bHoldValues = false 
)

Definition at line 408 of file mat_tools.cpp.

References Add_Value(), Create(), and CSG_Vector::Get_Size().

◆ Create() [4/4]

bool CSG_Simple_Statistics::Create ( double  Mean,
double  StdDev,
sLong  Count = 1000 
)

◆ Evaluate()

bool CSG_Simple_Statistics::Evaluate ( void  )

Definition at line 473 of file mat_tools.cpp.

References _Evaluate(), and is_Evaluated().

Referenced by CSG_PointCloud::_Stats_Update(), and CSG_Table::_Stats_Update().

◆ Get_Count()

◆ Get_Gini()

double CSG_Simple_Statistics::Get_Gini ( void  )

The Gini coefficient is a measure of statistical dispersion intended to represent the income or wealth distribution of a nation's residents, and is the most commonly used measure of inequality.

Definition at line 681 of file mat_tools.cpp.

References CSG_Array::Get_Array(), Get_Count(), CSG_Array::Get_Size(), Get_Sum(), Get_Value(), m_bSorted, m_Gini, m_Values, and SG_Compare_Double().

◆ Get_IndexOfMaximum()

sLong CSG_Simple_Statistics::Get_IndexOfMaximum ( void  )

Returns the index of the maximum value in the order values have been added to the statistics. This is only supported for statistics that have been created with the bHoldValues option set to true.

Definition at line 734 of file mat_tools.cpp.

References CSG_Array::Get_Size(), Get_Values(), and m_Values.

◆ Get_IndexOfMinimum()

sLong CSG_Simple_Statistics::Get_IndexOfMinimum ( void  )

Returns the index of the minimum value in the order values have been added to the statistics. This is only supported for statistics that have been created with the bHoldValues option set to true.

Definition at line 710 of file mat_tools.cpp.

References CSG_Array::Get_Size(), Get_Values(), and m_Values.

◆ Get_Kurtosis()

double CSG_Simple_Statistics::Get_Kurtosis ( void  )
inline

Definition at line 755 of file mat_tools.h.

◆ Get_Maximum()

◆ Get_Mean()

◆ Get_Median()

double CSG_Simple_Statistics::Get_Median ( void  )

Returns the medium (i.e. thee 50 percentile or 0.5 quantile). Remark: any quantile calculation is only possible, if statistics has been created with the bHoldValues option set to true.

Definition at line 669 of file mat_tools.cpp.

References Get_Quantile().

Referenced by Get_SkewnessPearson().

◆ Get_Minimum()

◆ Get_nValues_Above()

sLong CSG_Simple_Statistics::Get_nValues_Above ( double  Threshold,
bool  bEquals = false 
)

Returns the number of values greater than the threshold value. This is only supported for statistics that have been created with the bHoldValues option set to true.

Definition at line 758 of file mat_tools.cpp.

References Get_Count(), CSG_Array::Get_Size(), Get_Value(), and m_Values.

◆ Get_nValues_Below()

sLong CSG_Simple_Statistics::Get_nValues_Below ( double  Threshold,
bool  bEquals = false 
)

Returns the number of values lower than the threshold value. This is only supported for statistics that have been created with the bHoldValues option set to true.

Definition at line 780 of file mat_tools.cpp.

References Get_Count(), CSG_Array::Get_Size(), Get_Value(), and m_Values.

◆ Get_Percentile()

double CSG_Simple_Statistics::Get_Percentile ( double  Percentile)

Returns the requested percentile (i.e. the quantile requested as percentage, the 50 percentile is the medium value). Remark: any quantile calculation is only possible, if statistics has been created with the bHoldValues option set to true.

Definition at line 658 of file mat_tools.cpp.

References Get_Quantile().

◆ Get_Quantile()

double CSG_Simple_Statistics::Get_Quantile ( double  Quantile)

Returns the requested quantile (value between 0 and 1). The 0.5 quantile returns the median. Remark: Remark: any quantile calculation is only possible, if statistics has been created with the bHoldValues option set to true.

Definition at line 618 of file mat_tools.cpp.

References CSG_Array::Get_Array(), CSG_Array::Get_Size(), Get_Values(), m_bSorted, m_Mean, m_Values, and SG_Compare_Double().

Referenced by Get_Median(), and Get_Percentile().

◆ Get_Range()

double CSG_Simple_Statistics::Get_Range ( void  )
inline

◆ Get_Skewness()

double CSG_Simple_Statistics::Get_Skewness ( void  )
inline

Definition at line 756 of file mat_tools.h.

◆ Get_SkewnessPearson()

double CSG_Simple_Statistics::Get_SkewnessPearson ( void  )

Skewness after Pearson, i.e. the difference of mean and median divided by standard deviation. Remark: Skewness calculation is only possible, if statistics has been created with the bHoldValues flag set to true.

Definition at line 606 of file mat_tools.cpp.

References Get_Mean(), Get_Median(), and Get_StdDev().

◆ Get_StdDev()

double CSG_Simple_Statistics::Get_StdDev ( void  )
inline

◆ Get_Sum()

double CSG_Simple_Statistics::Get_Sum ( void  )
inline

Definition at line 749 of file mat_tools.h.

Referenced by CSG_Regression_Multiple::Get_CrossValidation(), and Get_Gini().

◆ Get_Sum_Of_Squares()

double CSG_Simple_Statistics::Get_Sum_Of_Squares ( void  )
inline

Definition at line 750 of file mat_tools.h.

◆ Get_Value()

double CSG_Simple_Statistics::Get_Value ( sLong  i) const
inline

Definition at line 775 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Get_Gini(), Get_nValues_Above(), and Get_nValues_Below().

◆ Get_Values()

double* CSG_Simple_Statistics::Get_Values ( void  ) const
inline

Definition at line 774 of file mat_tools.h.

Referenced by Get_IndexOfMaximum(), Get_IndexOfMinimum(), and Get_Quantile().

◆ Get_Variance()

double CSG_Simple_Statistics::Get_Variance ( void  )
inline

◆ Get_Weights()

double CSG_Simple_Statistics::Get_Weights ( void  ) const
inline

Definition at line 744 of file mat_tools.h.

◆ Invalidate()

◆ is_Evaluated()

int CSG_Simple_Statistics::is_Evaluated ( void  ) const
inline

Definition at line 739 of file mat_tools.h.

Referenced by CSG_PointCloud::_Stats_Update(), CSG_Table::_Stats_Update(), and Evaluate().

◆ operator+=() [1/2]

CSG_Simple_Statistics& CSG_Simple_Statistics::operator+= ( const CSG_Simple_Statistics Statistics)
inline

Definition at line 780 of file mat_tools.h.

◆ operator+=() [2/2]

CSG_Simple_Statistics& CSG_Simple_Statistics::operator+= ( double  Value)
inline

Definition at line 781 of file mat_tools.h.

◆ operator=()

CSG_Simple_Statistics& CSG_Simple_Statistics::operator= ( const CSG_Simple_Statistics Statistics)
inline

Definition at line 779 of file mat_tools.h.

◆ operator[]()

double CSG_Simple_Statistics::operator[] ( sLong  i) const
inline

Definition at line 776 of file mat_tools.h.

◆ Set_Count()

Member Data Documentation

◆ m_bEvaluated

int CSG_Simple_Statistics::m_bEvaluated
protected

Definition at line 788 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), Invalidate(), and Set_Count().

◆ m_bSorted

bool CSG_Simple_Statistics::m_bSorted
protected

Definition at line 786 of file mat_tools.h.

Referenced by Add(), Add_Value(), Create(), Get_Gini(), Get_Quantile(), and Invalidate().

◆ m_Gini

double CSG_Simple_Statistics::m_Gini
protected

Definition at line 792 of file mat_tools.h.

Referenced by Create(), Get_Gini(), and Invalidate().

◆ m_Kurtosis

double CSG_Simple_Statistics::m_Kurtosis
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Create(), and Invalidate().

◆ m_Maximum

double CSG_Simple_Statistics::m_Maximum
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), and Invalidate().

◆ m_Mean

double CSG_Simple_Statistics::m_Mean
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Create(), Get_Quantile(), and Invalidate().

◆ m_Minimum

double CSG_Simple_Statistics::m_Minimum
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), and Invalidate().

◆ m_nValues

sLong CSG_Simple_Statistics::m_nValues
protected

Definition at line 790 of file mat_tools.h.

Referenced by Add(), Add_Value(), Create(), Invalidate(), and Set_Count().

◆ m_Range

double CSG_Simple_Statistics::m_Range
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Create(), and Invalidate().

◆ m_Skewness

double CSG_Simple_Statistics::m_Skewness
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Create(), and Invalidate().

◆ m_StdDev

double CSG_Simple_Statistics::m_StdDev
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Create(), and Invalidate().

◆ m_Sum

double CSG_Simple_Statistics::m_Sum
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), Invalidate(), and Set_Count().

◆ m_Sum2

double CSG_Simple_Statistics::m_Sum2
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), Invalidate(), and Set_Count().

◆ m_Values

◆ m_Variance

double CSG_Simple_Statistics::m_Variance
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Create(), and Invalidate().

◆ m_Weights

double CSG_Simple_Statistics::m_Weights
protected

Definition at line 792 of file mat_tools.h.

Referenced by _Evaluate(), Add(), Add_Value(), Create(), Invalidate(), and Set_Count().


The documentation for this class was generated from the following files: