Parameter estimation: Normal
Parameter estimation is the strongest method of VaR estimation because it assumes that the loss distribution class is known. Parameters are estimated to fit data to this distribution, and statistical inference is then made.
In this exercise, you will estimate the 95% VaR from a Normal distribution fitted to the investment bank data from 2007 - 2009. You'll use scipy.stats's norm distribution, assuming that it's the most appropriate class of distribution.
Is a Normal distribution a good fit? You'll test this with the scipy.stats.anderson Anderson-Darling test. If the test result is statistically different from zero, this indicates the data is not Normally distributed. You'll address this in the next exercise.
Portfolio losses for the 2005 - 2010 period are available.
Cet exercice fait partie du cours
Quantitative Risk Management in Python
Instructions
- Import 
normandandersonfromscipy.stats. - Fit the 
lossesdata to the Normal distribution using the.fit()method, saving the distribution parameters toparams. - Generate and display the 95% VaR estimate from the fitted distribution.
 - Test the null hypothesis of a Normal distribution on 
lossesusing the Anderson-Darling testanderson(). 
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Import the Normal distribution and skewness test from scipy.stats
from ____ import norm, anderson
# Fit portfolio losses to the Normal distribution
params = ____.fit(____)
# Compute the 95% VaR from the fitted distribution, using parameter estimates
VaR_95 = norm.____(0.95, *params)
print("VaR_95, Normal distribution: ", VaR_95)
# Test the data for Normality
print("Anderson-Darling test result: ", anderson(____))