2.2 Computing Value-at-Risk with Copulas
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)
returns
for copula copula
with parameter theta. uv is a
vector of coordinates, where the copula is calculated.
|
For easy reference
the implemented copulas are given in Table 2.1.
Table:
Copulas implemented in the
VaR
quantlib.
# |
 |
 |
1 |
![$ \max\Big([u^{-\theta}+v^{-\theta}-1]^{-1/\theta},0\Big)$](xfghtmlimg549.gif) |
 |
2 |
![$ \max\Big(1-[(1-u)^{\theta}+(1-v)^{\theta}-1]^{1/\theta},0\Big)$](xfghtmlimg551.gif) |
 |
3 |
 |
 |
4 |
![$ \Big.\exp\left(-[(-\ln u)^\theta+(-\ln v)^\theta]^{1/\theta}\right)$](xfghtmlimg554.gif) |
 |
5 |
 |
 |
6 |
![$ 1-\Big[(1-u)^\theta+(1-v)^\theta-(1-u)^\theta(1-v)^\theta)\Big]^{1/\theta}$](xfghtmlimg557.gif) |
 |
7 |
![$ \max\Big[\theta uv+(1-\theta)(u+v-1),0\Big]$](xfghtmlimg558.gif) |
![$ (0,1]$](xfghtmlimg559.gif) |
8 |
![$ \max\Big[{\theta^2uv-(1-u)(1-v)\over \theta^2-(\theta-1)^2(1-u)(1-v)},0\Big]$](xfghtmlimg560.gif) |
![$ (0,1]$](xfghtmlimg559.gif) |
9 |
.
 |
![$ (0,1]$](xfghtmlimg559.gif) |
10 |
![$ uv/\Big[1+(1-u^\theta)(1-v^\theta)\Big]^{1/\theta}$](xfghtmlimg562.gif) |
![$ (0,1]$](xfghtmlimg559.gif) |
11 |
![$ \max\Big(\Big[u^\theta v^\theta-2(1-u^\theta)(1-v^\theta)\Big]^{1/\theta},0\Big)$](xfghtmlimg563.gif) |
![$ (0,1/2]$](xfghtmlimg564.gif) |
12 |
![$ \Big(1+\Big[(u^{-1}-1)^\theta+(v^{-1}-1)^\theta\Big]^{1/\theta}\Big)^{-1}$](xfghtmlimg565.gif) |
 |
13 |
![$ \exp \Big(1- \Big[ (1-\ln u)^\theta + (1-\ln v)^\theta -1 \Big]^{1/\theta} \Big)$](xfghtmlimg566.gif) |
 |
14 |
![$ \Big( 1+ \Big[ (u^{-1/\theta} -1)^\theta + (v^{-1/\theta} -1)^\theta \Big]^{1/\theta} \Big)^{-\theta}$](xfghtmlimg568.gif) |
 |
15 |
![$ \max \Big( \Big\{ 1- \Big[ (1-u^{1/\theta})^\theta + (1-v^{1/\theta})^\theta
\Big]^{1/\theta} \Big\}^\theta ,0 \Big)$](xfghtmlimg569.gif) |
 |
16 |
 |
 |
|
 |
|
21 |
 |
 |
|
![$ \hookrightarrow S(u)=\Big[1-(1-u)^\theta\Big]^{1/\theta}$](xfghtmlimg574.gif) |
|
|
2.2.3 Estimating the Copula Parameters
After selecting a copula we fit the copula to a time series
for
. For
simplicity we assume that the
are realizations of i.i.d.
random variables
. The first step will be to determine the
parameters of the marginal distributions. In the numerical example we will use
the normal distribution
, and estimate the volatility
using an equally
weighted volatility estimator
of the returns
for simplicity.
The marginal distributions of the risk factors are then log-normal. The
remaining task is to estimate the copula parameters. In the
XploRe
VaR
quantlib 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.
|
The main idea of the least square fit is that the cumulative distribution
function
defined by the copula
should fit
the sample distribution function
as close as possible in the mean square sense. The function
is the
indicator function of the event
. In order to solve the least square
problem on a computer, a discretization of the support of
is needed, for which the sample set
seems to be
well suited. The copula parameter estimators are therefore the solution of the
following minimization problem:
using the Newton method on the first derivative (
). The
addition of
avoids problems that result from the
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.
The likelihood function of a probability density function
evaluated for a time series
is given by
.
The maximum likelihood method states that the copula parameters at
which
reaches its maximum are good estimators of the ``real''
copula parameters.
Instead of the likelihood function, it is customary to maximize the
log-likelihood function
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 in method=4 using an interval search. Depending on the given copula it may not
be possible to maximize the likelihood function (i.e. if
for some
and 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 copula
has been selected.
For risk management purposes, 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
, which form
scenarios of possible changes of the risk factor. The Monte Carlo method
generates a number
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
of observations of
distributed random variables
and
whose joint distribution function is
. To reach this goal we use the method of conditional
distributions. Let
denote the conditional distribution function for the
random variable
at a given value
of
,
 |
(2.15) |
From (2.6) we have
 |
(2.16) |
where
is the partial derivative of the copula. From
Theorem 2.4 we know that
is nondecreasing and exists for almost all
.
For the sake of simplicity, we assume from now on that
is strictly increasing and exists for all
. 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 transformation to generate the
desired pair
of pseudo random numbers (PRN).
The algorithm consists of
the following two steps:
- Generate two independent uniform PRNs
.
is already the first number we are looking for.
- Compute the inverse function of
. In general, it
will depend on the parameters of the copula and on
, which
can be seen, in this context, as an additional parameter
of
. Set
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 determine
. This situation
occurs for example when Gumbel-Hougaard copulas are used.
- v
- =
VaRcopula
(uv,theta,-1,copula)
returns inverse
such that
for copula copula with parameter theta. uv is a
vector of coordinates, where the copula is calculated.
|
Finally we determine
and
to obtain one pair
of random variables with the desired copula
dependence structure. For a Monte Carlo simulation, this procedure is
performed
times to yield a sample
).
- X
- =
VaRsimcopula
(N, sigma_1, sigma_2, theta, copula)
returns a sample of size N for the copula copula with parameter
theta and normal distributions with
standard deviations
sigma_1,
sigma_2.
|
If we assume a linear position
with holdings
in each of
the risk factors, the change in portfolio value is approximately
.
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 position a. N and alpha are
contained in list opt.
|