ClarkWestTest#

class cultivars.forecast.comparison.ClarkWestTest(*, statistic, pvalue, horizon, nobs, adjusted_differential, mspe_restricted, mspe_unrestricted)[source]#

Verdict of the Clark-West (2007) test that a nesting model forecasts better.

The one-sided alternative is that the larger model improves on the smaller; under the null the smaller model is true and the larger one’s extra parameters only add estimation noise, which the statistic removes before testing. With \(e_{r,t}\) and \(e_{u,t}\) the restricted and unrestricted forecast errors and \(\hat y_{r,t}\), \(\hat y_{u,t}\) the forecasts, the adjusted loss differential

\[\hat f_t = e_{r,t}^2 - \bigl[e_{u,t}^2 - (\hat y_{r,t} - \hat y_{u,t})^2\bigr]\]

adds back the squared forecast gap that the larger model’s noise costs it under the null, and the statistic is the \(t\)-ratio of its mean against a Bartlett long-run variance through \(h - 1\) lags, read against the upper tail of the standard normal. A rejection says the added structure has predictive content; a non-rejection says it has not shown any on this window.

Variables:
  • statistic – The adjusted-MSPE t-type statistic.

  • pvalue – Its upper-tail standard normal p-value.

  • adjusted_differential – Mean of the adjusted loss differential, e_r**2 - e_u**2 + (f_r - f_u)**2; positive favors the larger model.

  • mspe_restricted – Mean squared prediction error of the smaller model.

  • mspe_unrestricted – Mean squared prediction error of the larger model.

  • horizon – Forecast horizon behind the series.

  • nobs – Evaluation origins.

Note

The raw MSPE difference can favor the smaller model while the test still rejects, and often does: under the null the larger model’s MSPE is inflated by parameter noise, so an unadjusted Diebold-Mariano comparison of nested forecasts is biased toward the nested model and its limit distribution is not normal (Clark & McCracken, 2001). The adjustment is what makes the normal reference usable.

See also

References

Clark, T. E., & West, K. D. (2007). Approximately normal tests for equal predictive accuracy in nested models. Journal of Econometrics, 138(1), 291-311.

Clark, T. E., & McCracken, M. W. (2001). Tests of equal forecast accuracy and encompassing for nested models. Journal of Econometrics, 105(1), 85-110.

Example

A predictor with real content against the no-change forecast it nests:

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> x = rng.standard_normal(200)
>>> y = 0.5 * x + rng.standard_normal(200)
>>> verdict = clark_west(y, np.zeros(200), 0.5 * x)
>>> verdict
ClarkWestTest(statistic=5.0456, pvalue=2.26e-07, horizon=1, nobs=200)
>>> bool(verdict.reject()), round(verdict.adjusted_differential, 3)
(True, 0.397)
>>> round(verdict.mspe_restricted, 3), round(verdict.mspe_unrestricted, 3)
(1.225, 1.059)

Attributes#

adjusted_differential

Mean of \(\hat f_t\), the MSPE gap with the larger model's noise added back.

mspe_restricted

Mean squared prediction error of the nested (smaller) model.

mspe_unrestricted

Mean squared prediction error of the nesting (larger) model.

horizon

nobs

pvalue

statistic

Methods#

reject(*[, alpha])

Whether the null is rejected at level alpha.

summary()

The test as a table, renderable as text, HTML, or a dataframe.