BootsChapt {sac} | R Documentation |
By resampling with(out) replacement from the original sample data,
we can obtain bootstrap(permutation) versions of the test statistics.
The p
-values of the test(s) from the original data are approximated by the
p
-values of the bootstrap(permutation) version statistics.
BootsChapt(x, stat1, stat2 = NULL, B, replace = FALSE, alternative = c("one.change", "epidemic"), adj.Wn = FALSE, tol = 1.0e-7, maxit = 50,trace = FALSE,... )
x |
a numeric vector or matrix containing the data, one row per observation; |
stat1 |
test statistic Sn for "one-change" alternative or Vn for
"epidemic" alternative,
output of SemiparChangePoint . |
stat2 |
test statistic Wn for "epidemic" alternative, output of SemiparChangePoint . |
B |
number of resamples |
replace |
a logical indicating whether bootstrap samples for bootstrap test
of the change-point are selected with or without replacement, if replace = FALSE (default),
corresponds to permutation test, otherwise, bootstrap test; |
alternative |
a character string specifying the alternative hypothesis,
must be one of "one-change" (default) or "epidemic" . You can specify just the initial letter. |
adj.Wn |
logical indicating if Wn should be adjusted or not
for "epidemic" alternative. |
tol |
the desired accuracy (convergence tolerance), an argument of glm.control . |
maxit |
the maximum number of iterations, an argument of glm.control . |
trace |
logical indicating if output should be produced for each
iteration, an argument of glm.control . |
... |
other arguments |
The procedure will fail when there is separation in the data in the sense of Albert \& Anderson(1984, Biometrika) and Santner \& Duffy (1986, Biometrika). In this case, the change-point(s) may be detected easily using nonparametric method based on cumsum. Now, this program does not check whether the data is separated.
p.boots |
bootstrap p -value of Sn for "one-change" alternative |
p.boots.Vn |
bootstrap p -value of Vn for "epidemic" alternative |
p.boots.Wn |
bootstrap p -value of Wn for "epidemic" alternative |
Default alternative is "one-change"
, even when stat2
is not NULL.
If alternative = "epidemic"
, both stat1
and stat2
should be provided.
Statistic Wn
need be adjusted only for one dimensional observations
and if no bootstrap test is conducted. However, if Wn
is already adjusted, you have to asign
adj.Wn = TRUE
to calculate the p
-value of Wn
.
Zhong Guan zguan@iusb.edu
Guan, Z.(2001) Some Results About Empirical Likelihood Method, Ph.D. Thesis, The University of Toledo.
Guan, Z.(2004) A semiparametric changepoint model, Biometrika, 91, 4, 849–862.
Guan, Z. Semiparametric Tests for Change-points with Epidemic Alternatives.
SemiparChangePoint
, schapt
, p.OneChange
, p.Epidemic.Vn
, p.Epidemic.Wn
require(sac) #load the package # one-change alternative k<-10 n<-20 x<-rnorm(n,0,1) x[(k+1):n]<-x[(k+1):n]+1.5 T<-SemiparChangePoint(x, alternative = "one.change")$Sn BootsChapt(x, T, B = 5) #Choose larger B to get better approximate p-value.