Exercise

Breaking down the financial crisis

In the video you saw the efficient frontier for the portfolio of investment banks over the entire period 2005 - 2010, which includes time before, during and after the global financial crisis.

Here you'll break down this period into three sub-periods, or epochs: 2005-2006 (before), 2007-2008 (during) and 2009-2010 (after). For each period you'll compute the efficient covariance matrix, and compare them to each other.

The portfolio's prices for 2005 - 2010 are available in your workspace, as is the CovarianceShrinkage object from PyPortfolioOpt.

Instructions

100 XP
  • Create a dictionary epochs: its keys are the sub-periods, and its values are dictionaries of 'start' and 'end' dates.
  • For each of the sub-period keys in epochs, set sub_price to the range of prices for that sub-period.
  • Use sub_price and the CovarianceShrinkage object to find an efficient covariance matrix for each sub-period.
  • Print and compare the resulting efficient covariance matrices for all three sub-periods.