Description Usage Arguments Value Author(s) Examples
The calibrationTest
-method for "hhh4"
models tests the calibration of the model fit, i.e., if the observed
counts are from the fitted Poisson/NegBin distribution.
1 2 3 |
x |
an object of class |
subset |
subset of time points for which to test calibration. Defaults to the subset used for fitting the model. |
units |
integer or character vector selecting the |
... |
arguments passed to |
an object of class "htest"
, see calibrationTest.default
.
Sebastian Meyer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | data("measlesWeserEms")
## fit a hhh4 model
measlesModel <- list(
end = list(f = addSeason2formula(~0 + ri(type="iid"))),
ar = list(f = ~1),
ne = list(f = ~1, weights = W_powerlaw(maxlag = 5)),
family = "NegBin1")
measlesFit <- hhh4(measlesWeserEms, control = measlesModel)
## plot fitted mean components
plot(measlesFit, units = NULL)
## overall calibration test
calibrationTest(measlesFit) # default is DSS (not suitable for low counts)
calibrationTest(measlesFit, which = "rps")
calibrationTest(measlesFit, which = "logs")
## test calibration for the second year in a specific district
calibrationTest(measlesFit, subset = 53:104, units = "03452", which = "rps")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.