The Mathematics of Value-at-Risk



An Introduction to the Mathematics of Value-at-Risk

James N. Grotke, Jr.

May 2010

Abstract

The financial concept of value-at-risk (VaR) plays an integral role in modern financial risk management. VaR is used by many large financial institutions to measure the riskiness of their holdings and determine safe levels of capital to hold. This paper will explore the mathematics behind this fundamental concept. Specifically, the relevant probability theory underlying VaR will be discussed as will some concepts from linear algebra and applied mathematics that are useful in the computation of VaR. The paper will conclude with a sample problem that illustrates how to go about finding the VaR for a hypothetical portfolio.

I. Introduction

Value-at-Risk (VaR) gives the financial risk manager the worst expected loss under average market conditions over a certain time interval at a given confidence level. In other words, VaR gives the risk manager a sense of what he or she can expect to potentially lose in a given time interval, assuming “normal” market conditions.

Definition 1: Given a confidence level α[pic](0,1), the Value-at-Risk of a portfolio at α over the time period t is given by the smallest number k[pic][pic] such that the probability of a loss over a time interval t greater than k is α.

This concept is best illustrated through an example. Suppose a hypothetical bond portfolio has a “one-day VaR at a confidence level of 5% of $10 million.” This means that over a typical one-day period, the bond portfolio will lose $10 million or more only 5% of the time. While the concept of VaR is not too difficult to grasp, obtaining an actual VaR is quite involved. A large amount of data on historical returns for the holdings in a portfolio is utilized to arrive at a VaR. Average returns, variances and covariances of the returns of each holding are calculated. Using these values, an average return and variance of the overall portfolio can be determined. At this point, the risk manager determines the probability distribution that the return data will be assumed to follow. Using the calculated portfolio return mean and variance and this assumed probability distribution, one can solve for the VaR at a given confidence level.

II. The Mathematics Underlying Value-at-Risk

Two areas of mathematics that are relevant to understanding VaR will be discussed. First, the relevant probability theory will be covered, as this forms the underpinning of VaR. Second, some topics from linear algebra will be reviewed. While not integral to the underlying mathematics of VaR, techniques from linear algebra are very useful in the actual computation of VaR.

Part 1: Probability Theory

Perhaps the most important concept in probability theory is that of expected value.

Definition 2: The Expected Value of the random variable X, denoted as E[X] or µ, is given by E[X] = [pic] , where xi are the various values that X can take, and p(xi) is the probability of X taking the value xi.

The expected value can be thought of as a weighted average of the possible values that X can take. When each value of X occurs with the same probability, the expected value takes on the more familiar form E[X] = [pic] = [pic]= [pic][pic].

Important Property of the Expected Value:

If X and Y are two random variables, and a,b [pic], then the following holds:

E[aX+bY] = aE[X]+bE[X], provided E[X] and E[Y] are finite. Equivalently,

E[[pic]] = [pic], for random variables Xi and αi[pic]. This can be proved using mathematical induction and the linearity property of expected value.

In addition to having a measure of the average value of a set of data, being able to measure the spread, or variability, of a random variable is also important.

Definition 3: The variance of the random variable X, denoted Var(X) or[pic]or [pic], is given by Var(X) = E[(X-µ)2] = [pic], where µ is the expected value of X, xi are the various values that X can take, and p(xi) is the probability of X taking the value xi.

When each value of X occurs with the same probability, the variance takes on the more familiar form Var(X) = E[(X-µ)2] = [pic]= [pic]= [pic][pic].

Two Important Properties of Variance:

1. Var(aX) = a2Var(X) , a[pic]

2. Var(X+b) =Var(X) , b[pic]

When looking at linear combinations of random variables, an idea that arises in conjunction with the variance is that of covariance. Covariance is a measure of how two random variables move together (how they “co-vary”). It is related to the more well-known idea of correlation.

Definition 4: The covariance between random variables X and Y, denoted Cov(X,Y) or σXY is given by Cov(X,Y) = E[(X-µ)(Y-γ)], where µ = E[X] and γ = E[Y]. Using the linearity of expected value, this can be simplified as follows:

Cov(X,Y) = E[(X-µ)(Y-γ)] =E[XY-X γ-Yµ+ µγ] = E[XY] - E[X γ] - E[Yµ] + E[µγ]

=E[XY] - E[X γ] = E[XY] - E[X]E[Y].

If X and Y both take on n values, then the covariance can also be written as Cov(X,Y) =[pic].

Three Important Properties of the Covariance:

1. Cov(X,Y) = Cov(Y,X)

2. Cov(X,X) = Var(X) (ie. The covariance of X with itself is the variance)

3. Cov(αX,[pic]Y) = α[pic]Cov(X,Y) , where α,[pic][pic]

Now that the covariance has been defined, the variance of a linear combination of random variables can be discussed.

Definition 5: The variance of α1X1+α2X2+…+αnXn, when Xi are random variables, and αi[pic], i[pic]{1,2,…,n}, is given as follows:

Var([pic]) = [pic]+ 2[pic].

Admittedly, this looks a bit ugly. When the example quantitative problem is solved, this summation will be better elucidated. This is one calculation where techniques from linear algebra prove invaluable.

Now that the expectation, variance, and covariance have been thoroughly discussed, the topic of probability distributions can be given some attention. Probability distributions are essential to VaR calculations. Take the expected value and variance of the portfolio returns, and apply these to a probability distribution (a portfolio can be thought of as a linear combination of assets, or random variables). Inferences as to the probabilistic return characteristics of the portfolio, assuming it adheres to the distribution that was chosen, can be made.

Thus far, random variables whose set of possible values was finite or countably infinite have been considered. This is a discrete setting. In a continuous setting, random variables whose set of possible values is uncountable are considered.

Definition 6: X is a Continuous Random Variable if there exists a non-negative function f defined for all real numbers, having the following property:

For every set B of real numbers, P[X[pic]B] = [pic]. f is the Probability Density Function of X. In other words, the probability that X is in the set B can be found by integrating f over the set B.

Since X must always take a value in the reals (ie. X[pic](-∞,∞)), the following logically follows:

P[X[pic](-∞,∞)] = [pic]= 1.

Also, any probability statement about X can be written in terms of f. For example, if X[pic](-∞,∞) and a,b[pic](-∞,∞), then P[a[pic]X[pic]b] = [pic].

Building on this idea, the cumulative distribution function of X is defined as follows.

Definition 7: Suppose X is a continuous random variable and X[pic](-∞,∞). The Cumulative Distribution Function of X at a, denoted F(a), gives the probability that X takes a value less than or equal to a. Mathematically, F(a) = P[X[pic]a] = [pic].

Recall, in the discrete setting the expected value of X was defined as follows:

E[X] = [pic].

The analogous definition in the continuous setting is

E[X] = [pic].

Similarly, the variance in the continuous setting is defined as follows:

Var(X) = [pic], where µ = E[X].

The most well-known distribution is the Gaussian, or Normal Distribution. It is commonly referred to as the “Bell Curve.”

Definition 8: X is a normal random variable with parameters µ and σ2 if it has the following probability density function: f(x) = [pic] .

One can also say X is normally distributed, or X~N(µ, σ2).

Note: Since f(x) is a probability density function, the area under the entire curve is 1.

If X is normally distributed with mean µ and variance σ2, we can create a new variable Z that is also normally distributed and is termed the standard normal random variable.

Z = [pic] with expected value 0 and variance 1. The probability density function of the standard normal is f(z)= [pic] = [pic].

A result of the above is that solving P[a[pic]X[pic]b] is the same as solving P[[pic][pic]Z[pic][pic]]. This process of converting a and b can be thought as a “standardization.” [pic] is the Z-Score for a, and [pic] is the Z-Score for b.

Finally, the cumulative distribution function for the standard normal random variable must be described. The CDF, denoted [pic], is denoted as follows:

[pic]= [pic] = P[Z[pic]a]. This can be thought of as the area of the shaded region under the following graph:

To illustrate this idea, consider the following example:

Question: Suppose X is a normal random variable with mean µ and variance σ2. What is the probability that X lies between a and b?

Solution: First, obtain Z-Scores for a and b: Za= [pic] and Zb = [pic] . Now apply the cumulative distribution function for the standard normal random variable.

P[a[pic]X[pic]b]] = P[Za [pic]Z[pic] Zb] = [pic]= [pic]- [pic]

This covers the basic probability theory underlying VaR. Now, two methods from linear algebra useful in the computation of VaR will be examined.

Part 2: Linear Algebra

As was mentioned on page 3, the expected value of a linear combination of random variables is the linear combination of the expected values. Suppose we have random variables X1,X2,…,Xn, and coefficients α1, α2,…, αn[pic]. Then it follows that

E[α1X1 + α2X2 +…+ αnXn] = α1E[X1] + α2E[X2] +…+ E[αnXn].

We can use matrices to carry out this computation:

Let K = [pic] and let U = [pic].

Then E[α1X1 + α2X2 +…+ αnXn] = KTU = [pic] [pic]

E[[pic]] = α1E[X1] + α2E[X2] + α3E[X3] +…+ αnE[αnXn] = [pic], agreeing with the definition on page 3.

E[[pic]] can be thought of as the expected return of a portfolio of financial assets Xi, where αi is the proportion of the portfolio invested in asset Xi. Assuming the expected return of each asset and the proportion of the total portfolio invested in each asset is known, the expected return of the overall portfolio can be determined. Using matrices is useful computationally when dealing with a large portfolio of many assets. One simple matrix operation (KTU) is all that is needed to find the expected return of the total portfolio.

As was described on page 5, the variance of a linear combination of random variables is the following: Var([pic]) = [pic]+ 2[pic].

As one can imagine for a large portfolio (many Xi) this is a non-trivial calculation. Again, matrices are usually the best way to proceed. In this case, the matrix used is the Variance-Covariance Matrix, denoted Σ.

Let the Var(Xi) be denoted σii and Cov(Xi, Xj) = σij . Then the Variance Covariance Matrix for n random variables is defined as follows:

Σ = [pic].

Since Cov(Xi, Xj) = σij = Cov(Xj, Xi) σji, Σ is symmetric (ie. Σ = ΣT).

Suppose we want to find the variance of a linear combination of random variables, or

Var([pic]). Let K = [pic] and Σ = [pic].

Then Var([pic]) = KTΣK . Since this result is not very obvious, let’s look at the 3 random variable example to illustrate:

Var([pic]) = KTΣK = [pic][pic][pic].

= α12σ11+ α1α2σ21+ α1α3σ31+ α1α2σ12+ α22σ22+ α2α3σ32+ α1α3σ13+ α2α3σ23+ α32σ33

= (α12σ11 + α22σ22+ α32σ33) + (2 α1α2σ21 + 2 α1α3σ31+ 2 α2α3σ23)

= [pic]+ 2[pic]

III. A General Solution to the Basic VaR Problem

Now that the requisite mathematical topics have been covered, the solution to the generalized VaR problem can be described.

Problem: Suppose there is a portfolio consisting of Assets 1,2,3,…,N. Di dollars are invested in Asset i, so the total value of the portfolio is D1+D2+…+DN = [pic]= D dollars. Assume the one-day return of Asset i is normally distributed with expected value E[ri] and variance [pic]. Also, the covariance between the 1-day returns of Assets i and j is given by [pic]. Given this information, find the 1-day VaR at a confidence level of 5%.

Solution: First, determine the expected return and variance of the overall portfolio. The first step in doing this is to calculate the weighting for each asset. The proportion of the portfolio expected return attributable to Asset i is [pic]= [pic]. These are the asset weighting factors.

Now, let K = [pic] and let U = [pic]. We are creating a linear combination of random variables, where the random variables are the expected 1-day returns for each asset, and the coefficients are the asset weighting factors.

Taking advantage of the property of expectations that E[[pic]] = [pic] and the matrix method for finding this expectation, we obtain the following result:

E[rPortfolio] = E[[pic]] = KTU = [pic][pic] = [pic]= [pic].

Next, we must calculate the variance of the total portfolio. In other words, we need to calculate the variance of the linear combination of random variables. As was discussed on page 5, the variance of the linear combination of random variables is given by

Var([pic]) = [pic]+ 2[pic].

We can modify this to the conditions of our stated problem:

[pic]= Var([pic]) = [pic]+ 2[pic]

=[pic]+ 2[pic]

To actually compute[pic], let K = [pic] and Σ = [pic].

As was shown on page 11, we know Var([pic]) = KTΣK. Therefore, we obtain that [pic]= Var([pic]) = KTΣK = [pic][pic][pic].

Now that we have an expected value and variance for the overall portfolio return, we can find the VaR. We assume that the portfolio return is normally distributed with mean [pic] and variance [pic], both of which are numbers we have calculated. Since we want the VaR at a 5% confidence level, we are solving for the return such that a return worse than this return occurs only 5% of the time. Mathematically, we are solving for r* such that

[pic] = 0.05.

Many mathematical software programs have a NORMINV function to solve for r*. Solving for r* analytically is quite involved, and this would not be done in a real-world setting. Therefore, assume we have found r* such that [pic] = 0.05 holds.

Usually, r* is a small, negative decimal. 100 r* is a percentage and can be thought of as the one-day percent loss such that, in normal market conditions, the portfolio loses more than 100 r* % only 5% of the time. Therefore, the one-day Value-at-Risk at a 5% confidence level is D[pic].

In the unusual event that r* > 0, the VaR is not very useful. Recall, we found r* such that the portfolio performs worse than r* only 5% of the time. But r* > 0, so essentially we are stating that only 5% of the time will the portfolio earn us a positive return between 0 and r* or lose money. Therefore, if we obtain an r* > 0, it is a useless metric. We should run a new VaR analysis with a lower confidence level until we obtain an r* < 0.

IV. Some Final Observations

It is important to note the large amount of data required to undertake a VaR calculation. In the generalized problem, the expected returns and variances of each asset, as well as the covariances between the assets were all given. With modern computing power, it is relatively easy to obtain these values. Normally, a risk manager will have access to historical return data for each asset, so only a few lines of code are required to calculate expected returns, variances, and covariances. Still, the point that a great deal of data is needed before one can even approach calculating a portfolio VaR cannot be stressed enough.

It is also important to note that VaR is a very versatile model. While this paper used a normal distribution, practically any distribution can be implemented. This gives the risk manager the ability to tailor a VaR model to the specific characteristics of the portfolio he or she is dealing with.

Lastly, an interesting trend in risk management has been the movement toward probability distributions that have “fatter tails” (ie. distributions that give greater weighting to outlying, multi-sigma events). A major realization of the recent financial crisis has been that financial returns do not always approximate a normal distribution or some other benign distribution. Extreme events, often termed “Black Swans,” tend to occur more frequently than such distributions would predict. Consequently, greater emphasis has been placed on using distributions with fatter tails that give a larger weighting to these extreme events.

References

Benninga, Simon. 2000. Financial Modeling. 2nd Edition. Cambridge, MA: The MIT

Press.

Bodie, Zvi, A. Kane, and A.Marcus. 2008. Essentials of Investments. 7th Edition. New

York: McGraw-Hill Irwin.

“The Gods Strike Back: A Special Report on Financial Risk.” The Economist. 13

February 2010.

Ross, Sheldon. 2006. A First Course in Probability. 7th Edition. Upper Saddle River,

NY: Pearson Prentice Hall, Inc.

Strang, Gilbert. 2007. Computational Science and Engineering. Wellesley, MA:

Wellesley-Cambridge Press.

Taleb, Nicholas Nassim. 2007. The Black Swan. New York: Random House, Inc.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download