#include <Statistics.h>
Public Member Functions | |
Statistics (unsigned int maxAcfOrder, bool useExactCalculation=true) | |
void | nextSample (double value) |
unsigned long | getNum () const |
double | getMean () const |
double | getVariance () const |
double | getAcf (unsigned int lag) const |
bool | isIidAcf () const |
bool | isIidTurningPoint () const |
bool | isIidDifferenceSign () const |
bool | isIid () const |
unsigned int | getMaModelOrder () const |
Static Public Member Functions | |
static void | testIncrementalAcf (unsigned int maxAcfOrder, double *values, unsigned int len, double accuracy) |
|
If useExactCalculation is true, the autocorrellation values will be exact. If set to false, an approximation is used, which should be good enough until lag at about 10, and the object will only use 2/3 of the memory on the heap (2*sizeof(double)*maxAcfOrder instead of 3*sizeof(double)*maxAcfOrder). Please be aware that even with useExactCalculation, the ACF will still be off a bit, but at least be exact to an accuracy of 10^-3 until lag 128. Setting maxAcfOrder to 0 will disable computation of the ACF and thus reduce the runtime complexity of nextSample significantly. |
|
The (sample) autocorrelation of all samples values at the given lag. This function thus represents the (sample) autocorrelation function (ACF). Please see "Introduction to Time Series and Forecasting", page 59 for details. |
|
Try to estimate the order q of an MA(q) model, under the proposition that the time series indeed can be expressed by an MA model. This method basically returns the highest lag for which the sample ACF value (computed with getAcf(lag) is greater than +-1.96/sqrt(getNum()). It is an implementation of the method described in "Introduction to Time Series and Forecasting", page 94.
|
|
The (sample) mean of all sample values. |
|
The number of samples. |
|
The (sample) variance of all sample values. |
|
Test the time series if it can be regarded as iid noise - independent and identically distributed random variables. This test combines all implemented specific tests.
|
|
Test the time series if it can be regarded as iid noise - independent and identically distributed random variables. This method uses the sample autocorrelation function (whose values are available with getAcf) and checks if all values are within the bounds +-1.96/sqrt(getNum()). This corresponds to a probability of 95% that the sequence is iid according to this test.
|
|
Test the time series if it can be regarded as iid noise - independent and identically distributed random variables. This method uses the difference sign test, described in "Introduction to Time Series and Forecasting", page 37f. If this test returns with false, it indicates the presence of an increasing (or decreasing) trend in the data.
|
|
Test the time series if it can be regarded as iid noise - independent and identically distributed random variables. This method uses the turning point test, described in "Introduction to Time Series and Forecasting", page 36f.
|
|
Update the internal helper variables with a new sample. |
|
This can be used for validating the computed ACF values. |