Testing for Interventions in Count Time Series Following Generalised Linear Models

Test for one or more interventions of given type at given time as proposed by Fokianos and Fried (2010, 2012).

Intervention detection
"interv_test"(fit, tau, delta, external, info=c("score"), est_interv=FALSE, ...)
an object of class "tsglm". Usually the result of a call to tsglm.
integer vector of times at which the interventions occur which are tested for.
numeric vector that determines the types of the interventions (see Details). Must be of the same length as tau.
logical vector of length 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).
character value that determines how to calculate the information matrix, see tsglm. Currently "score" is the only possible choice.
logical value. If est_interv=TRUE a fit for the model with all specified interventions is computed and additionally returned.
additional arguments passed to the fitting function tsglm.

A score test on the null hypothesis of no interventions is done. The null hypothesis is that the data are generated from the model specified in the argument 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.


An object of class "interv_test", which is a list with at least the following components:
value of the test statistic.
degrees of freedom of the chi-squared distribution the test statistic is compared with.
p-value of the test.
object of class "tsglm" with the fitted model under the null hypothesis of no intervention, see tsglm.
model specification of the model with the specified interventions.
If argument est_interv=TRUE, the following component is additionally returned:
object of class "tsglm" with the fitted model with the specified interventions, see tsglm.


Fokianos, K. and Fried, R. (2010) Interventions in INGARCH processes. Journal of Time Series Analysis 31(3), 210--225,

Fokianos, K., and Fried, R. (2012) Interventions in log-linear Poisson autoregression. Statistical Modelling 12(4), 299--322.

Liboschik, T., Kerschke, P., Fokianos, K. and Fried, R. (2014) Modelling interventions in INGARCH processes. International Journal of Computer Mathematics (published online),

See Also

S3 method 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.

  • interv_test.tsglm
  • interv_test
###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))
Documentation reproduced from package tscount, version 1.3.0, License: GPL-2 | GPL-3

Community examples

Looks like there are no examples yet.