← Back to list

Estimating the Value at Risk

In the last paper we talked about how we can derive a formula for VaR if we impose certain conditions on it (assumption of normality)…

Shashank Pandey · 2026-05-01 18:44 · 0 claps · 4.8 min read
#cfa #frm #stats #risk-management
Open on Medium ↗
Wiki topics: BIZ · Business Strategy

Estimating the Value at Risk

In the last paper we talked about how we can derive a formula for VaR if we impose certain conditions on it (assumption of normality). Today, we are going to learn about some ways we can estimate VaR, and hence we bring in some sense of practicality to the tedious and abstract paper I wrote before.

For these calculations, we use AMZN stock price data. The returns are calculated using the Holding period return formula,

Where Vt is the final value and Vt-1 is the initial value

Now, given the VaR is a quantile of the loss/return distribution which can also be expressed in probability terms for continuous distributions as we saw in our previous paper, it can be estimated in many different ways. We’ll discuss a few here (not exhaustive).

Non-Parametric approaches

In these approaches, we do not assume the ‘functional form’ of the generating distribution that the return/loss comes from (If we assume L is our loss variable that can have many realized values, which are your losses).

The simplest method. we take the Profit and Loss (PnL) data and sort it in ascending order (losses on the left, profits on the right). The 95% VaR is simply the 5th percentile of this sorted data. In our AMZN example, this estimate is -0.0307%.

Note: This is a discrete approach. If no data point coincides exactly with the 5th percentile, we must use interpolation or select the nearest observation. In a strict historical sense, if a threshold isn’t observed, the VaR at that specific level cannot be determined without estimation.

Historical VaR for AMZN (Discrete)

Historical VaR for AMZN (Discrete)

To battle this, we use a technique called ‘Kernel Density estimation’. This helps us smoothen out our discrete graph above into something more smooth and ‘continuous’.

Historical VaR (Continuous)

Historical VaR (Continuous)

In a discrete approach, you just sort the numbers and pick the one at the 5% mark. In a continuous distribution (like the KDE), the “quantile” (or the VaR) is the value, where the total area under the curve to the left equals our target probability (significance level). If we are to find the VaR at 95%, we need to find the loss/return ‘x’ such that:

Where alpha is 1– 0.95 (Level of confidence) = 0.05, F_x is the quantile function or the cumulative distribution function.

Now non-parametric methods can extend to approaches like exponentially weighing schemes for adding onto the observations a ‘decay’. As the observed losses/return become older they become less relevant to calculating the risk today, as the market regimes switch. But these are non-standard and empirical in nature, and are not forward looking

Parametric approaches

In this world, we have a belief state (much like the Bayesian world) where we impose a functional form on the distribution of return/loss, which makes it easy for the calculations, since we have neat formulas for the CDFs. In other words, we assume that the return/loss distribution is normal or some other distribution at the onset. These are also somewhat forward looking, much like the KDE method, where we can expect losses outside of the sample we build our loss distribution off, but they are still as good as the inputs we feed them.

Now, How do we do this? We ‘fit’ our data to a certain distribution. We use approaches like Moment-matching, Maximum Likelihood estimate (MLE) or Maximum A Posteriori (MAP).

In our case, let us assume that the returns distribution follows normal distribution. We can then use techniques, to fit our return data to a normal distribution. I used the MLE approach and the data looks something like this:

Analytical VaR

Analytical VaR

Here, VaR as we saw in our last article is calculated by first converting into standard normal and then:

We see that it messes with the tails (not fat tailed anymore compared to the empirical distribution), which is the drawback of using a parametric approach, it misses out on some or the other nuance of the actual distribution. Note that we could theoretically try finding more suitable distributions using tests, like T-distribution or if these are too smooth you could link them to a mixture model as well.

The concept of Confidence Interval

The VaR that we get out of the sample assuming normality above is actually a ‘statistic’ and therefore not the true value of the parameter in question, which is the quantile. Hence, we can calculate a range within which the true VaR would lie, or the confidence interval.

The bootstrapping way,

How to:

  1. Fit the distribution to the return sample.
  2. Bootstrapping, resample with replacement n times.
  3. Calculate VaR using the same methodology for n samples.
  4. Use the n VaR estimates to create a sampling distribution of the VaR. The mean of this distribution is the true VaR, and the standard deviation of this distribution is the standard error of VaR.

Sampling distribution of the VaR

Sampling distribution of the VaR

Since, our sampling distribution is normal (according to the central limit theorem), we can use the Wald’s interval to estimate the interval in which our true VaR could fall.

Wald’s interval

Wald’s interval

There is also a neat asymptotic formula for standard error of a quantile (which is what our VaR is):

Standard error for quantile

Standard error for quantile

Where the f(q_p) (this is not a crying emoticon) is the density (kernel based or assumption based), p is the quantile and n is the sample size. As the “density” at the tail gets lower (thinner tails), the error in our estimate gets higher. This perfectly explains why VaR is so hard to estimate for extreme events!

This brings is to a close of today’s article, next time we will look at an approach that is a little more complex compared to these. You can find the code for these here. Adios amigo!


메타데이터
post_id
c87a49983bbb
slug
estimating-the-value-at-risk-c87a49983bbb
url
https://medium.com/@jon7willnk3/estimating-the-value-at-risk-c87a49983bbb
canonical_url
https://medium.com/@jon7willnk3/estimating-the-value-at-risk-c87a49983bbb
author_url
https://medium.com/@jon7willnk3
status
ok
fetched_at
2026-06-11 06:59:45