An Intuitive Explanation of VaR and Risk Reward

My Profile
5 min readMar 11, 2022

“Risk no more than you can afford to lose, and risk enough so that you won’t be trapped by the mundane.” —YJ

If you are looking for a way to quantify risk, you are at the right place! This article aims to introduce two different methodologies in calculating value at risk (VaR) by applying parametric and non-parametric methods.

Historical Method (Non-parametric)

As its name implies, historical method evaluates VaR solely based on past return of a security.

Ways to obtain VaR through historical method:

  1. Rank the returns from lowest to highest.
  2. Find the percentile correspond to the defined % from worst of returns.

The following code snippet shows an example of obtaining daily potential loss (historical VaR) of a security in 5% of the scenarios.

import numpy as np# Obtain daily returns as percentage changes
returns = dailyprice.pct_change()
# Obtain percentile value of 5 (the worst 5% of returns)
Fluctuation = np.percentile(returns, 5)
VaR = InvestmentValue * Fluctuation
Red bar indicating the worst 5% of historical returns.

Variance-Covariance Method (Parametric)

When applying parametric method, there’s two main assumptions to be aware of.

(A) Returns are normally distributed.

(B) Relationships between all securities in a portfolio can be completely described by their correlation with each other.

Ways to obtain a portfolio’s VaR through variance-covariance method:

  1. Obtain log returns for each security.
  2. Calculate portfolio’s mean return by summing up the product of mean return of each security with its respective weightage.
  3. Construct covariance matrix for all the securities in a portfolio.
  4. Calculate variance by taking matrix product of security weightage(T), covariance matrix and security weightage. This in a way take into account of the relationship and degree of parallelism between securities in a certain portfolio.

5. Calculate standard deviation by taking square root of its variance.

6. Multiply the standard deviation with a multiplier of the inverse of a standard normal distribution.

The following code snippet shows an example of obtaining daily potential loss (parametric VaR) of a portfolio with a 95% of confidence.

import numpy as np
from scipy.stats import norm
# Obtain log daily returns
log_returns = np.log(dailyprice/dailyprice.shift(1))
# Calculate portfolio's mean return
meanReturns = log_returns.mean()
portfolioMeanReturn = np.sum(meanReturns*weights)
# Construct covariance matrix
covMatrix = log_returns.cov()
# Calculate portfolio's standard deviation
portfolioStd = np.sqrt(np.dot(weights.T,np.dot(covMatrix,weights)))
Fluctuation = norm.ppf(0.95) * portfolioStd - portfolioReturn
VaR = InvestmentValue * Fluctuation
Illustration on the differences between parametric and non-parametric (historical) VaR generated from the same portfolio. Parametric approach (blue) generate VaR based on normal distribution whereas non-parametric VaR uses empirical distribution of historical returns in evaluating VaR.

Diversification in reducing Risk

All in all, value at risk are all about quantifying potential risk lies within the volatilities of securities. Is there a way to reduce the risk? Yes, its possible through diversification according to portfolio theory.

As the saying goes, don’t put all your eggs in one basket, but what exactly does it mean, and which basket should you choose to divide your eggs? Its all come down to the correlation between the securities, as measured by the variable “covariance” in our VaR calculation in earlier section.

A negative correlation or lack of parallelism between two securities can help in reducing risk from a single security alone. The benefits of diversification through adding a less correlated security into existing portfolio is documented in the below plot.

The plot shows the average annual return over two years of historical data from both an airline and an energy stock. The correlation between both stocks are calculated to be 34% which can theoretically providing moderate help in reducing the risk coming from a single stock.

It is shown that 100% of airline stock generate relatively large risk, thus a greater loss. However, with the addition of energy stock into half of the portfolio, it can be observed that the risk is significantly reduced followed by the reduction of losses as compared to the airline stock alone.

Kindly note that the below plot are generated based only on two years data. Generally, a security come with higher risk can swing either upside or downside. The significant point that can be highlighted here is that adding a less correlated stock into a portfolio can help in reducing risk level, thus bringing either higher returns or lesser losses.

Key Takeaways on using VaR

VaR shouldn’t be the only tool in your risk management pack.

The quantification of VaR from various methods all come with its own assumption. As far as assumption is made, a VaR calculated with 99% of confidence might still very far off from the actual loss that one can experience.

VaR is of different concept with cut loss.

VaR measures potential risk with a confidence level in a specified future timeframe. However, its important to note that volatility can go both way, be it downside or upside. Therefore, VaR shouldn’t be treated similar as cut loss. Investors/ traders should have their own defined cut loss within their capacity and only take VaR as a reference in determining the potential prices fluctuation level.

VaR is sensitive to historical outliers and unable to foresee future outliers.

Any outliers and huge fluctuations in the historical prices can mislead the calculation of VaR. A practical rule of thumb is that one should exclude outliers in the historical data due to ephemeral phenomenon which is already mitigated from further affecting the price fluctuation. Besides, a black swan event in the future can never be foretold by anyone, including VaR.

Thanks for reading! Cheers! ❤

--

--