Data Science in Risk Management

Finding Value-at-Risk (VaR) and Expected Shortfall (ES)

By John Lee | April, 2023

Have you just started your investment journey and wondered how much to invest? Did you follow promising strategies but still see your account in red? Are you worried about the risk that you cannot foresee in your holdings? If you are nodding along these questions, know that you are not alone. In fact, these are what professionals like quants, traders, and asset managers wonder but fail to solve all the time- one often enters the market with a correct timing at a correct price but walks out with a flat wallet, and worse off, with margin debt. An example was when Ray Dalio’s hedge fund, Bridgewater Associates, lost 12.1billion of investor’s money during the post-COVID19 recovery in 2020. According to the U.S. Securities and Exchange Commission (SEC), 70% of investments are lost to mistreated risks. These risks are often inevitable, yet identifiable with the right statistics techniques. An example of Apple’s stock data is used to illustrate this.

Plotting a Histogram 

Daily stock returns of Apple from May 1st, 2012, to May 1st, 2022, are put on a log-scale for the sake of normalization, and a histogram is plotted to show their distribution. The log returns seem to range from -0.15 to 0.10, and peak around 0. The distribution seems to be symmetric with moderate spreads and minor thickness on both tails.

Fitting Probability Distribution Models 

Our goal is to find the distribution curve that best fits the histogram. In the graphs below, a Normal, Double Exponential, and Student-t distributions are fitted. Which distribution curve helps achieve our goal better?

Observantly, one could see that the Double Exponential distribution fits the histogram better than the others because its line traces the density bars closer throughout all log return values, particularly at the center of the histogram, when the Normal distribution curve fails to capture the peak of the histogram and the Student-t distribution missed it by a slight bit.

Having found such a curve means that we have obtained a model function that can simulate Apple’s log return for the next trading day, the trading day after, and so on.

Finding Value-at-Risk (VaR) and Expected Shortfall (ES)

VaR is a statistic used to quantify the risk of potential losses for a firm or an investment. ES is a statistic used to quantify the average losses for a firm or an investment given the loss is at least the VaR level. Both statistics are widely used by institutions like commercial banks and hedge funds to evaluate market risk and portfolio losses. An example is for a mortgage company to estimate the probability a user defaults on a loan. It follows the same procedures to apply these metrics on a personal account level.

To find VaR, we first specify a probability, also known as a risk level (red area), then find the quantile up to which the probability covers from the left tail of the distribution. For example, using the Double Exponential curve selected above, we can conclude there is a 10% probability that an investment in Apple’s stock will incur a loss of at least 3.77% (-3.84% log return). Apple’s ES is the average amount at risk, given that its risk exposure is at least 3.77%. This amount is computed via Monte Carlo simulation, with at least 5000 samples generated from the Double Exponential distribution. The idea is that as sample size increases, we expect the distribution of the sampled log returns to converge to a Double Exponential distribution. We will not show the simulation here, but based on the result, ES turns out to be 4.02% (-4.1% log return) of the portfolio, with left-tailed probability of 5% (darker blue area). Hence, we conclude that given our loss is at least 3.77%, we expect to lose an average of 4.02% on our portfolio. In other words, if we invest $10000 in Apple’s stock, when our portfolio hits a $377 loss mark, we can expect for it to lose (4.02% – 3.77%) * 10000 = $25 more on average.

What then?

Obtaining VaR and ES allow investors to size in and out of an asset position with calculated risk expectations. For example, if you invested 10 shares of Apple’s stock with $150 per share, it would be reasonable to set aside at least ($150*10) * 3.77% = $56.55 and ($150*10) * 4.02% = $60.3 on average to account for the downside risk with 10% occurrence probability.

References: 

Link to VaR Definition

About The Author

John Lee is a research statistician, an independent trader of stocks and options, and a lecturer at the University of Chicago. As a knowledge-driven entrepreneur, his goal is to help learners of all backgrounds develop technical skills to steer them toward financial success.

You Might Also Like

Submit Your Comment

Blog Comment Form