hhh4ZI | R Documentation |
Fits a zero-inflated autoregressive negative binomial (hhh4
) model
to a univariate or multivariate time series of counts.
The characteristic feature of hhh4
models is the additive
decomposition of the conditional mean into epidemic and
endemic components (Held et al, 2005).
The inflated parameter is a logit-linear predictor and can have autoregressive terms.
hhh4ZI(
stsObj,
control = list(ar = list(f = ~-1, offset = 1, lag = 1), ne = list(f = ~-1, offset = 1,
lag = 1, weights = neighbourhood(stsObj) == 1, scale = NULL, normalize = FALSE), end
= list(f = ~1, offset = 1), zi = list(f = ~1, lag = 1, lag.unitSpecific = FALSE),
family = c("NegBin1", "NegBinM"), subset = 2:nrow(stsObj), optimizer = list(stop =
list(tol = 1e-05, niter = 100), regression = list(method = "nlminb"), variance =
list(method = "Nelder-Mead")), verbose = FALSE, start = list(fixed = NULL, random =
NULL, sd.corr = NULL),
data = list(t = stsObj@epoch - min(stsObj@epoch)),
keep.terms = FALSE),
check.analyticals = FALSE
)
stsObj |
object of class |
control |
a list containing the model specification and control arguments,
the parts relating to
|
check.analyticals |
logical (or a subset of
|
hhh4ZI
returns an object of class "hhh4ZI"
,
which inherits from class "hhh4"
, and
is a list containing the following components:
coefficients named vector with estimated (regression) parameters of the model
se estimated standard errors (for regression parameters)
cov covariance matrix (for regression parameters)
Sigma estimated variance-covariance matrix of random effects
Sigma.orig estimated variance parameters on internal scale used for optimization
call the matched call
dim vector with number of fixed and random effects in the model
loglikelihood (penalized) loglikelihood evaluated at the MLE
margll (approximate) log marginal likelihood should the model contain random effects
convergence logical. Did optimizer converge?
mu The fitted mean values in hhh4 model part
fitted.values fitted mean values in zero-inflated model
gamma fitted zero inflation parameter
control control object of the fit
terms the terms object used in the fit if keep.terms = TRUE
and NULL
otherwise
stsObj the supplied stsObj
lags named integer vector of length three containing the lags
used for the epidemic components "ar"
, "ne"
and "zi"
respectively. The corresponding lag is NA
if the component
was not included in the model.
nObs number of observations used for fitting the model
nTime number of time points used for fitting the model
nUnit number of units (e.g. areas) used for fitting the model
runtime the proc.time
-queried time taken
to fit the model, i.e., a named numeric vector of length 5 of class
"proc_time"
neW1 <- neighbourhood(measles) == 1
fit <- hhh4ZI(measles,
control = list(
ar = list(f = ~1),
ne = list(f = ~1, weights = neW1, normalize = TRUE),
end = list(f = ~1),
zi = list(f = ~1),
family = "NegBin1",
verbose = TRUE,
keep.terms = TRUE
)
)
summary(fit)
sim_data <- simulate(fit, simplify = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.