"interv_test"(fit, tau, delta, external, info=c("score"), est_interv=FALSE, ...)
"tsglm"
. Usually the result of a call to tsglm
.
tau
.
length(tau)
specifying for each intervention wether its effect is external or not (see Details). If this is only a scalar this choice will be used for all interventions. If this is only a scalar this choice will be used for all interventions. If omitted all interventions will have an internal effect (i.e. external=FALSE
).
tsglm
. Currently "score"
is the only possible choice.
est_interv=TRUE
a fit for the model with all specified interventions is computed and additionally returned.
tsglm
.
"interv_test"
, which is a list with at least the following components:"tsglm"
with the fitted model under the null hypothesis of no intervention, see tsglm
.
est_interv=TRUE
, the following component is additionally returned:"tsglm"
with the fitted model with the specified interventions, see tsglm
.
model
, see definition in tsglm
. Under the alternative there are one or more intervention effects occuring at times tau
. The types of the intervention effects are specified by delta
as defined in interv_covariate
. The interventions are included as additional covariates according to the definition in tsglm
. It can have an internal (the default) or external (external=TRUE
) effect (see Liboschik et al., 2014).Under the null hypothesis the test statistic has asymptotically a chi-square distribution with length(tau)
(i.e. the number of breaks) degrees of freedom. The returned p-value is based on this and approximately valid for long time series, i.e. when length(ts)
large.
Fokianos, K., and Fried, R. (2012) Interventions in log-linear Poisson autoregression. Statistical Modelling 12(4), 299--322. http://dx.doi.org/10.1177/1471082X1201200401.
Liboschik, T., Kerschke, P., Fokianos, K. and Fried, R. (2014) Modelling interventions in INGARCH processes. International Journal of Computer Mathematics (published online), http://dx.doi.org/10.1080/00207160.2014.949250.
print
.tsglm
for fitting a GLM for time series of counts.
interv_detect
for detection of single interventions of given type and interv_multiple
for iterative detection of multiple interventions of unknown types. interv_covariate
for generation of deterministic covariates describing intervention effects.
###Campylobacter infections in Canada (see help("campy"))
#Test for the intervention effects which were found in Fokianos und Fried (2010):
campyfit <- tsglm(ts=campy, model=list(past_obs=1, past_mean=c(7,13)))
campyfit_intervtest <- interv_test(fit=campyfit, tau=c(84,100), delta=c(1,0))
campyfit_intervtest
Run the code above in your browser using DataLab