CommencerCommencer gratuitement

Block maxima

Until now you've worked with a portfolio of four investment banks for the period 2005 - 2010. Now you'll zero in on a single asset, the stock of General Electric, for the same period and apply extreme value theory to its time series.

In this exercise, you'll examine the time series of block maxima for GE's losses over the period 2008 - 2009, using the .resample() method for three different block lengths: one week, one month, and one quarter, visualizing each series in a plot using the axis_* plot objects.

Cet exercice fait partie du cours

Quantitative Risk Management in Python

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Resample the data into weekly blocks
weekly_maxima = losses.____("W").____()

# Plot the resulting weekly maxima
axis_1.plot(____, label = "Weekly Maxima")
axis_1.legend()
plt.figure("weekly")
plt.show()
Modifier et exécuter le code