VaR based on sorted historical returns
We know that stock returns do not necessarily follow a normal distribution. An alternative is to use sorted returns to evaluate a VaR. This method is called VaR based on historical returns. Assume that we have a daily return vector called ret. We sort it from the smallest to the highest. Let's call the sorted return vector sorted_ret. For a given confidence level, the one-period VaR is given here:
Here, position is our wealth (value of our portfolio), confidence is the confidence level and n is the number of returns. The len()
function shows the number of observations and the int()
function takes the integer part of an input value. For example, if the length of the return vector is 200 and the confidence level is 99%, then the second value (200*0.01) of the sorted returns, from the smallest to the highest, times our wealth, will be our VaR. Obviously, if we have a longer time series, that is, more return observations, our final VaR would be more accurate...