Skip to content
Prev 274514 / 398506 Next

strucchange Nyblom-Hansen Test?

On Fri, 14 Oct 2011, buehlerman wrote:

            
To understand what exactly is tested, it may help to decompose this into 
the steps (1) model fitting, (2) process setup, (3) test statistic 
computation.

m <- lm(Employed ~ Year + GNP.deflator + GNP + Armed.Forces,
   data = longley)
p <- gefp(m, fit = NULL)
sctest(p, functional = meanL2BB)

To see which parameters are assessed you can look at

estfun(m)

or the corresponding fluctuation process

plot(p, aggregate = FALSE)

both of which have one column per parameter. The visualization for the 
Nyblom-Hansen test statistic

plot(p, functional = meanL2BB)

does not show the individual processes because you first aggregate across 
parameters using the squared Euclidian norm (before taking its mean).
The original Nyblom suggestion was for ML estimation of a distribution 
with one parameter (without covariates). Hansen extended this to the 
linear regression model and proposed to either compute one test statistic 
per parameter (which you can do with the "parm" argument of gefp) or a 
joint statistic for all parameters. Hansen included in "all" parameters 
also the variance, but the idea can be directly modified to any other 
model with a vector of parameters.

The reason that estfun(lm_object) does not include the variance is that 
coef(lm_object) and vcov(lm_object) etc. also do not include it. So it is 
the conceptual question whether lm() computes the OLS estimator or the 
full ML estimator. The normlm() wrapper on the ?DJIA man page is one 
possibility to switch to the ML view for the purposes of using 
"strucchange".

hth,
Z