BootsChapt {sac} | R Documentation |
Bootstrap (Permutation) Test of Change-Point(s) with One-Change or Epidemic Alternative
Description
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.
Usage
BootsChapt(x, stat1, stat2 = NULL, B, replace = FALSE,
alternative = c("one.change", "epidemic"), adj.Wn = FALSE,
tol = 1.0e-7, maxit = 50,trace = FALSE,... )
Arguments
x |
a numeric vector or matrix containing the data, one row per observation; |
stat1 |
test statistic |
stat2 |
test statistic |
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 |
alternative |
a character string specifying the alternative hypothesis,
must be one of |
adj.Wn |
logical indicating if |
tol |
the desired accuracy (convergence tolerance), an argument of |
maxit |
the maximum number of iterations, an argument of |
trace |
logical indicating if output should be produced for each
iteration, an argument of |
... |
other arguments |
Details
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.
Value
p.boots |
bootstrap |
p.boots.Vn |
bootstrap |
p.boots.Wn |
bootstrap |
Note
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
.
Author(s)
Zhong Guan zguan@iusb.edu
References
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.
See Also
SemiparChangePoint
, schapt
, p.OneChange
, p.Epidemic.Vn
, p.Epidemic.Wn
Examples
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.