# Intro to Value at Risk

Value at risk (VaR) is a way to statistically measure the worst expected loss on an investment given certain parameters.  Specifically, the level of confidence (called the alpha level, α) and time horizon must be specified to compute it.  We must also assume that returns on the asset in question are approximately normally distributed, because the value at risk model calculates the worst expected loss over a given horizon at a given level of confidence under normal market conditions1.  Although it’s a well-established fact that, in general, stock prices are log normally distributed while stock returns are normally distributed.  It may be a good idea to verify this first, using a goodness of fit test.  The Anderson-Darling, Shapiro-Wilk, and  Kolmogorov-Smirnov tests are all good examples.  When we say normal, we mean that the data is normally distributed; we are making a judgment regarding the distribution of returns, not the likelihood of realizing a return, as the dictionary definition of normal would suggest.  As we’ll see, the VaR turns out to be a relatively unusual result in most cases, and its rarity is inversely related to the level of confidence we choose.  It follows that a formal definition of the value at risk is a measure of the worst expected loss over a given time frame and level of confidence under normal market conditions.

The actual VaR number should be the worst expected loss on an asset in terms of currency (not probability).  If we let f represent the probability density function of the return2 of the asset and c the confidence interval, we have the following formula:

In words, this formula equates the confidence level, or degree of certainty with which we can draw a conclusion, with the integral from -∞ to the negative of our VaR value (some real number measured as a return in dollars) of the probability density function (pdf).  The Fundamental Theorem of Calculus tells us that integrating over a range gives us the area between the x-axis and the function.  In the context of a probability density function, whose y-axis is probability, this says that by integrating from A to B, we’re finding the probability that the random variable takes on a value between A and B.  In the context of VaR, when we integrate from negative infinity to –VaR, we’re finding the probability of realizing a value equal between -∞ and –VaR, or, more simply, the probability of realizing a value less than –VaR.  So for a given confidence level c, we’re looking for the value –VaR such that the integral from -∞ to –VaR is equal to (1 – c).

It might be confusing that the negative of the VaR is used in this computation.  This arises because of the symmetry property of the normal distribution.  Each value, however extreme (extreme meaning far from the mean in terms of standard deviations) has a complementary value in the opposite direction.  If we’re talking about the standard normal distribution, we’re just saying that the distribution is normally distributed with a mean of 0 and a standard deviation of 1.  So a relatively extreme value, say 3, has a complementary value, -3, that is just as extreme in the opposite direction.  3 is a value 3 standard deviations greater than the mean, and -3 is 3 standard deviations below the mean.  But we’re only interested in a potential loss in VaR models, as risk is by definition a quantitative measure of realizing a loss, we’re only interested in the –VaR.  The corresponding positive VaR will be a value just as extreme but positive – in this case, a good thing since it means higher returns.

Every potential portfolio value corresponds to a z score, or a standardized measure of how many standard units (standard deviations) a value lies from the mean of the distribution, as was mentioned above.  Ordinarily, we transform a random variable X into a standardized Z score with the formula Z = (x – μ)/σ, where, in this case, x = VaR and Z = Z value corresponding to the confidence level.  However, since we’re only interested in the negative values, we substitute x = -VaR and Z = -Z.  We can rewrite the equation more simply now: VaR = Zσ – μ.  This equation will standardize our VaR value.

So if you’d like to be 95% certain you won’t lose more than the VaR, you set the left hand side of the equation equal to (1 – 95%) = (1 – .95) = .05 and solve for the number VaR, which can then be interpreted as the 95% value at risk.  What you’ve really found here is the portfolio value that represents the spot on the x axis where the total area above the axis and below the pdf on the left hand side all the way to x = negative infinity is equal to .05.

If we use the 99% confidence level, we have c = (1 – .99) = .01.  We have to find a z score that divides the normal distribution into a section with 1% of the area to the left and 99% of the area to the right.  The picture below has 1% of the area in each tail of the distribution, and thus 98% shaded in the middle.

We’re interested in the z score that divides the lower white region from the rest of the graph, because that will correspond to the value that 99% of the x values are greater than.  But since the normal curve is symmetrical, that value is just going to be the negative of z value, which represents the x value with 99% of observations below it.

The pictures reveal that the z value in question is z = -2.33.  To reiterate, standardizeing the value of any random variable x (i.e. assigning it a z value), uses the relationship Z = (x – mean)/(StanDev).  This Z value is the VaR in standardized form.  Therefore, we can substitute –VaR for Z in computations because what we’re really finding when we find the VaR is the left tail (Z score) of the distribution.

If the VaR is 200 at the 99% confidence level, you could say that largest possible loss on your asset at the 99% confidence level is 200, given normal market conditions.  Alternatively, you could be 99% certain your losses won’t exceed 200.

Since the cumulative density function (F) is the indefinite integral of the probability density function (f), we can use it to simplify this expression (sorry for the bullshit above the equation – I had to screenshot it because wordpress hates equations):

An example should make this clearer.  Suppose the daily return on a portfolio follows a normal distribution with a mean of \$1000 and a standard deviation of \$500.  At the 99% confidence level, we have alpha = .01 which corresponds to a z-score of 2.33, i.e. the CDF of the normal distribution is equal to .99 when the z value is 2.33; F(2.33) = 0.99.  But we want the lower end of the distribution, -2.33.  Therefore:

VaR = ασ – μ = 2.33(500) – 1000 = 165

So with 99% confidence we can assume that our worst possible expected loss in one day is \$165.  The value of -\$165, i.e. a \$165 loss, is 2.33 standard deviations (z scores) below our mean value of \$1000.  So although we still expect (on average) to earn \$1000 with a standard deviation of \$500, we will only lose more than \$165 in a single day less than 1% of the time.  The PDF and CDF are below.

So the value -165 is exactly equivalent to the standardized z score of -2.33 as they both represent the value that 1% of observations fall below and 99% exceed.  The only difference is that with the number -2.33 we’re talking about a standardized random variable with a mean of 0 and a standard deviation of 1, whereas the VaR number of -165 represents a portfolio return with a mean of \$1000 and a standard deviation of \$500.  Alternatively, -\$165 is the value 2.33 standard deviations to the left of the \$1000 mean portfolio return.

Math & Statistics graduate who likes gymnastics, 90s alternative music, and statistical modeling. View all posts by schapshow

#### 3 responses to “Intro to Value at Risk”

• sahriskmanager

yeah ! thanks for posting this. My Problem with VaR model is that it does not capture tail risks! Anyways the Model OUTPUT can only be as good as the INPUT itself!

• Samchappelle

Good point! There are countless issues one could run into when computing the mean/expected value (such as time horizon, what kind of return to compute, etc.) as well as the variance (time horizon is probably the most pressing). And I’ll have to think of some statistical techniques regarding tail risks that I can share!

• sahriskmanager

Thanks for feedback!
Please do visit my homepage on wordpress. I would appreciate ff you would read some of my blogs on risk management and offer your expert insights / comments
thanks

www.openeuroscience.com/

Open source projects for neuroscience!

Systematic Investor

Systematic Investor Blog

Introduction to Data Science, Columbia University

Blog to document and reflect on Columbia Data Science Class

Heuristic Andrew

Good-enough solutions for an imperfect world

r4stats.com

"History doesn't repeat itself but it does rhyme"

My Blog

take a minute, have a seat, look around

Data Until I Die!

Data for Life :)

R Statistics and Programming

Resources and Information About R Statistics and Programming

Models are illuminating and wrong

A data scientist discussing his journey in the analytics profession

Xi'an's Og

an attempt at bloggin, nothing more...

Practical Vision Science

Vision science, open science and data analysis

Big Data Econometrics

Small posts about Big Data.

Simon Ouderkirk

Remote Work, Small Data, Digital Hospitality. Work from home, see the world.

rbresearch

Quantitative research, trading strategy ideas, and backtesting for the FX and equity markets

Statisfaction

I can't get no

The Optimal Casserole

No Line Is Ever Pointless

SOA Exam P / CAS Exam 1

Preparing for Exam P / Exam 1 thru Problem Solving

schapshow

Mathematical statistics for the layman.