Learn R Programming

surveillance (version 1.23.1)

hhh4_internals: Internal Functions Dealing with hhh4 Models

Description

The functions documented here are considered internal, i.e., not intended to be called by the user. They are used by add-on packages dealing with hhh4 models.

Usage

meanHHH(theta, model, subset = model$subset, total.only = FALSE)
sizeHHH(theta, model, subset = model$subset)

decompose.hhh4(x, coefs = x$coefficients, ...)

Arguments

theta,coefs

numeric vector of untransformed model parameters, i.e., the coefficients element of the "hhh4" object.

model

the model terms as returned by the terms-method for "hhh4" objects.

subset

vector of time points for which to compute the component means. Defaults to the fitted time range. For sizeHHH, subset=NULL means to return the vector of dispersion parameters.

total.only

logical. Should only the total mean (epidemic + endemic) be returned in a length(subset) x nUnit matrix? Otherwise, a list of such matrices is returned, giving the values of the various model components separately (as well as the total).

x

a fitted hhh4 model.

...

unused.

Author

Michaela Paul and Sebastian Meyer

Details

meanHHH computes the components of the mean returned in length(subset) x nUnit matrices. sizeHHH computes the model dispersion in dnbinom (mu, size) parametrization (it returns NULL in the Poisson case). decompose.hhh4 decomposes the fitted mean (extracted via meanHHH) in an array with dimensions \((t, i, j)\), where the first \(j\) index is "endemic".