In what follows, we work out an exercise on value-at-risk with normally distributed returns that is largely inspired by Carol Alexander‘s Market Risk Analysis, Value at Risk Models (Vol. IV) . Just as it was the case in a recent post, all the interest here lies in the use of C++/Boost.
Exercise: “What is the 10% VaR over a 1-year horizon of $3,5 million invested in a fund whose annual returns in excess of the risk free rate are assumed to be normally distributed with mean 7% and volatility 14%?”
One main point is here is computing the inverse normal distribution. We thus resort on the Boost quantile function.
The compiler should return a -0109417 value (with no surprise a negative value is returned).
Checking this result with R is straightforward:
Put in words, the 10% 1-year Var is 10,94% of the portfolio value. With $3,5 million invested the VaR then is $3,5 x 0,1094 = $382 900. According to our calculations, we are 90% confident that the investor will lose no more than $382 900 over the next year.