[R] CUSUM SQUARED structural breaks approach?

Rick Ram r.ramyar at gmail.com
Tue Jan 11 20:33:41 CET 2005


On Tue, 11 Jan 2005 15:10:32 +0100, Achim Zeileis
<Achim.Zeileis at wu-wien.ac.at> wrote:
> On Tue, 11 Jan 2005 13:10:51 +0000 Rick Ram wrote:
> 
> > Dear all,
> >
> > Does anyone know where there is R or S code for the CUSUM SQUARED
> > structural breaks approach?   (Brown, Durban and Evans, 1975 - used in
> > Pesaran and Timmerman, 2002)
> 
> Not to my knowledge.
> 
> > The problem is that the breaks package
> 
> I guess you're referring to the strucchange package. There is no package
> breaks, at least not on CRAN.

Yes, sorry... a miscitation :)

> 
> > only appears to offer the
> > standard 'unsquared' CUSUM, even though it appears most think it is
> > inferior to the squared version.
> 
> Yes, it's part of the folklore that one should use the CUSUM of squares
> rather than the CUSUM test. However, in many scenarios one wouldn't want
> to use either test. The BDE CUSUM test is good when you want to know
> when 1-step ahead predictions start to break down (and that works only
> if the break occurs early in the sample period). The CUSUM of squares
> test is more appropriate if you want to detect changes in the variance
> (rather than the conditional mean).
> For both problems (breaks in the mean / breaks in the variance) there
> are other tests which are usually more appropriate than the BDE CUSUM or
> CUSUM of squares test which is why I haven't implemented the latter.
> (But, of course, no test can be uniformly superior due to the vast
> alternative.)

Groundwork for the choice of break method in my specific application
has already been done - otherwise I would need to rework the wheel
(make a horribly detailed comparison of performance of break
approaches in context of modelling post break)

If it interests you, Pesaran & Timmerman 2002 compared CUSUM Squared,
BaiPerron and a time varying approach to detect singular previous
breaks in reverse ordered financial time series so as to update a
forecasting model.  I am building on the modelling aspect of it,
rather than breaks side, and have to assume their break model
conclusions are sound for econometric forecasting.

> 
> > It might appear to be a relatively
> > simple problem - just use the recursive residuals function, square
> > them and then take the cumulative sum.  But the problem is that the
> > normalisation and calculation of confidence levels is completely
> > different.
> 
> Yes. Computing the CUSUM of square process is straightforward using the
> recresid() methods. To obtain critical values, you will either have to
> simulate them or use the tabulated values referenced in BDE from Durbin
> (1969).

I had managed a basic cumulative sum of squared residuals as follows,
very simple:

rr <- (recresid(US.PT2002.lm, data=US[end:start,]))
rr <- rr^2
cumrr <- cumsum(rr)
plot(cumrr, type = "l")

This works "fine" i.e. the plot looks correct.  The problem is how to
appropriately normalise these to rescale them to what the CUSUM
squared procedure expects (this looks to be a different and more
complicated procedure than the normalisation used for the basic
CUSUM).  I am from an IT background and am slightly illiterate in
terms of math notation... guidance from anyone would be appreciated

Does anyone know if this represents some commonly performed type of
normalisation than exists in another function??

I will hunt out the 1969 paper for the critical values but prior to
doing this I am a bit confused as to how they will
implemented/interpreted... the CUSUM squared plot does/should run
diagonally up from left to right and there are two straight lines that
one would put around this from the critical values.  Hence, a
different interpretation/implementation of confidence levels than in
other contexts.  I realise this is not just a R thing but a problem
with my theoretical background.


Thanks for detailed reply!

Rick.


> 
> But depending on the model and hypothesis you want to test, another
> technique than CUSUM of squares might be more appropriate and also
> available in strucchange.

> 
> hth,
> Z
> 
> > Any help or pointers about where to look would be more than
> > appreciated!  Hopefully I have just missed obvious something in the
> > package...
> >
> > Many thanks,
> >
> > Rick R.
> > 
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> > http://www.R-project.org/posting-guide.html
> >
>




More information about the R-help mailing list