Description Usage Arguments Value Author(s) References See Also Examples
Compute test statistic based on CUMSUM and change-point estimate
1 | cumsum.test(x, alternative = c("one.change", "epidemic"))
|
x |
a numeric vector or matrix containing the data, one row per observation; |
alternative |
a character string specifying the alternative hypothesis,
must be one of |
Sn |
test statistic |
k.hat |
estimated change-point |
m.hat |
the second estimated change-point for epidemic alternative |
Zhong Guan zguan@iusb.edu
Csorgo, M. and Horvath, L. (1997), Limit Theorems in Change-Point Analysis, New York: John Wiley
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | require(sac) #load the package
# one-change alternative
k<-10
n<-30
x<-rnorm(n,0,1)
x[(k+1):n]<-x[(k+1):n]+1.5
cumsum.test(x, alternative = "one.change")
# epidemic alternative
k<-10
m<-20
n<-30
x<-rnorm(n,0,1)
x[(k+1):m]<-x[(k+1):m]+1.5
cumsum.test(x, alternative = "epidemic")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.