QuantLib_IncrementalStatistics

Langue: en

Autres versions - même langue

Version: 375310 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

QuantLib::IncrementalStatistics -

Statistics tool based on incremental accumulation.

SYNOPSIS


#include <ql/math/statistics/incrementalstatistics.hpp>

Public Types


typedef Real value_type

Public Member Functions

Inspectors

 


Size samples () const
number of samples collected
Real weightSum () const
sum of data weights
Real mean () const

Real variance () const

Real standardDeviation () const

Real errorEstimate () const

Real skewness () const

Real kurtosis () const

Real min () const

Real max () const

Real downsideVariance () const

Real downsideDeviation () const

Modifiers

 


void add (Real value, Real weight=1.0)
adds a datum to the set, possibly with a weight
template<class DataIterator > void addSequence (DataIterator begin, DataIterator end)
adds a sequence of data to the set, with default weight
template<class DataIterator , class WeightIterator > void addSequence (DataIterator begin, DataIterator end, WeightIterator wbegin)
adds a sequence of data to the set, each with its weight
void reset ()
resets the data to a null set

Protected Attributes


Size sampleNumber_

Size downsideSampleNumber_

Real sampleWeight_

Real downsideSampleWeight_

Real sum_

Real quadraticSum_

Real downsideQuadraticSum_

Real cubicSum_

Real fourthPowerSum_

Real min_

Real max_

Detailed Description

Statistics tool based on incremental accumulation.

It can accumulate a set of data and return statistics (e.g: mean, variance, skewness, kurtosis, error estimation, etc.)

Warning

high moments are numerically unstable for high average/standardDeviation ratios.

Member Function Documentation

Real mean () constreturns the mean, defined as [


ngle = ac{um w_i x_i}{um w_i}. ]

Real variance () constreturns the variance, defined as [ ac{N}{N-1}


. ]

Real standardDeviation () constreturns the standard deviation $ igma $, defined as the square root of the variance.

Real errorEstimate () constreturns the error estimate $ \psilon $, defined as the square root of the ratio of the variance to the number of samples.

Real skewness () constreturns the skewness, defined as [ ac{N^2}{(N-1)(N-2)} ac{


}{igma^3}. ] The above evaluates to 0 for a Gaussian distribution.

Real kurtosis () constreturns the excess kurtosis, defined as [ ac{N^2(N+1)}{(N-1)(N-2)(N-3)} ac{


}{igma^4} - ac{3(N-1)^2}{(N-2)(N-3)}. ] The above evaluates to 0 for a Gaussian distribution.

Real min () constreturns the minimum sample value

Real max () constreturns the maximum sample value

Real downsideVariance () constreturns the downside variance, defined as [ ac{N}{N-1} imes ac{ um_{i=1}^{N} heta imes x_i^{2}}{ um_{i=1}^{N} w_i} ], where $ heta $ = 0 if x > 0 and $ heta $ =1 if x <0

Real downsideDeviation () constreturns the downside deviation, defined as the square root of the downside variance.

void add (Real value, Real weight = 1.0)

adds a datum to the set, possibly with a weight Precondition:

weight must be positive or null

void addSequence (DataIterator begin, DataIterator end, WeightIterator wbegin)

adds a sequence of data to the set, each with its weight Precondition:

weights must be positive or null

Author

Generated automatically by Doxygen for QuantLib from the source code.


NAME
SYNOPSIS
Public Types
Public Member Functions
Protected Attributes
Detailed Description
Member Function Documentation
Real mean () constreturns the mean, defined as [

ngle = ac{um w_i x_i}{um w_i}. ]
Real variance () constreturns the variance, defined as [ ac{N}{N-1}

. ]
Real standardDeviation () constreturns the standard deviation $ igma $, defined as the square root of the variance.
Real errorEstimate () constreturns the error estimate $ \psilon $, defined as the square root of the ratio of the variance to the number of samples.
Real skewness () constreturns the skewness, defined as [ ac{N^2}{(N-1)(N-2)} ac{

}{igma^3}. ] The above evaluates to 0 for a Gaussian distribution.
Real kurtosis () constreturns the excess kurtosis, defined as [ ac{N^2(N+1)}{(N-1)(N-2)(N-3)} ac{