How to Find a Portfolio’s Value at Risk
By: Roman Paolucci
Tags: Economics, Business, Artificial Intelligence, Finance, Python

Value at Risk (VaR)

What is meant by Value at Risk? VaR is stated in terms of a percentage, timeframe, and loss.

Consider a $1,000,000 portfolio, disregarding the computation VaR can be stated as the following…

The 99% 1-year Value at Risk is $200,000

This is how VaR is stated, we can interpret this as the following: we are 99% sure that within 1-year the maximum loss of the portfolio will not exceed $200,000. Simple enough, right? Consider when VaR is stated as follows…

The 99% 1-year Value at Risk is -$10,000

In this case, the loss is negative, which implies a gain: we are 99% sure that within 1-year the maximum loss of the portfolio will be a gain of $10,000.

Before looking at the actual computation of VaR, it's important — vital — to understand the underlying assumptions we will be using to compute it in this article. Without a proper understanding of these assumptions, the VaR of a portfolio in practice can be computed extremely incorrectly.

Strong Assumptions:

Normal distribution of portfolio returns with a mean of zero

Daily gains/losses are independently and identically distributed

Why is it important to recognize these assumptions? Because in practice, portfolio returns (generally) are not normally distributed, and gains/losses are not independent (correlation exists). This is nothing new to finance, academic, and professional financial models generally all rely on some underlying assumptions — some are in fact very far from reality. Nevertheless, theoretical computations do serve a purpose. In the context of option valuation consider the Black-Scholes model. Some of the model’s main underlying assumptions are no arbitrage, no transaction costs, and lognormally distributed returns. All of which are false or have been empirically proven false. Still, the theoretical value of the option has a lot of meaning to traders in determining whether or not an option is over/under valued and how the value will change when market conditions change.

Computation

To calculate the VaR we need an asset or investment portfolio’s mean and standard deviation. There are several ways to find these moments, personally, I prefer to find the historic mean and standard deviation for the timeframe I am looking forward to. For example, if I am trying to calculate the one-year VaR for a portfolio, I would calculate the one-year historic return and standard deviation. The actual computation is extremely easy. First, compute the mean and standard deviation of an asset or investment portfolio. Second, compute the critical value for your confidence level and multiply by the standard deviation of the asset or investment portfolio. This value is your VaR!

If there is any confusion in the computation for VaR, the Python implementation will make it even easier to understand…

Python Implementation

The implementation in Python is incredibly simple and can be done in almost one step using numpy’s ppf function.

Note: I am assuming that this is a single period VaR, this makes the square root term the multiplicative identity

Using the function defined above we can compute the value at risk for a variety of different confidence levels…

95% One-Year Value at Risk, $3312.13 97.5% One-Year Value at Risk, $4099.91 99% One-Year Value at Risk, $5015.87

Also, Read