QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
GenericGaussianStatistics< Stat > Class Template Reference

Statistics tool for gaussian-assumption risk measures. More...

#include <gaussianstatistics.hpp>

+ Inheritance diagram for GenericGaussianStatistics< Stat >:
+ Collaboration diagram for GenericGaussianStatistics< Stat >:

Public Types

typedef Stat::value_type value_type
 

Public Member Functions

 GenericGaussianStatistics ()=default
 
 GenericGaussianStatistics (const Stat &s)
 
Gaussian risk measures
Real gaussianDownsideVariance () const
 
Real gaussianDownsideDeviation () const
 
Real gaussianRegret (Real target) const
 
Real gaussianPercentile (Real percentile) const
 
Real gaussianTopPercentile (Real percentile) const
 
Real gaussianPotentialUpside (Real percentile) const
 gaussian-assumption Potential-Upside at a given percentile More...
 
Real gaussianValueAtRisk (Real percentile) const
 gaussian-assumption Value-At-Risk at a given percentile More...
 
Real gaussianExpectedShortfall (Real percentile) const
 gaussian-assumption Expected Shortfall at a given percentile More...
 
Real gaussianShortfall (Real target) const
 gaussian-assumption Shortfall (observations below target) More...
 
Real gaussianAverageShortfall (Real target) const
 gaussian-assumption Average Shortfall (averaged shortfallness) More...
 

Detailed Description

template<class Stat>
class QuantLib::GenericGaussianStatistics< Stat >

Statistics tool for gaussian-assumption risk measures.

This class wraps a somewhat generic statistic tool and adds a number of gaussian risk measures (e.g.: value-at-risk, expected shortfall, etc.) based on the mean and variance provided by the underlying statistic tool.

Definition at line 40 of file gaussianstatistics.hpp.

Member Typedef Documentation

◆ value_type

typedef Stat::value_type value_type

Definition at line 42 of file gaussianstatistics.hpp.

Constructor & Destructor Documentation

◆ GenericGaussianStatistics() [1/2]

◆ GenericGaussianStatistics() [2/2]

GenericGaussianStatistics ( const Stat s)
explicit

Definition at line 44 of file gaussianstatistics.hpp.

Member Function Documentation

◆ gaussianDownsideVariance()

Real gaussianDownsideVariance ( ) const

returns the downside variance, defined as

\[ \frac{N}{N-1} \times \frac{ \sum_{i=1}^{N} \theta \times x_i^{2}}{ \sum_{i=1}^{N} w_i} \]

, where \( \theta \) = 0 if x > 0 and \( \theta \) =1 if x <0

Definition at line 53 of file gaussianstatistics.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gaussianDownsideDeviation()

Real gaussianDownsideDeviation ( ) const

returns the downside deviation, defined as the square root of the downside variance.

Definition at line 60 of file gaussianstatistics.hpp.

+ Here is the call graph for this function:

◆ gaussianRegret()

Real gaussianRegret ( Real  target) const

returns the variance of observations below target

\[ \frac{\sum w_i (min(0, x_i-target))^2 }{\sum w_i}. \]

See Dembo, Freeman "The Rules Of Risk", Wiley (2001)

Definition at line 132 of file gaussianstatistics.hpp.

+ Here is the caller graph for this function:

◆ gaussianPercentile()

Real gaussianPercentile ( Real  percentile) const

gaussian-assumption y-th percentile, defined as the value x such that

\[ y = \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{x} \exp (-u^2/2) du \]

Precondition
percentile must be in range (0%-100%) extremes excluded

Definition at line 148 of file gaussianstatistics.hpp.

◆ gaussianTopPercentile()

Real gaussianTopPercentile ( Real  percentile) const
Precondition
percentile must be in range (0%-100%) extremes excluded

Definition at line 163 of file gaussianstatistics.hpp.

◆ gaussianPotentialUpside()

Real gaussianPotentialUpside ( Real  percentile) const

gaussian-assumption Potential-Upside at a given percentile

Precondition
percentile must be in range [90%-100%)

Definition at line 171 of file gaussianstatistics.hpp.

◆ gaussianValueAtRisk()

Real gaussianValueAtRisk ( Real  percentile) const

gaussian-assumption Value-At-Risk at a given percentile

Precondition
percentile must be in range [90%-100%)

Definition at line 185 of file gaussianstatistics.hpp.

◆ gaussianExpectedShortfall()

Real gaussianExpectedShortfall ( Real  percentile) const

gaussian-assumption Expected Shortfall at a given percentile

Assuming a gaussian distribution it returns the expected loss in case that the loss exceeded a VaR threshold,

\[ \mathrm{E}\left[ x \;|\; x < \mathrm{VaR}(p) \right], \]

that is the average of observations below the given percentile \( p \). Also know as conditional value-at-risk.

See Artzner, Delbaen, Eber and Heath, "Coherent measures of risk", Mathematical Finance 9 (1999)

Precondition
percentile must be in range [90%-100%)

Definition at line 201 of file gaussianstatistics.hpp.

◆ gaussianShortfall()

Real gaussianShortfall ( Real  target) const

gaussian-assumption Shortfall (observations below target)

Definition at line 220 of file gaussianstatistics.hpp.

◆ gaussianAverageShortfall()

Real gaussianAverageShortfall ( Real  target) const

gaussian-assumption Average Shortfall (averaged shortfallness)

Definition at line 229 of file gaussianstatistics.hpp.