Re: [R] Problem with strucchange package

From: Achim Zeileis <>
Date: Wed, 02 Jul 2008 21:56:20 +0200 (CEST)

On Wed, 2 Jul 2008, wrote:

> Dear R Users,
> I am attempting to use the strucchange package but get an error which is
> difficult to decipher.
> I get the following error with breakpoints:
>> bp<-breakpoints(regr[,1]~regr[,2]+regr[,3])
> Error in my.RSS.table[as.character(i), 3:4] <- c(pot.index[opt],
> break.RSS[opt]) :
> nothing to replace with

I've seen this happening when something about the data formatting was not right. Maybe it is because of:

> regr is a zoo object with three columns.

Unfortunately, breakpoints() does not yet support "zoo" objects. This has been on my todo list for some time but it's still not there. The recommended workaround is to store the time index elsewhere and query that separately, e.g.,

## separate data
mydata <-
mytime <- time(regr)

## call breakpoints (assuming that y, x1, x2 are the column names of regr) bp <- breakpoints(y ~ x1 + x2, data = mydata)

## query breakpoints
## plot...etc.

## match with time index

Hopefully that solves your problem. Depending on the size of your data set, it might also help to set "h" to a more reasonable value than the default in breakpoints().


> Happy to provide all the data so
> one can replicate this but it is lengthy so I am posting this way in case
> this is a common issue.
> This is on R version 2.7.0, strucchange 1.2-3 and zoo 1.5-3.
> Thanks in advance,
> Tolga
> Generally, this communication is for informational purposes only
> and it is not intended as an offer or solicitation for the purchase
> or sale of any financial instrument or as an official confirmation
> of any transaction. In the event you are receiving the offering
> materials attached below related to your interest in hedge funds or
> private equity, this communication may be intended as an offer or
> solicitation for the purchase or sale of such fund(s). All market
> prices, data and other information are not warranted as to
> completeness or accuracy and are subject to change without notice.
> Any comments or statements made herein do not necessarily reflect
> those of JPMorgan Chase & Co., its subsidiaries and affiliates.
> This transmission may contain information that is privileged,
> confidential, legally privileged, and/or exempt from disclosure
> under applicable law. If you are not the intended recipient, you
> are hereby notified that any disclosure, copying, distribution, or
> use of the information contained herein (including any reliance
> thereon) is STRICTLY PROHIBITED. Although this transmission and any
> attachments are believed to be free of any virus or other defect
> that might affect any computer system into which it is received and
> opened, it is the responsibility of the recipient to ensure that it
> is virus free and no responsibility is accepted by JPMorgan Chase &
> Co., its subsidiaries and affiliates, as applicable, for any loss
> or damage arising in any way from its use. If you received this
> transmission in error, please immediately contact the sender and
> destroy the material in its entirety, whether in electronic or hard
> copy format. Thank you.
> Please refer to for
> disclosures relating to UK legal entities.
> [[alternative HTML version deleted]]
> ______________________________________________
> mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
> mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 02 Jul 2008 - 19:58:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Jul 2008 - 12:31:12 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive