BootsChapt: Bootstrap (Permutation) Test of Change-Point(s) with...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/BootsChapt.R

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

1
2
3
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

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

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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.

Example output

bootstrap p-value of Tn 
                      0 

sac documentation built on Jan. 27, 2021, 5:11 p.m.

Related to BootsChapt in sac...