Learn R Programming

sac (version 1.0.2)

BootsChapt: 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 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

Value

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

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.

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

Run this code
# NOT RUN {
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.
# }

Run the code above in your browser using DataLab