1. Learn
  2. /
  3. Courses
  4. /
  5. Quantitative Risk Management in Python

Exercise

Crisis structural break: II

The video identified a structural break for a simple relationship between population size and time in China. In this and the following exercise you'll use the richer factor model relationship between portfolio returns and mortgage delinquencies from Chapter 1 to test for a structural break around 2008, by computing the Chow test statistic for the factor model.

First, after importing the statsmodels API, you'll run an OLS regression for 2005 - 2010, with quarterly minimum returns port_q_min as the dependent variable, and mortgage delinquencies mort_del as the independent variable (plus an intercept term).

Take note of the sum of squared residuals ssr_total from the regression result (this will be provided in the next exercise to help derive the Chow test statistic).

Instructions

100 XP
  • Import the statsmodels API.
  • Add an intercept term to the regression.
  • Use OLS to fit port_q_min to mort_del.
  • Extract and display the sum-of-squared residuals.