meanResponse {surveillance} | R Documentation |
Calculates the mean response for the model specified in designRes according to equations (1.2) and (1.1) in Held et al., 2005 for univariate time series and equations (3.3) and (3.2) (with extensions) for multivariate time series. See details.
meanResponse(theta, designRes)
theta |
vector of parameters
theta = (α_1,...,α_m, λ, phi, β, gamma_1, ..., gamma_m, psi), where λ=(λ_1,...,λ_m), phi=(phi_1,...,phi_m), β=(β_1,...,β_m), gamma_1=(gamma_11,...,gamma_(1,2S_1)), gamma_m=(gamma_m1,...,gamma_(m,2S_m)), psi=(psi_1,...,psi_m). If the model specifies less parameters, those components are omitted. |
designRes |
Result of a call to make.design |
Calculates the mean response for a Poisson or a negative binomial model with mean
μ_t = λ y_t-lag + nu_t
where
log(nu_t) = α + β t + sum_(j=1)^S (gamma_(2j-1) * sin(omega_j * t) + gamma_2j * cos(omega_j * t) )
and omega_j = 2 * π * j / period are Fourier frequencies with
known period, e.g. period
=52 for weekly data,
for a univariate time series.
Per default, the number of cases at time point t-1, i.e. lag=1, enter as autoregressive covariates into the model. Other lags can also be considered.
The seasonal terms in the predictor can also be expressed as
gamma_s sin(omega_s * t) + delta_s cos(omega_s * t) = A_s sin(omega_s * t + ε_s)
with amplitude A_s=sqrt{gamma_s^2 +delta_s^2}
and phase difference tan(ε_s) = delta_s / gamma_s. The amplitude and
phase shift can be obtained from a fitted model by specifying amplitudeShift=TRUE
in the coef
method.
For multivariate time series the mean structure is
μ_it = λ_i * y_i,t-lag + phi_i * sum_(j ~ i) w_ji * y_j,t-lag + n_it * nu_it
where
log(nu_it) = α_i + β_i * t + sum_(j=1)^S_i (gamma_(i,2j-1) * sin(omega_j * t) + gamma_(i,2j) * cos(omega_j * t) )
and n_it are standardized population counts. The weights w_ji are specified in the columns of
the neighbourhood matrix disProgObj$neighbourhood
.
Alternatively, the mean can be specified as
μ_it = λ_i *π_i * y_i,t-1 + sum_(j ~ i) λ_j *(1-π_j)/|k ~ j| * y_j,t-1 + n_it * nu_it
if proportion
="single" ("multiple") in designRes$control
. Note that this model specification is still experimental.
Returns a list
with elements
mean |
matrix of dimension n x m with the calculated mean response for each time point and unit, where n is the number of time points and m is the number of units. |
epidemic |
matrix with the epidemic part λ_i * y_i,t-1 + phi_i * sum_(j ~ i) y_j,t-1 |
endemic |
matrix with the endemic part of the mean n_it*nu_it |
epi.own |
matrix with λ_i * y_i,t-1 |
epi.neighbours |
matrix with phi_i * sum_(j ~ i) y_j,t-1 |
M. Paul, L. Held
Held, L., Höhle, M., Hofmann, M. (2005) A statistical framework for the analysis of multivariate infectious disease surveillance counts. Statistical Modelling, 5, p. 187–199.