Chow-Dickey-Fuller Test

Calculate the Chow-type Dickey-Fuller test for a switch from a random walk to explosive behaviour at an unknown date, per asset (López de Prado, 2018, section 17.3.3; Homm and Breitung, 2012).

The regression lets the log prices follow a random walk up to a break date and an explosive process after it, and the statistic is the t-statistic of the explosive coefficient. Every date in the middle of the sample is tried as the break; the largest statistic (SDFC) is compared with critical values simulated under a random walk, and its date is the most likely start of the explosive regime. Unlike the Chow test of get_chow_test, which tests a known break in the coefficients of a regression, the break date is unknown and the alternative is a bubble.

The formula is as follows, with \(y_{t}\) the log of the column (Adj Close by default) minus its first value, so the test does not depend on the level of the prices:

\[\Delta y_{t} = \delta \cdot y_{t-1} \cdot D_{t}(\tau) + \epsilon_{t},\;\; D_{t}(\tau) = 1 \;\text{after the break date}\; \tau \;\text{and 0 up to it}\] \[\operatorname{DFC}(\tau) = \frac{\hat{\delta}}{\operatorname{SE}(\hat{\delta})},\;\; \text{with SE from the residuals of all}\; T - 1 \;\text{changes}\] \[\text{SDFC} = \max \;\text{over}\; \tau \;\text{from} \;\left\lfloor \text{trim} \cdot T \right\rfloor \;\text{to}\; T - 1 - \left\lfloor \text{trim} \cdot T \right\rfloor \;\text{of DFC}(\tau),\;\; \text{the supremum over the break dates of Andrews (1993)}\]
  • Critical values and the p-value from simulations Gaussian random walks of the same length started at zero

The book writes the regression on the log prices as they are; here their first value is subtracted, so the statistic does not change with the price level.

Also known as: DFC, SDFC, Chow-type Dickey-Fuller, sup DFC, Homm-Breitung test, explosive break test.

Example · NVDA, KO · 2016 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_chow_dickey_fuller_test:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["NVDA", "KO"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2016-01-01",
    end_date="2025-12-31",
)

toolkit.econometrics.get_chow_dickey_fuller_test()

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

Did the share prices of Nvidia and Coca-Cola switch from a random walk to explosive growth at some date from 2016 to 2025, according to the Chow-type Dickey-Fuller test?

Which returns:

Using Your Own Data

get_chow_dickey_fuller_test runs on any data, not only prices: ratios, economic indicators, yield curves or your own dataset. Pass a DataFrame, a Series or a dictionary of them to Econometrics as data, with the dates in the rows or the columns, and set changes to how its changes are calculated: "percentage", "log", "difference" for rates and ratios, or None when the data are changes already. For example, for the monthly unemployment rates of the United States and Germany:

from financetoolkit import Economics, Econometrics

economics = Economics(start_date="2000-01-01")

unemployment = economics.get_unemployment_rate(
    countries=["United States", "Germany"], period="monthly"
)

econometrics = Econometrics(data=unemployment, changes="difference")

econometrics.get_chow_dickey_fuller_test()

Parameters

get_chow_dickey_fuller_test accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe data frequency (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”."weekly"
columnstrThe historical data column to test. Defaults to “Adj Close”."Return"
trimfloatThe share of observations at either end that is not tried as the break date. Defaults to 0.15.0.1
simulationsintThe number of simulated random walks for the critical values. Defaults to 1000.1000
seedintThe seed of the simulation. Defaults to 0.42
log_pricesboolWhether to take the natural logarithm of the series first. Pass False for a series that can be zero or negative, such as a rate. Defaults to True.True
time_seriesboolWhether to return \(\text{DFC} (\tau)\) per break date instead of the test. Defaults to False.False
include_benchmarkboolWhether to include “Benchmark” among the assets. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

  • Paper Homm, U. and Breitung, J. (2012). “Testing for Speculative Bubbles in Stock Markets: A Comparison of Alternative Methods.” Journal of Financial Econometrics, 10(1), 198-231.
  • Paper Andrews, D.W.K. (1993). “Tests for Parameter Instability and Structural Change With Unknown Change Point.” Econometrica, 61(4), 821-856.
  • Paper López de Prado, M. (2018). “Advances in Financial Machine Learning.” Wiley, section 17.4.1.
Share