BootsModelTest {sac} | R Documentation |
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.
BootsModelTest(x, k, m, B, Alpha, Beta, tol = 1.0e-7, maxit=50, trace=FALSE)
x |
a numeric vector or matrix containing the data, one row per observation; |
k |
the estimated change-point, output of |
m |
= |
B |
number of resamples |
Alpha |
estimated parameter |
Beta |
estimated parameter |
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 |
Delta |
The test statistic of the model validity |
Pvalue |
The bootstrapped |
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.
## 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.