Title

covstat methods -- Methods and formulas for covstat

Model and hypothesis

The data-generating process is yt = Xt'b + rt + et,
rt = rt-1 + ut, with Xt=1 (level) or Xt=[1,t]
(trend). Under H0 the variance of ut is zero, so yt is stationary;
the alternative is a unit root. Tests reject for large values.

RALS covariates (eq. 3)

Let et be the OLS residuals of y on X, mk the k-th sample moment
of e. The RALS terms are

wt = [ et2 - m2 , et3 - m3 - 3 m2 et ]'.

They follow the updated error phikt = etk - mk -
k mk-1 et and satisfy the two conditions for valid stationary
covariates (Hansen 1995): E(phi e) 0 but E(phi X) = 0. Under normality the
second term is redundant (m4=3 sigma4), so no power is lost.

Jansson statistics

Write V-hat for the residuals of (y, w) on their deterministic terms, and let
OMEGA be the long-run covariance of V-hat, partitioned into y and x blocks with
OMEGAyy.x the conditional variance. With a GLS-detrending parameter
lambda-bar (7 for the constant, 12 for the trend model):

Benchmark (no covariates): Ly_T = S'S / OMEGAyy where
S = cumsum(V-haty)/T; Qy_T is the point-optimal analogue with the
lambda-bar GLS transform.

Jansson-RALS: L_T and Q_T replace the univariate objects by their
covariate-conditional counterparts, built from the block moment matrices
SDD, SDz, Szz (with Kronecker structure across the covariates)
and the GLS-transformed data. Q_T = P_T - 2 lambda-bar GAMMAyy.x/OMEGAyy.x.

The signal-to-noise ratio is rho^2 = 1 - OMEGAyy.x/OMEGAyy.

Long-run covariance

By default OMEGA and GAMMA are estimated by the VAR(1)-prewhitened
quadratic-spectral kernel estimator with the Jansson (2004, p.74) plug-in
bandwidth: a VAR(1) is fitted to V-hat, its eigenvalues are capped at modulus 0.97
for stability, the QS kernel is applied to the prewhitened residuals, and the
result is recolored. The iid option sets OMEGA = SIGMA (contemporaneous
covariance) and GAMMA = 0.

Critical values and p-values

The distribution of L_T and Q_T depends on rho^2. The paper's response surfaces
give, for each significance level l and each (model, test), the critical value as
a fourth-order polynomial in z = rho^2/sqrt(1-rho^2^2). covstat ships all
999-level tables in jrals_rs.txt (verified against Table 1 of the paper) and,
following MacKinnon (1996), inverts them locally to return a p-value. Setting
rho^2 = 0 recovers the benchmark (KPSS/Jansson) critical values, used for Ly_T and
Qy_T.

Step-to-code map

computation

RALS terms w (eq. 3) Mata _jr_getrals

Ly_T, Qy_T, L_T, Q_T, rho^2 Mata _jr_jansson

VAR(1) prewhitening + QS kernel + recolor Mata _jr_jansson (prewhite branch)

response-surface p-value Mata _jr_rspval (+ _jr_readcv)

Each block reproduces the corresponding GAUSS procedure in
appl_JanssonRALS.gss; the statistics and p-values match Table 9 of the paper
(Nelson-Plosser application) to the last reported digit.

Reference

Nazlioglu, S., J. Lee, C. Karul, and Y. You. 2021. Testing for stationarity
with covariates: more powerful tests with non-normal errors. Studies in
Nonlinear Dynamics & Econometrics.

Back to covstat | flexur library