schapt {sac} | R Documentation |
Semiparametric Analysis of Changepoint
Description
Semiparametric empirical likelihood ratio based test of changepoint with one-change or epidemic alternatives with data-based model diagnostic
Usage
schapt(x, n.boots = 0, replace = FALSE, alternative = c("one.change",
"epidemic"), conf.level = 0.95, adj.Wn = FALSE, model.test = FALSE,
n.model.boots = 0, tol=1.0e-7, maxit=50,trace=FALSE,... )
Arguments
x |
a numeric vector or matrix containing the data, one row per observation; |
n.boots |
number of bootstrap samples for bootstrap test of the change-point,
if |
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 |
conf.level |
confidence level. |
adj.Wn |
logical indicating if |
model.test |
a logical indicating whether the test of model validity is performed. |
n.model.boots |
number of bootstrap samples for model test, if either
|
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 future arguments |
Details
Model: \log\{g(x)/f(x)\}=\exp\{\alpha+\beta'T(x)\}
,
where f(x)
and g(x)
are the
density (frequency) functions of the two hypothesized populations, and T(x)
can be chosen as
T(x)=x
or T(x)=(x,x^2)
. 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. Currently, this function does not check whether the data are separated.
Value
data.name |
dataset name |
parameter |
sample size |
alternative |
the alternative hypothesis |
statistic |
a list contains |
estimate |
a list contains change-point(s) and |
p.value |
a list contains |
Note
Statistic Wn
need be adjusted only for one dimensional observations
and if no bootstrap test is conducted. If returned p
-value is 0, this means that the
p
-value is less than 1.0e-7.
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 change-point model, Biometrika, 91, 4, 849–862.
Guan, Z. Semiparametric Tests for Change-points with Epidemic Alternatives.
See Also
Examples
require(sac) #load the package
# one-change alternative
## 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:sac" %in% search()) library(sac)
#if package sac has not been loaded, load it.
if(! "package:stats" %in% search()) library(stats)
data(Nile)
plot(Nile, type="p")
schapt(Nile, alternative = "one.change")