QuantLib
A free/open-source library for quantitative finance
Reference manual - version 1.20
Public Types | Public Member Functions | List of all members
GenericSequenceStatistics< StatisticsType > Class Template Reference

Statistics analysis of N-dimensional (sequence) data. More...

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

+ Inheritance diagram for GenericSequenceStatistics< StatisticsType >:

Public Types

typedef StatisticsType statistics_type
 
typedef std::vector< typename StatisticsType::value_type > value_type
 

Public Member Functions

 GenericSequenceStatistics (Size dimension=0)
 
inspectors
Size size () const
 
covariance and correlation
Disposable< Matrixcovariance () const
 returns the covariance Matrix
 
Disposable< Matrixcorrelation () const
 returns the correlation Matrix
 
1-D inspectors lifted from underlying statistics class
Size samples () const
 
Real weightSum () const
 
N-D inspectors lifted from underlying statistics class
std::vector< Realmean () const
 
std::vector< Realvariance () const
 
std::vector< RealstandardDeviation () const
 
std::vector< RealdownsideVariance () const
 
std::vector< RealdownsideDeviation () const
 
std::vector< RealsemiVariance () const
 
std::vector< RealsemiDeviation () const
 
std::vector< RealerrorEstimate () const
 
std::vector< Realskewness () const
 
std::vector< Realkurtosis () const
 
std::vector< Realmin () const
 
std::vector< Realmax () const
 
std::vector< RealgaussianPercentile (Real y) const
 
std::vector< Realpercentile (Real y) const
 
std::vector< RealgaussianPotentialUpside (Real percentile) const
 
std::vector< RealpotentialUpside (Real percentile) const
 
std::vector< RealgaussianValueAtRisk (Real percentile) const
 
std::vector< RealvalueAtRisk (Real percentile) const
 
std::vector< RealgaussianExpectedShortfall (Real percentile) const
 
std::vector< RealexpectedShortfall (Real percentile) const
 
std::vector< Realregret (Real target) const
 
std::vector< RealgaussianShortfall (Real target) const
 
std::vector< Realshortfall (Real target) const
 
std::vector< RealgaussianAverageShortfall (Real target) const
 
std::vector< RealaverageShortfall (Real target) const
 

Modifiers

Size dimension_
 
std::vector< statistics_type > stats_
 
std::vector< Realresults_
 
Matrix quadraticSum_
 
void reset (Size dimension=0)
 
template<class Sequence >
void add (const Sequence &sample, Real weight=1.0)
 
template<class Iterator >
void add (Iterator begin, Iterator end, Real weight=1.0)
 

Detailed Description

template<class StatisticsType>
class QuantLib::GenericSequenceStatistics< StatisticsType >

Statistics analysis of N-dimensional (sequence) data.

It provides 1-dimensional statistics as discrepancy plus N-dimensional (sequence) statistics (e.g. mean, variance, skewness, kurtosis, etc.) with one component for each dimension of the sample space.

For most of the statistics this class relies on the StatisticsType underlying class to provide 1-D methods that will be iterated for all the components of the N-D data. These lifted methods are the union of all the methods that might be requested to the 1-D underlying StatisticsType class, with the usual compile-time checks provided by the template approach.

Tests:
the correctness of the returned values is tested by checking them against numerical calculations.
Examples
MarketModels.cpp.