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
GenericRiskStatistics< S > Class Template Reference

empirical-distribution risk measures More...

#include <riskstatistics.hpp>

+ Inheritance diagram for GenericRiskStatistics< S >:
+ Collaboration diagram for GenericRiskStatistics< S >:

Public Types

typedef S::value_type value_type
 

Public Member Functions

Real semiVariance () const
 
Real semiDeviation () const
 
Real downsideVariance () const
 
Real downsideDeviation () const
 
Real regret (Real target) const
 
Real potentialUpside (Real percentile) const
 potential upside (the reciprocal of VAR) at a given percentile More...
 
Real valueAtRisk (Real percentile) const
 value-at-risk at a given percentile More...
 
Real expectedShortfall (Real percentile) const
 expected shortfall at a given percentile More...
 
Real shortfall (Real target) const
 
Real averageShortfall (Real target) const
 

Detailed Description

template<class S>
class QuantLib::GenericRiskStatistics< S >

empirical-distribution risk measures

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

Examples
DiscreteHedging.cpp, and MarketModels.cpp.

Definition at line 41 of file riskstatistics.hpp.

Member Typedef Documentation

◆ value_type

typedef S::value_type value_type

Definition at line 43 of file riskstatistics.hpp.

Member Function Documentation

◆ semiVariance()

Real semiVariance

returns the variance of observations below the mean,

\[ \frac{N}{N-1} \mathrm{E}\left[ (x-\langle x \rangle)^2 \;|\; x < \langle x \rangle \right]. \]

See Markowitz (1959).

Definition at line 130 of file riskstatistics.hpp.

◆ semiDeviation()

Real semiDeviation

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

Definition at line 135 of file riskstatistics.hpp.

◆ downsideVariance()

Real downsideVariance

returns the variance of observations below 0.0,

\[ \frac{N}{N-1} \mathrm{E}\left[ x^2 \;|\; x < 0\right]. \]

Definition at line 140 of file riskstatistics.hpp.

◆ downsideDeviation()

Real downsideDeviation

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

Definition at line 145 of file riskstatistics.hpp.

◆ regret()

Real regret ( Real  target) const

returns the variance of observations below target,

\[ \frac{N}{N-1} \mathrm{E}\left[ (x-t)^2 \;|\; x < t \right]. \]

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

Definition at line 152 of file riskstatistics.hpp.

◆ potentialUpside()

Real potentialUpside ( Real  centile) const

potential upside (the reciprocal of VAR) at a given percentile

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

Definition at line 169 of file riskstatistics.hpp.

◆ valueAtRisk()

Real valueAtRisk ( Real  centile) const

value-at-risk at a given percentile

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

Definition at line 180 of file riskstatistics.hpp.

◆ expectedShortfall()

Real expectedShortfall ( Real  centile) const

expected shortfall at a given percentile

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 191 of file riskstatistics.hpp.

◆ shortfall()

Real shortfall ( Real  target) const

probability of missing the given target, defined as

\[ \mathrm{E}\left[ \Theta \;|\; (-\infty,\infty) \right] \]

where

\[ \Theta(x) = \left\{ \begin{array}{ll} 1 & x < t \\ 0 & x \geq t \end{array} \right. \]

Definition at line 208 of file riskstatistics.hpp.

◆ averageShortfall()

Real averageShortfall ( Real  target) const

averaged shortfallness, defined as

\[ \mathrm{E}\left[ t-x \;|\; x<t \right] \]

Definition at line 214 of file riskstatistics.hpp.