[R] R strucchange question: recursive-based CUSUM
Julia Bondarenko
bonda at hsuhh.de
Mon Nov 2 09:48:56 CET 2009
Achim Zeileis wrote:
> Julia:
>
>> I'm trying now to apply the package strucchange to see whether there
>> is a structural change in linear regression. I have noted the
>> following problem that arises in my case with recursive-based CUSUM:
>> generic function recresid() in efp() generates an error, since
>> (probably) it cannot compute the inverse matrix of
>> (X^(i-1)^T)*(X^(i-1)) at each step (i-1), because the matrix
>> (X^(i-1)^T)*(X^(i-1)) does not have full rank for all i (X consists
>> of dummy variables). Does any solution of this problem exist (for
>> example, to replace the ordinary inverse by the generalised inverse,
>> ginv())?
>
> The 1-step-ahead prediction error is well-defined even if there are
> rank deficiencies. For example, using lm.fit() will automatically
> alias coefficients that are not identified. The reason why recresid()
> doesn't use this is that it employs a more efficient updating algorithm.
>
> If you need to investigate the recursive CUSUM test, you could hack
> recresid() and use the slower but more robust implementation based on
> lm.fit().
>
> Personally, however, I would recommend to use a different test. In
> most situations (unless the break occurs very early in the sample),
> there are more powerful methods than the recursive CUSUM test.
>
> hth,
> Z
>
Thanks a lot for detailed answer, I'll try to implement this in
Rec-CUSUM () (and other tests as well).
MfG,
Julia
More information about the R-help
mailing list