Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

todo

add historical annualized volatility

Hierarchy

Index

Constructors

constructor

Properties

S

S: any

Methods

add

  • Parameters

    • value: Real
    • Default value weight: Real = 1

    Returns void

addSequence

  • addSequence(value: Real[], weight?: Real[]): void
  • Parameters

    • value: Real[]
    • Default value weight: Real[] = []

    Returns void

averageShortfall

  • averaged shortfallness, defined as $$ \mathrm{E}\left[ t-x ;|; x<t \right] $$

    Parameters

    Returns Real

data

  • Returns Array<[Real, Real]>

downsideDeviation

  • downsideDeviation(): Real
  • returns the downside deviation, defined as the square root of the downside variance.

    Returns Real

downsideSamples

  • downsideSamples(): Size
  • Returns Size

downsideVariance

  • downsideVariance(): Real
  • returns the variance of observations below 0.0, $$ \frac{N}{N-1} \mathrm{E}\left[ x^2 ;|; x < 0\right]. $$

    Returns Real

downsideWeightSum

  • downsideWeightSum(): Real
  • Returns Real

errorEstimate

  • errorEstimate(): Real
  • Returns Real

expectationValue1

expectationValue2

expectedShortfall

  • expectedShortfall(centile: Real): Real
  • 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)

    Parameters

    Returns Real

gaussianAverageShortfall

  • gaussianAverageShortfall(target: Real): Real
  • Parameters

    Returns Real

gaussianDownsideDeviation

  • gaussianDownsideDeviation(): Real
  • Returns Real

gaussianDownsideVariance

  • gaussianDownsideVariance(): Real
  • Returns Real

gaussianExpectedShortfall

  • gaussianExpectedShortfall(percentile: Real): Real
  • Parameters

    Returns Real

gaussianPercentile

  • gaussianPercentile(percentile: Real): Real
  • Parameters

    Returns Real

gaussianPotentialUpside

  • gaussianPotentialUpside(percentile: Real): Real
  • Parameters

    Returns Real

gaussianRegret

  • Parameters

    Returns Real

gaussianShortfall

  • Parameters

    Returns Real

gaussianTopPercentile

  • gaussianTopPercentile(percentile: Real): Real
  • Parameters

    Returns Real

gaussianValueAtRisk

  • gaussianValueAtRisk(percentile: Real): Real
  • Parameters

    Returns Real

kurtosis

  • Returns Real

max

  • Returns Real

mean

  • Returns Real

min

  • Returns Real

percentile

  • Parameters

    Returns Real

potentialUpside

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

    Parameters

    Returns Real

regret

  • 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).

    Parameters

    Returns Real

reserve

  • reserve(n: Size): void
  • Parameters

    Returns void

reset

  • reset(): void
  • Returns void

samples1

  • Returns Size

samples2

  • Parameters

    Returns Size

semiDeviation

  • semiDeviation(): Real
  • returns the semi deviation, defined as the square root of the semi variance.

    Returns Real

semiVariance

  • semiVariance(): Real
  • 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).

    Returns Real

shortfall

  • 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. $$

    Parameters

    Returns Real

skewness

  • Returns Real

sort

  • sort(): void
  • Returns void

standardDeviation

  • standardDeviation(): Real
  • Returns Real

topPercentile

  • Parameters

    Returns Real

valueAtRisk

  • value-at-risk at a given percentile

    Parameters

    Returns Real

variance

  • Returns Real

weightSum1

  • weightSum1(): Real
  • Returns Real

weightSum2

  • Parameters

    Returns Real