RISK MEASURES IN FINANCE REVISITED

Jan Hurt, Charles University of Prague, Czech Republic

http://www.wolfram.com/events/techconf2010/presentations/JanHurt.zip

1. Introduction

In [13] Hurt (2008) two risk measures (Value at Risk and Conditional Value at Risk) were studied. Also some theoretical aspects, particularly coherence properties were discussed there.

In this contribution we investigate the above measures again and also some competitive risk measures, particularly average value at risk, quantile value at risk, spectral risk measures, and expectiles. Some of them are transforms of the conditional value at risk. We consider a few distributions that are of interest both in theory and practical finance. Calculation of risk measures (some of them with a class of weighting functions) even for a small number of distributions would cause an enormous number of combinations so that we will concern ourselves only in some cases which might be of interest from methodological aspects.

In what follows, let X denote a loss variable (positive values of X indicate loss while negative values mean profit), F and (F^(-1)) its distribution and quantile function, respectively. We will consider only absolutely continuous distributions so that we denote f the probability density function (PDF) of X. Interest is in right-hand tails of the loss distribution with confidence levels 1-α so that we may restrict ourselves to (1/2)<α<1. Note that in literature we often find distributions of losses allowing positive values only. This does not sound too realistic because in such a case the probability of profit (that is X<0) is zero.

There is a variety of competing distributions. In this contribution we restrict to three distributions, normal, Laplace, and asymmetric Laplace. Some of the risk measures may be calculated from general formulas, some of them need some hand work, and some may be calculated only numerically. Some calculations are time consuming.

2. Definitions

Value at Risk at level 1-α (VaR)

Value at risk at level 1-α is simply the α-quantile of X, sometimes denoted by (Subscript[q, α]).

(Subscript[VaR, α])(X)=(F^(-1))(α)=inf{x:F(x)≥α}.

The usual interpretation is that loss will exceed (Subscript[VaR, α])(X) with a (small) probability 1-α with typical values of α=0.95, 0.99 or in some extreme cases even α=0.999. In practice the time horizons are one day or one week but often longer time horizons are of interest but they need a special care.

Conditional Value at Risk (CVaR)

Conditional value at risk (also called Expected Shortfall, Tail Conditional Expectation, Mean Excess Loss, Tail VaR) is the mean of the truncated distribution of X truncated at point (Subscript[VaR, α])(X) from the left:

(Subscript[CVaR, α])(X)=E{X|X≥(Subscript[VaR, α])(X)}.

Note that sometimes an analogue to the mean residual lifetime is considered:

(Subscript[CVaR, α])(X)-(Subscript[VaR, α])(X)=E{X-(Subscript[VaR, α])(X)|X≥(Subscript[VaR, α])(X)}.

For absolutely continuous distributions we have

(Subscript[CVaR, α])(X)=(1/(1-α))(∫_((Subscript[Var, α])(X))^∞)y f(y)dy.

Average Value at Risk at level 1-α (AVaR)

Average value at risk is defined as

(Subscript[AVaR, α])(X)=(1/(1-α))(∫_α^1)VaR(Subscript[,, p])(X)dp=(1/(1-α))(∫_α^1)(F^(-1))(p)dp.

After substitution y=(F^(-1))(p) we get

(Subscript[AVaR, α])(X)=(1/(1-α))(∫_((Subscript[VaR, α])(X))^∞)ydF(y)=(Subscript[CVaR, α])(X).

Hence both characteristics coincide but they differ in interpretation.

Weighted VaR (WVaR)

(Subscript[WAVaR, μ])(X)=(∫_0^1)AVaR(Subscript[,, λ])(X)μ(dλ),

where μ is a probability measure on [0,1].

Median Value at Risk (Median Shortfall, Tail Conditional Median)

Median value at risk is defined as the median of the conditional distribution given that the loss exceeded value at risk.

(Subscript[MVaR, α])(X)=Median{X|X≥(Subscript[VaR, α])(X)}.

Therefore, (Subscript[MVaR, α])(X) is a value satisfying

P(X≥ (Subscript[MVaR, α])(X)|X≥(Subscript[VaR, α])(X))=((P(X≥ (Subscript[MVaR, α])(X),X≥(Subscript[VaR, α])(X)))/(P(X≥(Subscript[VaR, α])(X))))=(1/2)

or

P(X≥ (Subscript[MVaR, α])(X),X≥(Subscript[VaR, α])(X))=(1/2)(1-α).

Since P(X≥(Subscript[VaR, α])(X))=1-α>(1/2)(1-α), (Subscript[MVaR, α])(X)>=(Subscript[VaR, α])(X), and therefore

P(X≥ (Subscript[MVaR, α])(X),X≥(Subscript[VaR, α])(X))=P(X≥ (Subscript[MVaR, α])(X))=(1/2)(1-α)

so that P(X<(Subscript[MVaR, α])(X))=((1+α)/2) and

(Subscript[MVaR, α])(X)=(Subscript[VaR, (1+α)/2])(X).

Sometimes median residual lifetime is considered:

(Subscript[MVaR, α])(X)-(Subscript[VaR, α])(X)=Median{X-(Subscript[VaR, α])(X)|X≥(Subscript[VaR, α])(X)}.

Quantile Value at Risk

Quantile Value at Risk (Quantile Shortfall, Tail Conditional Quantile) is defined as

(Subscript[QVaR, α,β])(X)=β-quantile of the conditional distribution{X|X≥(Subscript[VaR, α])(X)}.

It means that the probability of loss greater than QVaR given that it exceeded VaR will be 1-β.

Thus (Subscript[QVaR, α,β])(X) satisfies the relation

P(X≥ (Subscript[QVaR, α,β])(X)|X≥(Subscript[VaR, α])(X))=((P(X≥ (Subscript[QVaR, α,β])(X),X≥(Subscript[VaR, α])(X)))/(P(X≥(Subscript[VaR, α])(X))))=1-β,

and, since it has sense to consider (Subscript[QVaR, α])(X)≥(Subscript[VaR, α])(X) only, we have

P(X≥ (Subscript[QVaR, α,β])(X))=(1-β)(1-α),

so that (due to 1-(1-β)(1-α)=α+β-α β)

P(X< (Subscript[QVaR, α,β])(X))=α+β-α β.

It follows

(Subscript[QVaR, α,β])(X)=(F^(-1))(α+β-α β)=(α+β-α β)-quantile of X.

Spectral measures

Suppose that ϕ is a non-decreasing non-negative real function defined on [0,1], (∫_0^1)ϕ(p)dp=1, sometimes called spectrum. (ϕ is simply non-decreasing PDF with support [0,1].The quantity

(Subscript[M, ϕ])(X)=(∫_0^1)(F^(-1))(p)ϕ(p)dp

is called spectral risk measure. If F is absolutely continuous with the probability density function f and strictly increasing on its support then after substitution (F^(-1))(p)=y we obtain

(Subscript[M, ϕ])(X)=(∫_(-∞)^∞)y ϕ(F(y))f(y)dy.

In fact, ϕ is a weighting function giving higher weights to higher losses.

Expectiles

We start with motivation given in [22] Yao (1996) despite the idea originates in [18] Newey and Powell (1987). First we give an alternative approach for defining quantiles through an optimization problem. Define

(Subscript[R, α])(x)=(1-α)|x| ,   x≤0,
(Subscript[R, α])(x)=α|x| ,                 x>0.

The α-quantile (Subscript[q, α]) of X may be defined as

(Subscript[q, α])=arg (min_a) E,(Subscript[R, α])(X-a).

Obviously α=P(X≤(Subscript[q, α])). In order to have an analogy with expectiles, write

α=((E,I{X≤(Subscript[q, α])})/(E,1)),

where I means the indicator function.

To define expectiles, let us define

(Subscript[Q, ω])(x)=(1-ω)(x^2) ,   x≤0,
(Subscript[Q, ω])(x)=ω (x^2) ,                 x>0.

The ω-expectile of X is defined as the minimizer

(Subscript[τ, ω])=arg (min_a) E,(Subscript[Q, ω])(X-a),

see [22] Yao (1996), e.g. For ω=(1/2)  we have (Subscript[τ, 1/2])=E,X. Since (Subscript[Q, ω])(.) has a continuous first derivative, (Subscript[τ, ω]) satisfies the equation

E,(Subscript[L, ω])(X-(Subscript[τ, ω]))=0

where

(Subscript[L, ω])(x)=(1-ω)x ,   x≤0,
(Subscript[L, ω])(x)=ω x ,                 x>0.

Hence (Subscript[τ, ω]) satifies

ω=((E,[|X-(Subscript[τ, ω])|I{X≤(Subscript[τ, ω])}] )/(E|X-(Subscript[τ, ω])|)).

3. General Formulas for Calculations

Asymmetric Laplace distribution (ALD)

See [21] Trindade for an introduction and statistical inference to ALD. Also the standardized ALD is discussed there.

See also http://www.mathestate.com/tools/Financial/s07b/Laplace.html

Probability density function (definition)

The density of ALD is

f(x;θ,τ,κ)=((κ (Sqrt[2]))/(τ(1+(κ^2))))exp{-((κ(Sqrt[2]))/τ)(x-θ)},    x≥θ,
f(x;θ,τ,κ)=((κ (Sqrt[2]))/(τ(1+(κ^2))))exp{-((Sqrt[2])/(κ τ))(θ-x)},        x<θ,

where real θ is a location parameter, τ>0 is a scale parameter, and κ>0 is a shape parameter.

Definition of ALD in Mathematica

Clear[AsymmetricLaplaceDistribution];Unprotect[Mean, Variance, StandardDeviation, Skewness, Kurtosis,
         PDF, CDF, ExpectedValue, DistributionParameterQ,
         DistributionDomainQ,DistributionDomain,
         CharacteristicFunction,Quantile,RandomReal];
AsymmetricLaplaceDistribution/: PDF[AsymmetricLaplaceDistribution[θ_,τ_,κ_],x_]:=((κ(Sqrt[2]))/(τ(1+(κ^2))))Which[x≥θ,Exp[-((κ(Sqrt[2]))/τ)(x-θ)],
			   x<θ,Exp[-((Sqrt[2])/(κ τ))(θ-x)]]
AsymmetricLaplaceDistribution/: CDF[AsymmetricLaplaceDistribution[θ_,τ_,κ_],x_]:=Which[x≤θ,(((E^(((Sqrt[2]) (x-θ))/(κ τ))) (κ^2))/(1+(κ^2))),
						 x>θ,((1-(E^(((Sqrt[2]) (-x+θ) κ)/τ))+(κ^2))/(1+(κ^2)))];
AsymmetricLaplaceDistribution/: Mean[AsymmetricLaplaceDistribution[θ_,τ_,κ_]]:=θ-(((-1+(κ^2)) τ)/((Sqrt[2]) κ))
AsymmetricLaplaceDistribution/: 
Variance[AsymmetricLaplaceDistribution[θ_,τ_,κ_]]:=(((1+(κ^4)) (τ^2))/(2 (κ^2)))
AsymmetricLaplaceDistribution/: 
StandardDeviation[AsymmetricLaplaceDistribution[θ_,τ_,κ_]]:=Sqrt[(((1+(κ^4)) (τ^2))/(2 (κ^2)))]
AsymmetricLaplaceDistribution/: 
Skewness[AsymmetricLaplaceDistribution[θ_,τ_,κ_]]:=((2 (1-(κ^6)))/((((κ^4)+1))^(3/2)))
AsymmetricLaplaceDistribution/: 
Kurtosis[AsymmetricLaplaceDistribution[θ_,τ_,κ_]]:=((9+6 (κ^4)+9 (κ^8))/(((1+(κ^4)))^2))
AsymmetricLaplaceDistribution/: Quantile[AsymmetricLaplaceDistribution[θ_,τ_,κ_],q_]:=
	Which[0<q≤((κ^2)/(1+(κ^2))),θ+((κ τ Log[q (1+(1/(κ^2)))])/(Sqrt[2])),
		  ((κ^2)/(1+(κ^2)))<q<1,θ-((τ Log[-(-1+q) (1+(κ^2))])/((Sqrt[2]) κ))]
AsymmetricLaplaceDistribution/: RandomReal[AsymmetricLaplaceDistribution[θ_,τ_,κ_]]:=Quantile[AsymmetricLaplaceDistribution[θ,τ,κ],Random[]]
Protect[Mean, Variance, StandardDeviation, Skewness, Kurtosis,
         PDF, CDF, ExpectedValue, DistributionParameterQ,
         DistributionDomainQ,DistributionDomain,
         CharacteristicFunction,Quantile,RandomReal];

Illustrations

Plot[(Quantile[AsymmetricLaplaceDistribution[θ,τ,κ],q]/.{θ->0,τ->4,κ->1/2}),{q,0.01,0.99},AxesLabel->{"α","Quantile"}]

Due to the three parameters the distribution is apparently flexible. Nevertheless its kurtosis is always high (≥6), which might be unsatisfactory in some practical situations.

Print["Minimal kurtosis is ", FindMinimum[Kurtosis[AsymmetricLaplaceDistribution[θ,τ,κ]],{κ,2}]//First//Round, " and is achieved for κ = ",κ/.(FindMinimum[Kurtosis[AsymmetricLaplaceDistribution[θ,τ,κ]],{κ,2}]//Last)//Round,"."]

Plot[{Skewness[AsymmetricLaplaceDistribution[θ,τ,κ]],Kurtosis[AsymmetricLaplaceDistribution[θ,τ,κ]]},{κ,0,3},AxesLabel->{"κ"," "}]

Probability density function (illustration)

Manipulate [Plot[PDF[AsymmetricLaplaceDistribution[θ,τ,κ],y]//Evaluate,{y,-6,6},PlotPoints->70,PlotRange->All],{{θ,0},-5,5},{{τ,4},0.1,5},{{κ,1/2},0.1,10},SaveDefinitions->True]

Study specific parameters for ALD and simulation

In specific numerical illustrations we will consider the distributions with the same mean and standard deviation for comparisons. We have chosen AsymmetricLaplaceDistribution[0, 4, 1/2] as a standard (sometimes called reference distribution in the sequel). The corresponding moments are:

Text@Grid[{{"Mean ",Mean[AsymmetricLaplaceDistribution[0.,4,0.5]]},{"SD  ",StandardDeviation[AsymmetricLaplaceDistribution[0.,4,0.5]]},{"Skewness     ",Skewness[AsymmetricLaplaceDistribution[0.,4,0.5]]},{"Kurtosis",Kurtosis[AsymmetricLaplaceDistribution[0.,4,0.5]]}},Frame->All,Alignment->Left]

Simulation

t1=Table[RandomReal[AsymmetricLaplaceDistribution[0.,4,0.5]],{10000}];
Text@Grid[{{"Mean ",Mean[t1]},{"SD  ",StandardDeviation[t1]},{"Skewness     ",Skewness[t1]},{"Kurtosis",Kurtosis[t1]}},Frame->All,Alignment->Left]
Histogram[t1]

VaR

Information about admissible values of the parameters can be transferred through the option assuming.

Clear[VaR];
VaR[distribution_,α_,assuming___]:=Assuming[{assuming},Quantile[distribution,α]//Simplify]

CVar

Clear[CVaR];
CVaR[distribution_,α_,assuming___]:=(1/(1-α))Assuming[{assuming},(∫_(VaR[distribution,α])^∞)y PDF[distribution,y]\[DifferentialD]y]//PowerExpand//Simplify

Clear[NCVaR];
NCVaR[distribution_,α_]:=(1/(1-α))NIntegrate[y PDF[distribution,y],{y,VaR[distribution,α],∞}]

Average Value at Risk

Clear[AVaR];
AVaR[distribution_,α_,assuming___]:=(1/(1-α))Assuming[{assuming},(∫_α^1)VaR[distribution,p]\[DifferentialD]p]//PowerExpand//Simplify
Clear[NAVaR];
NAVaR[distribution_,α_]:=(1/(1-α))NIntegrate[VaR[distribution,p],{p,α,1}]

Median Value at Risk (Median Shortfall, Tail Conditional Median)

Clear[MVaR];
MVaR[distribution_,α_,assuming___]:=Assuming[{assuming},Quantile[distribution,(1+α)/2]//PowerExpand//Simplify]

Spectral measures

First we start with the definitions of some spectra:

Dual-power risk aversion function

ϕdual[u_,ν_]:=ν (u^(ν-1)) (* ν≥1 *)

Proportional Hazard risk aversion function

ϕhazard[u_,γ_]:=(1/γ)(((1-u))^(1/γ-1)) (* γ≥1 *)

Wang's risk aversion function

ϕWang[u_,δ_]:=Exp[-δ Quantile[NormalDistribution[0,1],u]-(δ^2)/2] (* δ>0 *)

Exponential risk aversion function

ϕArrowPratt[u_,k_]:=((k Exp[-k(1-u)])/(1-Exp[-k]))

where k is the Arrow-Pratt degree of absolute risk aversion (ARA, see also Wolfram Demonstration by [3] Chandler):

-((D[ϕArrowPratt[u,k],{u,2}])/(D[ϕArrowPratt[u,k],u]))

Spectral measure symbolic

Clear[SpectralRisk];
SpectralRisk[distribution_,ϕ_,assuming___]:=Assuming[{assuming},(∫_(-∞)^∞)y ϕ[CDF[distribution,y]]PDF[distribution,y]\[DifferentialD]y]

Spectral measure numeric

Clear[NSpectralRisk];
NSpectralRisk[distribution_,ϕ_]:=NIntegrate[y ϕ[CDF[distribution,y]]PDF[distribution,y],{y,-∞,∞}]

Expectiles

Since this characteristic is not widely used we go more in details. We present two methods for calculating expectiles. First method is based on direct minimization of (1). It works reliably but it is very slow in some cases.

Clear[Expectile];
Expectile[distribution_,ω_]:=a/.NMinimize[(1-ω)(∫_(-∞)^a)(((x-a))^2)PDF[distribution,x]\[DifferentialD]x+ω(∫_a^∞)(((x-a))^2)PDF[distribution,x]\[DifferentialD]x,a][[2]]

Basic illustrations N(17/4,4):

Text@Grid[Prepend[{{0.75,Expectile[NormalDistribution[17/4,4],0.75]//Timing}//Flatten,{0.75,Expectile[NormalDistribution[17/4,4.],0.75]//Timing}//Flatten,{0.95,Expectile[NormalDistribution[17/4,4.],0.95]//Timing}//Flatten},{"ω","Time","Expectile"}],Frame->All]

The second method is based on formula (2), the first order condition. We take the first derivative of E,(Subscript[Q, ω])(x-a) and equate it to zero. For that, we use FindRoot with the 0.5 and 1.5 multiples of the mean of the distribution as starting points.

(* The derivative *)
D[(1-ω)(∫_(-∞)^a)(((x-a))^2)PDF[distribution,x]\[DifferentialD]x+ω(∫_a^∞)(((x-a))^2)PDF[distribution,x]\[DifferentialD]x,a]//Simplify

Clear[Expectile2];
Expectile2[distribution_,ω_]:=a/.FindRoot[ω (∫_a^∞)2 (a-x) PDF[distribution,x]\[DifferentialD]x-(-1+ω) (∫_(-∞)^a)2 (a-x) PDF[distribution,x]\[DifferentialD]x,{a,0.5 Mean[distribution],1.5Mean[distribution]},MaxIterations->200]

Comparison of timings of the Expectile and Expectile2

We start with Asymmetric Laplace Distribution:

Expectile[AsymmetricLaplaceDistribution[0.,4.,0.5],0.75]//Timing

Procedure based on NMinimize takes enormously long time. Expectile2 procedure is substantially less time consuming for both rational and real input parameters.

Text@"ω = 0.75"
Text@Grid[Prepend[{Expectile2[AsymmetricLaplaceDistribution[0,4,1/2],0.75]//Timing,Expectile2[AsymmetricLaplaceDistribution[0.,4.,0.5],0.75]//Timing},{"Time","Expectile2"}],Frame->All]

Comparison of NMinimize (procedure Expectile) and FindRoot (procedure Expectile2) for N(4.24264,5.83095) and FindRoot (procedure Expectile2) for (ALD(0,4,1/2):

Off[Power::"infy"];Off[∞::"indet"];Off[FindRoot::"nlnum"];Text@Grid[Prepend[timecomparisontable=Table[{ω,Expectile[NormalDistribution[3. (Sqrt[2]),(Sqrt[34.])],ω]//Timing,Expectile2[NormalDistribution[3. (Sqrt[2]),(Sqrt[34.])],ω]//Timing,Expectile2[AsymmetricLaplaceDistribution[0.,4.,0.5],ω]//Timing}//Flatten,{ω,omegas={0.5,0.6,0.7,0.75,0.8,0.85,0.9,0.95,0.99}}],{"ω","Timing","Expectile\n Normal","Timing","Expectile2\n  Normal","Timing","Expectile2\n    ALD"}],Frame->All]

We see that for the normal distribution, the times for both procedures are almost the same independently of ω. In case of asymmetric Laplace distribution and Expectile2 procedure we observe that with increasing ω the timing increases with increasing ω. Above example shows that procedure Expectile (direct minimization) is extremely time consuming for the latter distribution.

4. Distribution Specific Calculations

Normal distribution

VaR

VaRNormal[α_,μ_,σ_]=VaR[NormalDistribution[μ,σ],α]

CVaR

CVaRNormal[α_,μ_,σ_]=CVaR[NormalDistribution[μ,σ],α,Re[(σ^2)]>0]

AVaR

AVaRNormal[α_,μ_,σ_]=AVaR[NormalDistribution[μ,σ],α]//PowerExpand//Simplify

Spectral measure

Recall that throughout the paper if we speak on  specific distributions, we consider distributions with mean and standard deviation equal to

{3 (Sqrt[2]),(Sqrt[34])}//N

We start with the spectral risk for a normal distribution.

Manipulate[Plot[NSpectralRisk[NormalDistribution[3. (Sqrt[2]),σ],ϕdual[#,ν]&],{ν,1,10},AxesOrigin->{0,0},PlotRange->{0,20},AxesLabel->{"ν","Spectral risk"}],{{σ,5.83},4,10},SaveDefinitions->True]

Manipulate[Plot[NSpectralRisk[NormalDistribution[3. (Sqrt[2]),σ],ϕArrowPratt[#,k]&],{k,0.1,10},AxesOrigin->{0,0},PlotRange->{0,20},AxesLabel->{k,"σ"}],{{σ,5.83},4,10},SaveDefinitions->True]

The reader will simply discover that such plots are rather boring. More interesting and more important are the ratios of the risk measures.

Expectiles of the normal distribution

Text@Grid[Prepend[tableExpectile2Normal=Table[{ω,Expectile2[NormalDistribution[3. (Sqrt[2]),5.83],ω]},{ω,0.85,0.99,0.01}],{"ω","Expectile2"}],Frame->All]

ListPlot[tableExpectile2Normal,Joined->True,AxesOrigin->{0.85,8},AxesLabel->{"ω","Expectile"}]

Laplace distribution

VaR

VaRLaplace[α_,μ_,β_]=VaR[LaplaceDistribution[μ,β],α,β>0&&(1/2)<α<1]

CVaR

CVaRLaplace[α_,μ_,β_]=CVaR[LaplaceDistribution[μ,β],α,β>0&&(1/2<α<1)]

For (1/2)<α<1 we have 2-2α<1 so that μ-β Log[2-2α]>μ and thus

CVaRLaplace[α_,μ_,β_]=Assuming[β>0,(((∫_(μ-β Log[2-2 α])^∞)(((E^(-((y-μ)/β))) y)/(2 β))\[DifferentialD]y)/(1-α))]//FullSimplify

Observe that direct calculation of the AVaR (which coincides with CVaR) is straightforward and does need any manual adjustment.

AVaR

AVaRLaplace[α_,μ_,β_]=AVaR[LaplaceDistribution[μ,β],α,β>0&&(1/2<α<1)]

Spectral measure

We choose the parameters to have the same mean and standard deviation as in the normal case. We have

{Mean[LaplaceDistribution[μ,β]],StandardDeviation[LaplaceDistribution[μ,β]]}

{μ,(Sqrt[2]) β}

so that a solution to these equations returns the equivalent parameters.

Solve[{μ==3. (Sqrt[2]),(Sqrt[2]) β==5.83},{μ,β}]

For ϕdual the computation mostly takes longer time than for ϕArrowPratt, e.g. However, the absolute exponential risk aversion is, fortunately, most popular in practice. Thus it would be convenient to give some examples with the Arrow-Pratt spectrum only.

Nevertheless, we start with ϕdual:

Text@Grid[Prepend[Table[{ν,NSpectralRisk[LaplaceDistribution[4.24264,4.12243],ϕdual[#,ν]&]},{ν,1,10}],{"ν","Spectral Risk   "}]//Transpose,Frame->True]

And now for the absolute exponential risk aversion.

Manipulate[Plot[NSpectralRisk[LaplaceDistribution[4.24264,β],ϕArrowPratt[#,k]&],{k,0.1,10},AxesOrigin->{0,0},PlotRange->{0,20}],{{β,4.12243},1,10},SaveDefinitions->True]

Expectiles

Expectile2[LaplaceDistribution[4.24264,4.12243],0.75]//Timing

On an  old HP notebook the following calculation appeared to be too ambitious.

tableExpectile2Laplace=Table[{ω,Expectile2[LaplaceDistribution[4.24264,4.12243],ω]},{ω,0.85,0.99,0.01}]

Aborted after 5349 seconds.

Asymmetric Laplace distribution (ALD)

VaR

VaRALD[α_,θ_,τ_,κ_]=VaR[AsymmetricLaplaceDistribution[θ,τ,κ],α]

Manipulate[Plot[VaRALD[α,θ,τ,κ],{α,1/2,1},AxesOrigin->{1/2,0},PlotRange->{0,20},AxesLabel->{"α","VaR"}],{{θ,0},-3,3},{{τ,4},1/2,10},{{κ,1/2},0.1,4},SaveDefinitions->True]

CVaR

See Section Calculations for explanation.

CVaRALD[α_,θ_,τ_,κ_]=Which[0<α≤((κ^2)/(1+(κ^2))),(1/(1-α))(1/2) (1+(κ^2)) τ (-2 (-1+α) θ+(((Sqrt[2]) τ (1+(κ^2) (-1+α-α (Log[α]+Log[1+(1/(κ^2))]))))/κ)),
((κ^2)/(1+(κ^2)))<α<1,-(1/(1-α))(((-1+α) (1+(κ^2)) τ ((Sqrt[2]) θ κ+τ-τ Log[-(-1+α) (1+(κ^2))]))/((Sqrt[2]) κ))];

Manipulate[Plot[CVaRALD[α,θ,τ,κ],{α,1/2,1},AxesOrigin->{1/2,0},AxesLabel->{"α","CVaR"}],{{θ,0},-3,3},{{τ,4},1/2,10},{{κ,1/2},0.1,4},SaveDefinitions->True]

AVaR

See Section Calculations for details.

AVaRALD[α_,θ_,τ_,κ_]=Which[0<α≤((κ^2)/(1+(κ^2))),-((2 θ κ-2 α θ κ+(Sqrt[2]) τ-(Sqrt[2]) (κ^2) τ+(Sqrt[2]) α (κ^2) τ-(Sqrt[2]) α (κ^2) τ (Log[α]+Log[1+(1/(κ^2))]))/(2 (-1+α) κ)),
((κ^2)/(1+(κ^2)))<α<1,((2 θ κ+(Sqrt[2]) τ-(Sqrt[2]) τ Log[1-α]-(Sqrt[2]) τ Log[1+(κ^2)])/(2 κ))];

Plot[AVaRALD[α,0,4,1/2],{α,0,1},AxesLabel->{"α","AVaR"}]

Spectral measure

NSpectralRisk[AsymmetricLaplaceDistribution[0,4,1/2],ϕdual[#,1]&]//Timing

Table[NSpectralRisk[AsymmetricLaplaceDistribution[0,4,1/2],ϕArrowPratt[#,k]&],{k,0.1,10}]

Manipulate[Plot[NSpectralRisk[AsymmetricLaplaceDistribution[θ,τ,κ],ϕArrowPratt[#,k]&],{k,0.1,10},AxesOrigin->{0,0},AxesLabel->{"k","Spectral risk"}],{{θ,0},-3,3},{{τ,4},1/2,10},{{κ,1/2},0.1,4},SaveDefinitions->True]

Expectiles

First illustration:

Expectile2[AsymmetricLaplaceDistribution[0,4,1/2],0.75]//Timing

(tableExpectile2ALD=Table[{ω,Expectile2[AsymmetricLaplaceDistribution[0.,4.,1./2],ω]}//Flatten,{ω,0.85,0.99,0.01}])

Text@Grid[Prepend[{{0.87`,9.257299332722239`},{0.88`,9.54517970636458`},{0.89`,9.859036271596631`},{0.9`,10.204110341986302`},{0.91`,10.587353105732982`},{0.9199999999999999`,11.018251652751681`},{0.9299999999999999`,11.51021881284805`},{0.94`,12.08307975792722`},{0.95`,12.767884865996166`},{0.96`,13.617254460402796`},{0.97`,14.731159451739403`},{0.98`,16.337714446735852`},{0.99`,19.181023514893155`}},{"ω","Expectile2"}],Frame->True
]

The plot of the expectiles for the reference distribution

ListPlot[tableExpectile2ALD,AxesLabel->{"ω","Expectiles"},AxesOrigin->{0.85,8},Joined->True]

5. Estimation

Nonparametric estimation

VaR

Clear[VaRsample];
VaRsample[sample_,α_]:=Quantile[sample,α]

CVar

Clear[CVaRsample];
CVaR[sample_,α_]:=(1/(1-α))Mean[Select[sample,(#>CVaRsample[sample,α])&]]

Average Value at Risk

Clear[AVaRsample];
AVaRsample[sample_,α_]:=CVaRsample[sample,α]

Median Value at Risk (Median Shortfall, Tail Conditional Median)

Clear[MVaRsample];
MVaRsample[sample_,α_]:=Quantile[sample,(1+α)/2]

Spectral measures

Procedures

(Subscript[M, ϕ])(X)=(∫_0^1)(F^(-1))(p)ϕ(p)dp

Clear[SpectralRisksample,empiricalCDF];
empiricalCDF[sample_,x_]:=Mean[Map[Boole[#≤x]&,sample]]//N
SpectralRisksample[sample_,ϕ_,assuming___]:=Module[{points,inverseCDF},
points={Map[empiricalCDF[sample,#]&,sample],sample}//Transpose;
inverseCDF=Interpolation[points];
Assuming[{assuming},NIntegrate[inverseCDF[p] ϕ[p],{p,0,1}]]]

Simulation of ADL: number of the samples m, size of every sample n

SeedRandom[10132010];samplesADL[m_,n_]:=Table[Table[RandomReal[AsymmetricLaplaceDistribution[0.,4.,1./2]],{n}]//Sort,{m}]
samplesADL2100=samplesADL[2,100];
cdfplot=Map[Plot[empiricalCDF[#,x],{x,Min[#],Max[#]}]&,samplesADL2100]

Recall that

Mean[AsymmetricLaplaceDistribution[0.,4.,1./2]]

If we put ϕ to identity, the spectral risk should return the mean value. We test it on

ϕidentity[x_]:=1
Off[InterpolatingFunction::dmvali]
spectralrisksMean=Map[SpectralRisksample[#,ϕidentity]&,samplesADL[100,100]]//Sort
{Mean[spectralrisksMean],StandardDeviation[spectralrisksMean]}
Histogram[spectralrisksMean]

We see that the results are not good. It is caused by the behaviour of the quantile function in the vicinity of points 0 and 1. Here we also illustrate the construction of the quantile function

sam=samplesADL[1,1000]//First;
points={Map[empiricalCDF[sam,#]&,sam],sam}//Transpose;
inverseCDF=Interpolation[points];
Plot[inverseCDF[α],{α,1.5/Length[points],1-1.5/Length[points]},AxesLabel->{"α","Quantile"}]
{Mean[sam],Integrate[inverseCDF[x],{x,0,1}]}

Exponential risk aversion function

Off[InterpolatingFunction::dmvali]
spectralrisksMean=Map[Function[sample,SpectralRisksample[sample,ϕArrowPratt[#,1]&]],samplesADL[100,100]]//Sort
{Mean[spectralrisksMean],StandardDeviation[spectralrisksMean]}
Histogram[spectralrisksMean]

Expectiles

We will calculate (Subscript[Q, ω]) at discrete sample points and simply find the minimum. The following procedure returns the pair {(Subscript[τ, ω]),E,(Subscript[Q, ω])(X-(Subscript[τ, ω]))}. (The last expected value means the sample analogue.)

Clear[Expectilesample];
Expectilesample[sample_,ω_]:=Module[{sortsample=Sort[sample],Qω,a,valuesofQatsamplepoints},
Qω[a_]:=(1-ω)Mean[(((Select[sortsample,#≤a&]-a))^2)]+ω If[Max[sortsample]≤a,0, Mean[(((Select[sortsample,#>a&]-a))^2)]];
valuesofQatsamplepoints=Transpose[{sortsample,Map[Qω[#]&,sortsample]}];
Sort[valuesofQatsamplepoints,#1[[2]]<#2[[2]]&]//First
	    ]

Here is 0.5-expectile of a sample from the uniform distribution:

SeedRandom[113];
Expectilesample[RandomReal[UniformDistribution[{0,1}],1000],0.5]

And 0.5 and 0.95- expectiles from the normal distribution:

SeedRandom[113];
{Expectilesample[rs1000=RandomReal[NormalDistribution[4.24,5.83],1000],0.5],Expectilesample[rs1000,0.95]}

Look at the corresponding function (Subscript[Q, ω]) for ω=0.5, 0.95.

rs1000sort=Sort[rs1000];
Show[ListPlot[{rs1000sort,Map[Function[a,0.5Mean[(((Select[rs1000sort,#≤a&]-a))^2)]+0.5If[Max[rs1000sort]≤a,0, Mean[(((Select[rs1000sort,#>a&]-a))^2)]]],rs1000sort]}//Transpose,AxesLabel->{"sample points","(Subscript[Q, ω])"}],ListPlot[{rs1000sort,Map[Function[a,0.05Mean[(((Select[rs1000sort,#≤a&]-a))^2)]+0.95If[Max[rs1000sort]≤a,0, Mean[(((Select[rs1000sort,#>a&]-a))^2)]]],rs1000sort]}//Transpose]]

SeedRandom[113];tableExpectilesampleNormal=Table[{ω,Expectilesample[RandomReal[NormalDistribution[3. (Sqrt[2]),5.83],1000],ω]//First},{ω,0.85,0.99,0.01}]

Compare with previously calculated theoretical values. It is obvious that the estimates overestimate even in case of relatively large sample.

tableExpectileNormal={{0.85`,8.233},{0.86`,8.414},{0.87`,8.606},{0.88`,8.811},{0.89`,9.029},{0.9`,9.265},{0.91`,9.522},{0.92,9.804},{0.93,10.119},{0.94`,10.476},{0.95`,10.889},{0.96`,11.385},{0.97`,12.008},{0.98`,12.860},{0.99`,14.255}};

ListPlot[{tableExpectilesampleNormal,tableExpectileNormal},PlotStyle->PointSize[0.02],AxesOrigin->{0.85,0}]

Parametric estimation

The general principle lies in that we just plug in proper estimates (preferably based on maximum likelihood principle) into general formulas. The author intends to perform a detailed study of this phenomena in a near future.

6. Calculations

This Section contains technical calculations which do not fall within the general framework of this paper.

Asymmetric Laplace distribution

CDF

{Integrate[PDF[AsymmetricLaplaceDistribution[θ,τ,κ],y],{y,-∞,x},Assumptions->τ>0&&κ>0&&θ∈Reals&&x<θ],Limit[(((E^(((Sqrt[2]) (x-θ))/(κ τ))) (κ^2))/(1+(κ^2))),x->θ],Integrate[ PDF[AsymmetricLaplaceDistribution[θ,τ,κ],y],{y,-∞,x},Assumptions->τ>0&&κ>0&&θ∈Reals&&x>θ]}

Mean

m1AL=Integrate[y PDF[AsymmetricLaplaceDistribution[θ,τ,κ],y],{y,-∞,∞},Assumptions->τ>0&&κ>0&&θ∈Reals]//Simplify

Variance

v2AL=Integrate[(y^2) PDF[AsymmetricLaplaceDistribution[θ,τ,κ],y],{y,-∞,∞},Assumptions->τ>0&&κ>0&&θ∈Reals]-(m1AL^2)//Simplify

Skewness and Kurtosis

m3AL=Integrate[Expand[(((y-m1))^3)] PDF[AsymmetricLaplaceDistribution[θ,τ,κ],y],{y,-∞,∞},Assumptions->τ>0&&κ>0&&θ∈Reals]//Simplify

m4AL=Integrate[Expand[(((y-m1))^4)] PDF[AsymmetricLaplaceDistribution[θ,τ,κ],y],{y,-∞,∞},Assumptions->τ>0&&κ>0&&θ∈Reals]//Simplify

skAL=(m3AL/(v2AL^(3/2)))//PowerExpand//Simplify

kuAL=(m4AL/(v2AL^2))//PowerExpand//Simplify

Clear[m1AL,v2AL,m3AL,m4AL,skAL,kuAL];

Quantiles

Case x≤θ

Solve[(((E^(((Sqrt[2]) (x-θ))/(κ τ))) (κ^2))/(1+(κ^2)))==q,x]//Simplify

Reduce[θ+((κ τ Log[q (1+(1/(κ^2)))])/(Sqrt[2]))≤θ&&τ>0&&κ>0,q,Reals]

Case x>θ

Solve[((1-(E^(((Sqrt[2]) (-x+θ) κ)/τ))+(κ^2))/(1+(κ^2)))==q,x]//FullSimplify

Reduce[θ-((τ Log[-(-1+q) (1+(κ^2))])/((Sqrt[2]) κ))>θ&&τ>0&&κ>0,q,Reals]

CVaR

Since for 0<α≤((κ^2)/(1+(κ^2))) we have α (1+(1/(κ^2)))<1 and thus θ+((κ τ Log[α (1+(1/(κ^2)))])/(Sqrt[2]))<θ.

Integrate[y(Sqrt[2]) κ Exp[-(((Sqrt[2]) (θ-y))/(κ τ))],{y,θ+((κ τ Log[α (1+(1/(κ^2)))])/(Sqrt[2])),θ}]+Assuming[{τ>0&&κ>0},Integrate[y(Sqrt[2]) κ Exp[-(((κ (Sqrt[2])) (y-θ))/τ)],{y,θ,∞}]]//FullSimplify//PowerExpand

For ((κ^2)/(1+(κ^2)))<α<1 we have (1-α)(1+(κ^2))<1 and thus θ-((τ Log[-(-1+α) (1+(κ^2))])/((Sqrt[2]) κ))>θ.

Assuming[{τ>0&&κ>0},Integrate[y(Sqrt[2]) κ Exp[-(((κ (Sqrt[2])) (y-θ))/τ)],{y,θ-((τ Log[-(-1+α) (1+(κ^2))])/((Sqrt[2]) κ)),∞}]]

-(((-1+α) (1+(κ^2)) τ ((Sqrt[2]) θ κ+τ-τ Log[-(-1+α) (1+(κ^2))]))/((Sqrt[2]) κ))

AVaR

AVaRALD[α_,θ_,τ_,κ_]=AVaR[AsymmetricLaplaceDistribution[θ,τ,κ],α,τ>0&&κ>0&&(1/2)<α<1]//Simplify

7. Acknowledgments

The research has been supported by Grant of Czech Ministry of Education MSM 0021620839, Methods of modern mathematics and their applications.

8. References

[1] Benninga, S., Wiener, Z. (1998): Value-at-Risk (VaR). Mathematica in Education and Research, Vol. 7, No. 4.

[2] Chandler, S. J. (2008): Tail Conditional Expectations. The Wolfram Demonstration Project. http://demonstrations.wolfram.com/TailConditionalExpectations/

[3] Chandler, S. J. (200?): Constant Risk Aversion Utility Functions.The Wolfram Demonstrations Project. http://demonstrations.wolfram.com/ConstantRiskAversionUtilityFunctions/

[4] Chandler, S. J. (200?): Individual Insurance Decisions under HR 3560 and HR 3962. The Wolfram Demonstrations Project.
http://demonstrations.wolfram.com/IndividualInsuranceDecisionsUnderHR3560AndHR3962/

[5] Cheng, G., Ping, L., Shi, P. (2007): A new algorithm based on copulas for VaR valuation with empirical calculations. Theoretical Computer Science, Vol. 378, pp. 190-197.

[6] Dowd, K., Cairns, A. J. G., Blake, D. (2006): Mortality-dependent financial risk measures. Insurance: Mathematics and Economics, Vol. 38, pp. 427-440.

[7] Dupacova, J., Hurt, J., Stepan, J. (2002): Stochastic Modeling in Economics and Finance. Kluwer, Dordrecht.

[8] Dupacova, J., Polivka, J. (2007): Stress testing for VaR and CVar. Quantitative Finance, Vol. 7, No. 4, pp. 411-421.

[9] Eling, M., Tibiletti, L. (2010) Internal vs. external risk measures: How capital requirements differ in practice. Opererations Research Letters. doi: 10.1016/j.orl.2010.05.003

[10] Franke, J., Haerdle, W., Hafner, Ch. M. (2004): Statistics of Financial Markets. Springer, Berlin.

[11] Gzyl, H., Mayoral, S. (2008): Determination of risk pricing measures from market prices of risk. Insurance: Mathematics and Economics, Vol. 43, pp. 437-443.

[12] Hamrick, J. (2008): Bootstrapping to Compute Value-at-Risk Standard Errors. The Wolfram Demonstration Project.

[13] Hurt, J. (2008): Risk Measures in Finance. http://library.wolfram.com/infocenter/Conferences/7230/

[14] Inui, K., Kijima, M. (2005): On the significance of expected shortfall as a coherent risk measure. J. of Banking and Finance, Vol. 29, pp. 853-864.

[15] Kuan, Chung-Ming, Yeh, Jin-Huei, Hsu, Yu-Chin (2009): Assesing value at risk with CARE, the Conditional Autoregressive Expectile models. Journal of Econometrics, Vol. 150, pp. 261-270.

[16] de Melo Mendes B. V., de Souza, R. M. (2004): Measuring financial risks with copulas. Int. Rev. Financ. Analy., Vol 13, pp. 27-45.

[17] Nagy, G. (2010): Value at Risk. The Wolfram Demonstrations Project.
http://demonstrations.wolfram.com/ValueAtRisk/

[18] Newey, W. K., Powell, J. L. (1987): Asymmetric least squares estimation and testing. Econometrica, Vol. 55, pp. 819-847.

[19] Pflug, G. Ch. (2000): Chapter 1 Some Remarks on the Value-at-Risk and the Conditional Value-at-Risk.
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.32.8541

[20] Song, Y., Yan, J. (2009): Risk measures with comonotonic subaditivity or convexity and respecting stochastic orders. Insurance: Mathematics and Economics. Vol. 45, pp. 459-465.

[21] Trindade, A. A., Zhu, Yun (2007): Approximating the distributions of estimators of financial risk under an asymmetric Laplace law. Computational Statistics & Data Analysis, Vol. 51, pp. 3433-3447.

[22]Yao, Q., Tong, H. (1996): Asymmetric least squares regression estimation: a nonparametric approach. J. of Nonparametric Statistics, Vol. 6 (2-3), pp. 273-296.

Author's address

Jan Hurt
Department of Statistics
Faculty of Mathematics and Physics
Charles University of Prague
Sokolovska 83
186 75 PRAGUE 8
Czech Republic
e-mail: hurt@karlin.mff.cuni.cz