Re: [R] time series and regions of change

From: Achim Zeileis <Achim.Zeileis_at_wu-wien.ac.at>
Date: Sat 23 Jul 2005 - 05:21:44 EST

On Fri, 22 Jul 2005 14:46:31 -0400 Sean Davis wrote:

> Preface: this is a statistical question more than an R question.
>
> I have a vector of numbers (assume a regular time series). Within
> this time series, I have a set of regions of interest (all of
> different lengths) that I want to compare against a "baseline" (which
> is known). There is some autocorrelation involved. I would like to
> determine the "significance" of the regions as judged by their length
> and relative height from the baseline. I could do a simple t-test or
> something like that, but this seems to be too sensitive (probably due
> to dependency between adjacent observations). I have thought about
> Hidden Markov Models, but I don't know the number of states. Any
> other ideas?

If the regions of interest are known (i.e., not determined in some way from the data), then you could use a simple ANOVA using a covariance matrix estimate that is robust to serial correlation. The package sandwich provides such estimators (e.g., vcovHAC and kernHAC) that can be plugged into the function waldtest() in the package lmtest. This corresponds to conduncting an anova() with a different covariance matrix estimate. See the sandwich vignette for some examples.

If the regions of interest are unknown and have to be estimated, the function breakpoints() in package strucchange might be useful. See help(breakpoints) for some examples and further references.

hth,
Z

> Thanks,
> Sean
>
> ______________________________________________
> R-help@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
>



R-help@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 Received on Sat Jul 23 05:33:39 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:57 EST