
Last chance! 50% off unlimited learning
Sale ends in
hhh4
.
We keep algo.hhh
in the package only for backwards
compatibility with the original publications.algo.hhh(disProgObj, control=list(lambda=TRUE, neighbours=FALSE,
linear=FALSE, nseason = 0,
negbin=c("none", "single", "multiple"),
proportion=c("none", "single", "multiple"),lag.range=NULL),
thetastart=NULL, verbose=TRUE)
disProg
optim
). See algo.hhh.grid
.true
information about convergence is printedah
with elementsoptim
converged or notdisProg
-object For univariate time series, the mean structure of a Poisson or a negative
binomial model is
period
=52 for weekly data.
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.
For multivariate time series the mean structure is
disProgObj$neighbourhood
.
Alternatively, the mean can be specified as
proportion
="single" ("multiple") in the control
argument. Note that this model specification is still experimental.
algo.hhh.grid
, hhh4
# univariate time series: salmonella agona cases
data(salmonella.agona)
model1 <- list(lambda=TRUE, linear=TRUE,
nseason=1, negbin="single")
algo.hhh(salmonella.agona, control=model1)
# multivariate time series:
# measles cases in Lower Saxony, Germany
data(measles.weser)
# same model as above
algo.hhh(measles.weser, control=model1)
# include autoregressive parameter phi for adjacent "Kreise"
# specifiy start values for theta
model2 <- list(lambda = TRUE, neighbours = TRUE,
linear = FALSE, nseason = 1,
negbin = "single")
algo.hhh(measles.weser, control = model2, thetastart = rep(0, 20) )
## weekly counts of influenza and meningococcal infections
## in Germany, 2001-2006
data(influMen)
# specify model with two autoregressive parameters lambda_i, overdispersion
# parameters psi_i, an autoregressive parameter phi for meningococcal infections
# (i.e. nu_flu,t = lambda_flu * y_flu,t-1
# and nu_men,t = lambda_men * y_men,t-1 + phi_men*y_flu,t-1 )
# and S=(3,1) Fourier frequencies
model <- list(lambda=c(TRUE,TRUE), neighbours=c(FALSE,TRUE),
linear=FALSE,nseason=c(3,1),negbin="multiple")
# run algo.hhh
algo.hhh(influMen, control=model)
# now meningococcal infections in the same week should enter as covariates
# (i.e. nu_flu,t = lambda_flu * y_flu,t-1
# and nu_men,t = lambda_men * y_men,t-1 + phi_men*y_flu,t )
model2 <- list(lambda=c(1,1), neighbours=c(NA,0),
linear=FALSE,nseason=c(3,1),negbin="multiple")
algo.hhh(influMen, control=model2)
Run the code above in your browser using DataLab