Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

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

data

  • Returns Array<[Real, Real]>

downsideDeviation

  • downsideDeviation(): Real
  • Returns Real

downsideSamples

  • downsideSamples(): Size
  • Returns Size

downsideVariance

  • downsideVariance(): Real
  • Returns Real

downsideWeightSum

  • downsideWeightSum(): Real
  • Returns Real

errorEstimate

  • errorEstimate(): Real
  • Returns Real

expectationValue1

expectationValue2

gaussianAverageShortfall

  • gaussianAverageShortfall(target: Real): Real
  • gaussian-assumption Average Shortfall (averaged shortfallness)

    Parameters

    Returns Real

gaussianDownsideDeviation

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

    Returns Real

gaussianDownsideVariance

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

    Returns Real

gaussianExpectedShortfall

  • gaussianExpectedShortfall(percentile: Real): Real
  • 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)

    Parameters

    Returns Real

gaussianPercentile

  • gaussianPercentile(percentile: Real): Real
  • 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 $$

    Parameters

    Returns Real

gaussianPotentialUpside

  • gaussianPotentialUpside(percentile: Real): Real
  • gaussian-assumption Potential-Upside at a given percentile

    Parameters

    Returns Real

gaussianRegret

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

    Parameters

    Returns Real

gaussianShortfall

  • gaussian-assumption Shortfall (observations below target)

    Parameters

    Returns Real

gaussianTopPercentile

  • gaussianTopPercentile(percentile: Real): Real
  • Parameters

    Returns Real

gaussianValueAtRisk

  • gaussianValueAtRisk(percentile: Real): Real
  • gaussian-assumption Value-At-Risk at a given percentile

    Parameters

    Returns Real

kurtosis

  • Returns Real

max

  • Returns Real

mean

  • Returns Real

min

  • Returns Real

percentile

  • Parameters

    Returns Real

reserve

  • reserve(n: Size): void
  • Parameters

    Returns void

reset

  • reset(): void
  • Returns void

samples1

  • Returns Size

samples2

  • Parameters

    Returns Size

skewness

  • Returns Real

sort

  • sort(): void
  • Returns void

standardDeviation

  • standardDeviation(): Real
  • Returns Real

topPercentile

  • Parameters

    Returns Real

variance

  • Returns Real

weightSum1

  • weightSum1(): Real
  • Returns Real

weightSum2

  • Parameters

    Returns Real