DPredict · Guide test 236
Quandt likelihood ratio or sup F test
Tests for an unknown regression breakpoint by taking the largest eligible break statistic.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Structural change in a regression — Did the relationship between the outcome and its predictors change over time — at a known date, at an unknown date, or gradually?
In Structural change in a regression, choose Test = sup-F (Quandt / Andrews).
Do it in CodeSplash Run this test on your own data, in Python or R.
Bench
Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.
Bench · Quandt likelihood ratio (sup-F) test
Adds curve × (x − 5)².
Error SD grows like exp(h · (x − 5)/5).
Errors in collection order carry φ × the previous error.
Your data
Simulated with a known ρIf H₀ were true
- The reference: how sup F varies across samples when H₀ is true, simulated with these x: 499 sets of N(0, 1) errors (Monte Carlo with the regressors held fixed (499 draws on the shared stream)).
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .010).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- the Chow statistic for a break after row k on the χ² (Wald) scale: p times Chow's F, as strucchange's Fstats reports it; p is the number of coefficients
- trimming: no break in the first or last 15%
- the maximum over candidate breaks, so the null is simulated, not F
The verdict
sup F = 15.83, p = .010
p ≤ α = .050: reject H₀
Use when the break date is unknown; plain Chow at the best-looking date rejects far too often. The located date is an estimate with its own uncertainty.
- Statistic
- 15.831
- p-value
- 0.0100
Quandt likelihood ratio (sup-F) test on 40 (x, y) pairs: sup F = 15.83, p = .010. The p-value is below α = .050, so the data are hard to reconcile with H₀.
Question and hypotheses
H0: regression parameters remain constant; H1: one break at an unknown point.
Assumptions
Stable model under H0; enough observations in each segment; prespecified trimming; suitable error dependence/covariance treatment.
Formula
Parameters and notation
F(τ) is a Chow-type joint coefficient test at candidate τ; T excludes poorly estimable endpoints.
Structure of the method
Fit split-specific regression comparisons over a trimmed candidate interval and take the supremum of their joint instability statistics. The overall statistic incorporates a search over break dates; candidatewise p values and the maximized test’s p value are distinct quantities.
Estimated and nuisance parameters
Estimate pooled and split-specific coefficients and covariance/variance terms, plus a candidate break argmax. Software may label a chi-square-scaled Wald/F process as Fstats: its numeric normalization can differ from the textbook F ratio by the number of tested restrictions. Use its matching supremum calibration.
Settings and design choices
Choose trimming fractions, covariates, coefficient subset, covariance estimator, ordering, and one-break interpretation. Heavier trimming improves segment estimability but excludes endpoint changes. Expanding the search or trying several trimming choices creates additional selection unless the calibration includes that broader procedure.
Fitting and adaptation
Refit all candidate models when controls, ordering, or sample change. A bootstrap must repeat the complete scan under a model-valid null, including any selected lag/model settings that are part of the procedure. Structural break detection and post-break parameter estimation should be reported separately with their respective uncertainty.
Sensitivity and robustness
Check time dependence, variance shifts, leverage, multiple breaks, and near-singular endpoint models. A single ordinary F reference cannot calibrate a maximum. The strucchange implementation supplies its own process normalization and asymptotic p-value method; manually substituting textbook thresholds risks a scale mismatch.
How to use and calibrate
Use supF/Quandt–Andrews critical values or a bootstrap repeating the full breakpoint search.
Example application
Detect an unknown change in a regression relationship.
Interpretation and pitfalls
Watch out
The largest ordinary F statistic cannot be evaluated using a single fixed-break F distribution.
What changed in edition 2
- New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.
- Rewritten in the review: parameters and notation.
Parameters and notationsearch.r-project.org
The official Fstats manual documents the distinction between its chi-square-scaled process and a textbook F ratio.
Corrected text
F(τ) denotes a specified Chow/Wald-type joint coefficient instability statistic at candidate τ; the candidate set excludes poorly estimable endpoints. Match its normalization to the supremum reference. In strucchange::Fstats the process is chi-square-scaled: dividing its statistic by the number of tested regression coefficients gives the textbook fixed-split F ratio. The supplied sctest(Fstats(...),type="supF") uses its own matching calibration.
Python and R
Chow fixes a breakpoint at observation 50; supF searches the trimmed range and uses search-adjusted calibration. CUSUM/MOSUM/score fluctuation tests assess parameter constancy in observation order; MOSUM h is window fraction.
Not run — Executed end to end through Rscript · needs Python standard library + Rscript; R packages: strucchange
# Python launcher for the complete R implementation below.
# Requires Rscript on PATH and the listed R packages.
import shutil
import subprocess
rscript = shutil.which("Rscript")
if rscript is None:
raise RuntimeError("Install R and make Rscript available on PATH.")
r_code = r"""
set.seed(2026)
n <- 100; x <- rnorm(n); z <- rnorm(n); y <- 1+.5*x+.3*z+rnorm(n)
d <- data.frame(y,x,z); fit <- lm(y~x+z,data=d); reduced <- lm(y~x,data=d)
print(strucchange::sctest(strucchange::Fstats(y~x,data=d,from=.15,to=.85),type="supF"))
"""
# No shell interpolation. A failed R execution raises an error in Python.
result = subprocess.run([rscript, "--vanilla", "-"], input=r_code,
text=True, capture_output=True)
print(result.stdout)
if result.stderr:
print(result.stderr)
result.check_returncode()
Validated — Executed successfully in the validation environment · needs strucchange
set.seed(2026)
n <- 100; x <- rnorm(n); z <- rnorm(n); y <- 1+.5*x+.3*z+rnorm(n)
d <- data.frame(y,x,z); fit <- lm(y~x+z,data=d); reduced <- lm(y~x,data=d)
print(strucchange::sctest(strucchange::Fstats(y~x,data=d,from=.15,to=.85),type="supF"))
Output
supF test data: strucchange::Fstats(y ~ x, data = d, from = 0.15, to = 0.85) sup.F = 4.7526, p-value = 0.5993
Sources
- strucchange — strucchange · FstatsAuthor documentation/source reviewed: strucchange 1.6-0.search.r-project.org
- Fstatssearch.r-project.org
- sctestsearch.r-project.org
- Statistics guide v4 (historical):
- Python: Executed end to end through Rscript · R: Executed successfully in the validation environment
- Reference's record:
- Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Python-to-R bridge; Rscript is unavailable. R code was not executed. Python: Not run in the reference's review: Python-to-R bridge; Rscript is unavailable. R code was not executed. R: Reviewed but not run: R wasn't available to the reference's authors.
From the CodeSplash statistics guide (v4), entry 236, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT236.