Now that we have given the most important properties of copulas, we turn to the practical question of how to compute the Value-at-Risk of a portfolio using copulas. The following steps need to be performed:
2.2.1
Selecting the Marginal Distributions
The copula method works with any given marginal distribution, i.e. it does not restrict the choice of margins. However, we will use normal margins for simplicity and in order to allow a comparison with standard VaR methods.
2.2.2
Selecting a Copula
A wide variety of copulas exists, mainly for the two dimensional case (Nelsen (1999)). In our numerical tests, we will use some of the copulas presented in Table 4.1 of Nelsen (1999) in our experiments for comparison which are implemented in the function
C = VaRcopula(uv,theta,0,copula)
returnsCθ(u, v) for copulacopulawith parameterθ=theta. uv
is a n×2 vector of coordinates, where the copula is calculated. For easy reference the implemented copulas are given in Table 2.1.
2.2.3
Estimating the Copula Parameters
After selecting a copula we fit the copula to a time series
s=s(1), . . . , s(T) withs(t)= (s(1t), . . . , s(nt))
fort∈1, . . . , T. For simplicity we assume that thes(t)are realizations of i.i.d.
random variablesS(t). The first step will be to determine the parameters of
the marginal distributions. In the numerical example we will use the normal distribution N(0, σ2
i), and estimate the volatilityσi using an equally weighted
volatility estimator ˆσ2 i = 1 T−1 PT t=2(r (t) i )2of the returnsr (t) i = log(s (t) i /s (t−1) i )
for simplicity. The marginal distributions of the risk factors are then log- normal. The remaining task is to estimate the copula parameters. In the
XploReVaRquantlib this is done by the function
res = VaRfitcopula(history,copula,method)
fits the copula to the history using fitting function method. The result res is a list containing the estimates of the copula parameter together with there standard deviations.
Least Square Fit The main idea of the least square fit is that the cumulative distribution function Fθ(C)(x) defined by the copula C should fit the sample
# Cθ(u, v) = θ∈ 1 max[u−θ+v−θ−1]−1/θ,0 [−1,∞)\{0} 2 max1−[(1−u)θ+ (1−v)θ−1]1/θ,0 [1,∞) 3 1 uv −θ(1−u)(1−v) [−1,1) 4 exp −[(−lnu)θ+ (−lnv)θ]1/θ [1,∞) 5 −1 θln 1 + (e−θu−e−1)(θ−e−1θv−1) (−∞,∞)\{0} 6 1−h(1−u)θ+ (1−v)θ−(1−u)θ(1−v)θ)i 1/θ [1,∞) 7 maxhθuv+ (1−θ)(u+v−1),0i (0,1] 8 maxhθ2θ−2(uvθ−−1)(12−(1u−)(1u)(1−v−)v),0 i (0,1] 9 uvexp(−θlnulnv) (0,1] 10 uv/h1 + (1−uθ)(1 −vθ)i1/θ (0,1] 11 maxhuθvθ−2(1−uθ)(1−vθ)i 1/θ ,0 (0,1/2] 12 1 +h(u−1−1)θ+ (v−1−1)θi 1/θ−1 [1,∞) 13 exp1−h(1−lnu)θ+ (1−lnv)θ−1i 1/θ (0,∞) 14 1 +h(u−1/θ−1)θ+ (v−1/θ−1)θi 1/θ−θ [1,∞) 15 maxn1−h(1−u1/θ)θ+ (1−v1/θ)θi 1/θoθ ,0 [1,∞) 16 12S+√S2+ 4θ [0,∞) ,→S=u+v−1−θu1+1v −1 21 1−1− max(S(u) +S(v)−1,0) θ 1 θ [1,∞) ,→S(u) =h1−(1−u)θi 1/θ
Table 2.1. Copulas implemented in theVaRquantlib.
distribution function S(x) = T1PT t=11(s (t) 1 ≤ x1, . . . , s (t) n ≤ xn) as close as
possible in the mean square sense. The function1(A) is the indicator function of the event A. In order to solve the least square problem on a computer, a discretization of the support of Fθ(C) is needed, for which the sample set s(t)
seems to be well suited. The copula parameter estimators are therefore the solution of the following minimization problem:
min T X t=1 Fθ(c)(s(t))−S(s(t)) + 1 2T 2 subject to θ∈DC.
using the Newton method on the first derivative (method= 1). The addition of
1
2T avoids problems that result from the 1
T jumps at the sample points. While
this method is inherently numerically stable, it will produce unsatisfactory results when applied to risk management problems, because the minimization will fit the copula best where there are the most datapoints, and not necessarily at the extreme ends of the distribution. While this can be somewhat rectified by weighting schemes, the maximum likelihood method does this directly.
Maximum Likelihood The likelihood function of a probability density func- tion fθ(C)(x) evaluated for a time series s is given by l(θ) = QT
t=1f (C) θ (s
t).
The maximum likelihood method states that the copula parameters at whichl
reaches its maximum are good estimators of the “real” copula parameters. In- stead of the likelihood function, it is customary to maximize the log-likelihood function max T X t=1 logfθ(C)(x(t)) s.t. θ∈DC.
Maximization can be performed on the copula function itself by the Newton method on the first derivative (method=2) or by an interval search (method=3). The true maximum likelihood method is implemented inmethod=4 using an interval search. Depending on the given copula it may not be possible to maximize the likelihood function (i.e. iffθ(C)(s(t))) = 0 for sometand allθ. In
this case the least square fit may be used as a fallback.
2.2.4
Generating Scenarios - Monte Carlo Value-at-Risk
Assume now that the copulaC has been selected. For risk management pur- poses, we are interested in the Value-at-Risk of a position. While analytical methods for the computation of the Value-at-Risk exist for the multivariate normal distribution (i.e. for the Gaussian copula), we will in general have to use numerical simulations for the computation of the VaR. To that end, we need to generate pairs of random variables (X1, X2)∼ F(C), which form
scenarios of possible changes of the risk factor. The Monte Carlo method gen- erates a numberN of such scenarios, and evaluates the present value change of a portfolio under each scenario. The sampleα−quantile is then the one period Value-at-Risk with confidenceα.
Our first task is to generate pairs (u, v) of observations ofU(0,1) distributed random variables U and V whose joint distribution function is C(u, v). To reach this goal we use the method of conditional distributions. Let cu denote
the conditional distribution function for the random variableV at a given value
uofU, cu(v) def = P(V ≤v, U=u). (2.15) From (2.6) we have cu(v) = lim ∆u→0 C(u+ ∆u, v)−C(u, v) ∆u = ∂ ∂uC(u, v) =Cu(v), (2.16)
where Cu is the partial derivative of the copula. From Theorem 2.4 we know
thatcu(v) is nondecreasing and exists for almost all v∈[0,1].
For the sake of simplicity, we assume from now on thatcuis strictly increasing
and exists for all v ∈ [0,1]. If these conditions are not fulfilled, one has to replace the term “inverse” in the remaining part of this section by “quasi- inverse”, see Nelsen (1999).
With result (2.16) at hand we can now use the method of variable transforma- tion to generate the desired pair (u, v) of pseudo random numbers (PRN). The algorithm consists of the following two steps:
• Generate two independent uniform PRNs u, w ∈[0,1]. u is already the first number we are looking for.
• Compute the inverse function of cu. In general, it will depend on the
parameters of the copula and on u, which can be seen, in this context, as an additional parameter of cu. Setv =c−u1(w) to obtain the second
PRN.
It may happen that the inverse function cannot be calculated analytically. In this case one has to use a numerical algorithm to determinev. This situation occurs for example when Gumbel-Hougaard copulas are used.
v = VaRcopula(uv,theta,-1,copula)
returns inversev=c−1
u such thatres=cu(u, v) for copulacopula
with parameter θ =theta. uvis a n×2 vector of coordinates, where the copula is calculated.
Finally we determinex1= Φ−11(u) andx2= Φ−21(v) to obtain one pair (x1, x2)
of random variables with the desired copula dependence structure. For a Monte Carlo simulation, this procedure is performedN times to yield a sampleX = (x(1), . . . , x(N)).
X = VaRsimcopula(N, sigma 1, sigma 2, theta, copula)
returns a sample of sizeNfor the copulacopula with parameter
θ = theta and normal distributions with standard deviations
σ1=sigma 1,σ2=sigma 2.
If we assume a linear position a with holdings a1, . . . , an in each of the risk
factors, the change in portfolio value is approximately Pn
i=1ai·xi. Using a
first order approximation, this yields a sample Value-at-Risk with confidence levelα.
VaR = VaRestMCcopula(history,a,copula,opt)
fits the copula copula to the history history and returns the
N-sample Monte Carlo Value-at-Risk with confidence level α =
alpha for positiona. Nandalphaare contained in listopt.