BootsModelTest {sac}R Documentation

Bootstrap Test of the Validity of the Semiparametric Change-Point Model

Description

Using bootstrap method to approximate the p-value of test of the model validity. Bootstrap samples are drawn from the semiparametrica empirical distribution which are estimates of the underlying population distributions.

Usage

BootsModelTest(x, k, m, B, Alpha, Beta, tol = 1.0e-7, maxit=50, trace=FALSE)

Arguments

x

a numeric vector or matrix containing the data, one row per observation;

k

the estimated change-point, output of SemiparChangePoint

m

= n the sample size for "one-change" alternative, or the estimated second change-point for "epidemic" alternative, an output of SemiparChangePoint

B

number of resamples

Alpha

estimated parameter \alpha, output of SemiparChangePoint

Beta

estimated parameter \beta, output of SemiparChangePoint

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.

Value

Delta

The test statistic of the model validity

Pvalue

The bootstrapped p-value

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

Examples

## Nile data with one change-point: the annual flows drop in 1898.
## It is believed to be caused by the building of the first Aswan dam.
if(! "package:stats" %in% search()) library(stats)
data(Nile)
require(sac) #load the package
Nile.res<-SemiparChangePoint(Nile, alternative = "one.change")
BootsModelTest(Nile, Nile.res$k.hat, length(Nile), B=5, Nile.res$alpha.hat, 
    Nile.res$beta.hat)
    # Choose larger B to get better approximate p-value.
    # It takes longer to do bootstrap model test for large B.

[Package sac version 1.0.2 Index]