CommencerCommencer gratuitement

Asset covariance and portfolio volatility

Now that you've examined the return of the portfolio of investment banks, it's time to assess the riskiness of the portfolio using the covariance matrix to determine the portfolio's volatility.

First you'll compute the covariance between the asset_returns and identify which of the banks had the highest volatility during the 2008-2009 crisis period.

Then, given the weights of an equal-weighted portfolio, you'll find the portfolio's annualized volatility for that period using portfolio_returns.

Finally, you'll use a 30-day window to create a time series of the volatility, and visualize this with a plot.

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.

# Generate the covariance matrix from portfolio asset's returns
covariance = asset_returns.____

# Annualize the covariance using 252 trading days per year
covariance = covariance * ____

# Display the covariance matrix
print(covariance)
Modifier et exécuter le code