Title

ffrals methods -- Formulas for the flexible-Fourier RALS LM test

Flexible-Fourier LM detrending

For a Fourier frequency k the deterministic component is z_t =
(t, sin(2pi k t/T), cos(2pi k t/T)). The LM score series is

S_t = y_t - psi - z_t' delta,

where delta is estimated from the first-differenced regression of Dy_t
on Dz_t and psi = y_1 - Dz_1' delta. The augmented LM
regression at lag p is

Dy_t = phi S_(t-1) + c + a' Dz_t + sum_j b_j D y_(t-j)
+ e_t,

and the statistic is the t-ratio on phi. The frequency k is chosen
to minimise the residual sum of squares over 1..fmax; the lag p by AIC,
BIC or the general-to-specific t-rule.

RALS augmentation

Let e_t be the residuals of the LM regression and m2, m3 the sample
second and third moments. The RALS terms are

w_t = ( e_t^2 - m2 , e_t^3 - m3 - 3 m2 e_t ),

which capture the information in the non-normality of the errors. The augmented
regression adds w_t (RALS, rals(1)) and, for rals(2), the supplied
common and group factors:

Dy_t = phi S_(t-1) + c + a' Dz_t + sum_j b_j Dy_(t-j)
+ g' w_t ( + h' F_t ) + e_t.

The RALS statistic is the t-ratio on phi in the augmented regression and

rho-squared = sigma^2(augmented) / sigma^2(unaugmented),

the variance ratio that governs the (mixture) null distribution.

Monte-Carlo p-value

Under the null the flexible-Fourier LM statistic converges to a functional of a
detrended Brownian motion, D_k, that depends only on the frequency k and
sample size T. ffrals simulates D_k by generating nsim random
walks of length T and computing the LM0 statistic of each. For the plain test
the p-value is the fraction of the simulated D_k not exceeding the observed
statistic. For the RALS test the null is the mixture

sqrt(rho2) D_k + sqrt(1 - rho2) Z, Z ~ N(0,1),

and the p-value is the fraction of this simulated mixture below the observed
statistic. This reproduces the construction of the source GAUSS routines; only the
random draws (hence a small simulation error) differ.

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

github.com/merwanroudane