Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
hgps::core::UnivariateSummary Class Reference

Defines an univariate statistical summary data type. More...

#include <univariate_summary.h>

Public Member Functions

 UnivariateSummary ()
 Initialises a new instance of the UnivariateSummary class. More...
 
 UnivariateSummary (const std::string name)
 Initialises a new instance of the UnivariateSummary class. More...
 
 UnivariateSummary (const std::vector< double > values)
 Initialises a new instance of the UnivariateSummary class. More...
 
 UnivariateSummary (const std::string name, const std::vector< double > values)
 Initialises a new instance of the UnivariateSummary class. More...
 
std::string name () const noexcept
 Gets the factor or variable name. More...
 
bool is_empty () const noexcept
 Determine whether the summary is empty. More...
 
unsigned int count_valid () const noexcept
 Gets the number of valid data points included in the summary. More...
 
unsigned int count_null () const noexcept
 Gets the number of null data points, not included in the summary. More...
 
unsigned int count_total () const noexcept
 Gets the total number of data points. More...
 
double min () const noexcept
 Gets the minimum. More...
 
double max () const noexcept
 Gets the maximum. More...
 
double range () const noexcept
 Gets the summary data range. More...
 
double sum () const noexcept
 Gets the sum value. More...
 
double average () const noexcept
 Gets the average or mean. More...
 
double variance () const noexcept
 Gets the sample variance. More...
 
double std_deviation () const noexcept
 Gets the sample standard deviation. More...
 
double std_error () const noexcept
 Gets the standard error. More...
 
double kurtosis () const noexcept
 Gets the kurtosis. More...
 
double skewness () const noexcept
 Gets the skewness. More...
 
void clear () noexcept
 Clears current summary (empty) More...
 
void append (double value) noexcept
 Append a new data point to the summary. More...
 
void append (const std::optional< double > &option) noexcept
 Append a new data point or null value to the summary. More...
 
void append (const std::vector< double > &values) noexcept
 Append multiple data points to the summary. More...
 
void append_null () noexcept
 Append a single null value to the summary. More...
 
void append_null (unsigned int count) noexcept
 Append multiple null values to the summary. More...
 
std::string to_string () const noexcept
 Convert this instance to a string representation. More...
 

Friends

std::ostream & operator<< (std::ostream &stream, const UnivariateSummary &summary)
 Output streams operator for UnivariateSummary type. More...
 

Detailed Description

Defines an univariate statistical summary data type.

Calculates running summaries using statistical moments for constant storage size without storing the data points. Null values can be counted but are not included in any calculations.

Constructor & Destructor Documentation

◆ UnivariateSummary() [1/4]

hgps::core::UnivariateSummary::UnivariateSummary ( )

Initialises a new instance of the UnivariateSummary class.

◆ UnivariateSummary() [2/4]

hgps::core::UnivariateSummary::UnivariateSummary ( const std::string  name)

Initialises a new instance of the UnivariateSummary class.

Parameters
nameThe factor or variable name

◆ UnivariateSummary() [3/4]

hgps::core::UnivariateSummary::UnivariateSummary ( const std::vector< double >  values)

Initialises a new instance of the UnivariateSummary class.

Parameters
valuesThe values to summary
Here is the call graph for this function:

◆ UnivariateSummary() [4/4]

hgps::core::UnivariateSummary::UnivariateSummary ( const std::string  name,
const std::vector< double >  values 
)

Initialises a new instance of the UnivariateSummary class.

Parameters
nameThe factor or variable name
valuesThe values to summary
Here is the call graph for this function:

Member Function Documentation

◆ append() [1/3]

void hgps::core::UnivariateSummary::append ( const std::optional< double > &  option)
noexcept

Append a new data point or null value to the summary.

Parameters
optionThe optional value to add

◆ append() [2/3]

void hgps::core::UnivariateSummary::append ( const std::vector< double > &  values)
noexcept

Append multiple data points to the summary.

Parameters
valuesThe values to add

◆ append() [3/3]

void hgps::core::UnivariateSummary::append ( double  value)
noexcept

Append a new data point to the summary.

Parameters
valueThe value to add
Here is the caller graph for this function:

◆ append_null() [1/2]

void hgps::core::UnivariateSummary::append_null ( )
noexcept

Append a single null value to the summary.

◆ append_null() [2/2]

void hgps::core::UnivariateSummary::append_null ( unsigned int  count)
noexcept

Append multiple null values to the summary.

Parameters
countThe number of null values to add

◆ average()

double hgps::core::UnivariateSummary::average ( ) const
noexcept

Gets the average or mean.

Returns
Average value
Here is the caller graph for this function:

◆ clear()

void hgps::core::UnivariateSummary::clear ( )
noexcept

Clears current summary (empty)

◆ count_null()

unsigned int hgps::core::UnivariateSummary::count_null ( ) const
noexcept

Gets the number of null data points, not included in the summary.

Returns
Number of valid data points
Here is the caller graph for this function:

◆ count_total()

unsigned int hgps::core::UnivariateSummary::count_total ( ) const
noexcept

Gets the total number of data points.

Returns
Total number of data points
Here is the call graph for this function:
Here is the caller graph for this function:

◆ count_valid()

unsigned int hgps::core::UnivariateSummary::count_valid ( ) const
noexcept

Gets the number of valid data points included in the summary.

Returns
Number of valid data points
Here is the caller graph for this function:

◆ is_empty()

bool hgps::core::UnivariateSummary::is_empty ( ) const
noexcept

Determine whether the summary is empty.

Returns
true if the summary has is empty; otherwise, false.

◆ kurtosis()

double hgps::core::UnivariateSummary::kurtosis ( ) const
noexcept

Gets the kurtosis.

Returns
Kurtosis value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ max()

double hgps::core::UnivariateSummary::max ( ) const
noexcept

Gets the maximum.

Returns
Maximum value
Here is the caller graph for this function:

◆ min()

double hgps::core::UnivariateSummary::min ( ) const
noexcept

Gets the minimum.

Returns
Minimum value
Here is the caller graph for this function:

◆ name()

std::string hgps::core::UnivariateSummary::name ( ) const
noexcept

Gets the factor or variable name.

Returns
The name identification
Here is the caller graph for this function:

◆ range()

double hgps::core::UnivariateSummary::range ( ) const
noexcept

Gets the summary data range.

Returns
Range value
Here is the caller graph for this function:

◆ skewness()

double hgps::core::UnivariateSummary::skewness ( ) const
noexcept

Gets the skewness.

Returns
Skewness value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ std_deviation()

double hgps::core::UnivariateSummary::std_deviation ( ) const
noexcept

Gets the sample standard deviation.

Returns
Standard deviation value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ std_error()

double hgps::core::UnivariateSummary::std_error ( ) const
noexcept

Gets the standard error.

Returns
Standard error value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sum()

double hgps::core::UnivariateSummary::sum ( ) const
noexcept

Gets the sum value.

Returns
Sum value
Here is the caller graph for this function:

◆ to_string()

std::string hgps::core::UnivariateSummary::to_string ( ) const
noexcept

Convert this instance to a string representation.

Returns
The equivalent string representation
Here is the call graph for this function:

◆ variance()

double hgps::core::UnivariateSummary::variance ( ) const
noexcept

Gets the sample variance.

Returns
Variance value
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const UnivariateSummary summary 
)
friend

Output streams operator for UnivariateSummary type.

Parameters
streamThe stream to output
summaryThe UnivariateSummary instance
Returns
The output stream

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