Changing VaR and CVaR quantiles
VaR quantiles often used are 90%, 95%, and 99%, corresponding to the worst 10%, 5%, and 1% of cases respectively. These same quantiles are also often used for CVaR. Note that CVaR will always be a more extreme estimate when compared with VaR for the same quantile.
Compare the VaR vs CVaR values for USO ETF returns below.
Returns data is available (in percent) in StockReturns_perc. We also calculated var_95, cvar_95, var_99, cvar_99 and defined a function plot_hist() that compares several quantiles for you.
Cet exercice fait partie du cours
Introduction to Portfolio Risk Management in Python
Instructions
- Calculate the VaR(90) for
StockReturns_percand save the result invar_90. - Calculate the CVaR(90) for
StockReturns_percand save the result incvar_90.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Historical VaR(90) quantiles
var_90 = ____(StockReturns_perc, ____)
print(var_90)
# Historical CVaR(90) quantiles
cvar_90 = ____
print(cvar_90)
# Plot to compare
plot_hist()