Session Ready
Exercise

The efficient frontier and the financial crisis

Previously you examined the covariance matrix of the investment bank portfolio before, during and after the financial crisis. Now you will visualize the changes that took place in the efficient frontier, showing how the crisis created a much higher baseline risk for any given return.

Using the PyPortfolioOpt pypfopt library's Critical Line Algorithm (CLA) object, you will derive and visualize the efficient frontier during the crisis period, and add it to a scatterplot already displaying the efficient frontiers before and after the crisis.

Expected returns returns_during and the efficient covariance matrix ecov_during are available, as is the CLA object from pypfopt. (Remember that DataCamp plots can be expanded to their own window, which can increase readability.)

Instructions
100 XP
  • Create the critical line algorithm (CLA) object efficient_portfolio_during, using expected returns and the efficient covariance of returns.
  • Print the minimum variance portfolio of efficient_portfolio_during.
  • Calculate the efficient frontier of efficient_portfolio_during.
  • Add the efficient frontier results to the already displayed scatterplots of the efficient frontiers from before and after the crisis.