Exercise

A Dog on a Leash? (Part 2)

To verify that Heating Oil and Natural Gas prices are cointegrated, First apply the Dickey-Fuller test separately to show they are random walks. Then apply the test to the difference, which should strongly reject the random walk hypothesis. The Heating Oil and Natural Gas prices are pre-loaded in DataFrames HO and NG.

Instructions

100 XP
  • Perform the adfuller test on HO and on NG separately, and save the results (results are a list)
    • The argument for adfuller must be a series, so you need to include the column 'Close'
    • Print just the p-value (item [1] in the list)
  • Do the same thing for the spread, again converting the units of HO, and using the column 'Close' of each DataFrame