SAGA API v9.10
Loading...
Searching...
No Matches
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 724 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().

Referenced by Add(), Create(), CSG_Simple_Statistics(), operator+=(), operator+=(), and operator=().

◆ 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(), and CSG_Simple_Statistics().

◆ 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()

◆ Add()

void CSG_Simple_Statistics::Add ( const CSG_Simple_Statistics & Statistics)

◆ Add_Value()

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

◆ Create() [1/4]

◆ 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()

sLong CSG_Simple_Statistics::Get_Count ( void ) const
inline

◆ 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 Get_Count(), 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 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 Get_Values(), and m_Values.

◆ Get_Kurtosis()

double CSG_Simple_Statistics::Get_Kurtosis ( void )
inline

Definition at line 757 of file mat_tools.h.

References _Evaluate(), m_bEvaluated, and m_Kurtosis.

◆ Get_Maximum()

double CSG_Simple_Statistics::Get_Maximum ( void )
inline

◆ 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()

double CSG_Simple_Statistics::Get_Minimum ( void )
inline

◆ 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(), 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(), 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 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

Definition at line 750 of file mat_tools.h.

References _Evaluate(), m_bEvaluated, and m_Range.

Referenced by CSG_Regression_Multiple::Get_CrossValidation().

◆ Get_Skewness()

double CSG_Simple_Statistics::Get_Skewness ( void )
inline

Definition at line 758 of file mat_tools.h.

References _Evaluate(), m_bEvaluated, and m_Skewness.

◆ 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

Definition at line 755 of file mat_tools.h.

References _Evaluate(), m_bEvaluated, and m_StdDev.

Referenced by _Evaluate(), Get_SkewnessPearson(), and SG_Get_Correlation_Matrix().

◆ Get_Sum()

double CSG_Simple_Statistics::Get_Sum ( void )
inline

Definition at line 751 of file mat_tools.h.

References _Evaluate(), m_bEvaluated, and m_Sum.

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 752 of file mat_tools.h.

References _Evaluate(), m_bEvaluated, and m_Sum2.

◆ Get_Value()

double CSG_Simple_Statistics::Get_Value ( sLong i) const
inline

Definition at line 777 of file mat_tools.h.

References Get_Values(), m_Mean, and m_Values.

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 776 of file mat_tools.h.

References m_Values.

Referenced by Get_IndexOfMaximum(), Get_IndexOfMinimum(), Get_Quantile(), Get_Value(), and operator[]().

◆ Get_Variance()

double CSG_Simple_Statistics::Get_Variance ( void )
inline

Definition at line 754 of file mat_tools.h.

References _Evaluate(), m_bEvaluated, and m_Variance.

Referenced by CSG_Regression::Calculate().

◆ Get_Weights()

double CSG_Simple_Statistics::Get_Weights ( void ) const
inline

Definition at line 746 of file mat_tools.h.

References m_Weights.

◆ Invalidate()

void CSG_Simple_Statistics::Invalidate ( void )

◆ is_Evaluated()

int CSG_Simple_Statistics::is_Evaluated ( void ) const
inline

Definition at line 741 of file mat_tools.h.

References m_bEvaluated.

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 782 of file mat_tools.h.

References Add(), and CSG_Simple_Statistics().

◆ operator+=() [2/2]

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

Definition at line 783 of file mat_tools.h.

References Add_Value(), and CSG_Simple_Statistics().

◆ operator=()

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

Definition at line 781 of file mat_tools.h.

References Create(), and CSG_Simple_Statistics().

◆ operator[]()

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

Definition at line 778 of file mat_tools.h.

References Get_Values(), m_Mean, and m_Values.

◆ Set_Count()

bool CSG_Simple_Statistics::Set_Count ( sLong Count)

Definition at line 424 of file mat_tools.cpp.

References m_bEvaluated, m_nValues, m_Sum, m_Sum2, m_Values, and m_Weights.

Referenced by CSG_Table::_Stats_Update().

Member Data Documentation

◆ m_bEvaluated

◆ m_bSorted

bool CSG_Simple_Statistics::m_bSorted
protected

Definition at line 788 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 794 of file mat_tools.h.

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

◆ m_Kurtosis

double CSG_Simple_Statistics::m_Kurtosis
protected

Definition at line 794 of file mat_tools.h.

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

◆ m_Maximum

double CSG_Simple_Statistics::m_Maximum
protected

Definition at line 794 of file mat_tools.h.

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

◆ m_Mean

double CSG_Simple_Statistics::m_Mean
protected

◆ m_Minimum

double CSG_Simple_Statistics::m_Minimum
protected

Definition at line 794 of file mat_tools.h.

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

◆ m_nValues

sLong CSG_Simple_Statistics::m_nValues
protected

Definition at line 792 of file mat_tools.h.

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

◆ m_Range

double CSG_Simple_Statistics::m_Range
protected

Definition at line 794 of file mat_tools.h.

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

◆ m_Skewness

double CSG_Simple_Statistics::m_Skewness
protected

Definition at line 794 of file mat_tools.h.

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

◆ m_StdDev

double CSG_Simple_Statistics::m_StdDev
protected

Definition at line 794 of file mat_tools.h.

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

◆ m_Sum

double CSG_Simple_Statistics::m_Sum
protected

Definition at line 794 of file mat_tools.h.

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

◆ m_Sum2

double CSG_Simple_Statistics::m_Sum2
protected

◆ m_Values

◆ m_Variance

double CSG_Simple_Statistics::m_Variance
protected

Definition at line 794 of file mat_tools.h.

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

◆ m_Weights

double CSG_Simple_Statistics::m_Weights
protected

Definition at line 794 of file mat_tools.h.

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


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