[R] time series and regions of change
Achim Zeileis
Achim.Zeileis at wu-wien.ac.at
Fri Jul 22 21:21:44 CEST 2005
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 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