Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/interv_test.tsglm.R

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

1 2 3 | ```
## S3 method for class 'tsglm'
interv_test(fit, tau, delta, external,
info=c("score"), est_interv=FALSE, ...)
``` |

`fit` |
an object of class |

`tau` |
integer vector of times at which the interventions occur which are tested for. |

`delta` |
numeric vector that determines the types of the interventions (see Details). Must be of the same length as |

`external` |
logical vector of length |

`info` |
character value that determines how to calculate the information matrix, see |

`est_interv` |
logical value. If |

`...` |
additional arguments passed to the fitting function |

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:

`test_statistic` |
value of the test statistic. |

`df` |
degrees of freedom of the chi-squared distribution the test statistic is compared with. |

`p_value` |
p-value of the test. |

`fit_H0` |
object of class |

`model_interv` |
model specification of the model with the specified interventions. |

If argument `est_interv=TRUE`

, the following component is additionally returned:

`fit_interv` |
object of class |

Tobias Liboschik, Philipp Probst, Konstantinos Fokianos and Roland Fried

Fokianos, K. and Fried, R. (2010) Interventions in INGARCH processes. *Journal of Time Series Analysis* **31(3)**, 210–225, http://dx.doi.org/10.1111/j.1467-9892.2010.00657.x.

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. (2016) Modelling count time series following generalized linear models. *PhD Thesis TU Dortmund University*, http://dx.doi.org/10.17877/DE290R-17191.

Liboschik, T., Kerschke, P., Fokianos, K. and Fried, R. (2016) Modelling interventions in INGARCH processes. *International Journal of Computer Mathematics* **93(4)**, 640–657, http://dx.doi.org/10.1080/00207160.2014.949250.

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.

1 2 3 4 5 | ```
###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
``` |

tscount documentation built on Nov. 25, 2017, 1:04 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.