create.grid: Computes a matrix of initial values

Description Usage Arguments Value Author(s) See Also Examples

Description

For a given model and a list of parameters specified as param = c(lower,upper,length), create.grid creates a grid of initial values for algo.hhh.grid. The resulting matrix contains all combinations of the supplied parameters which each are a sequence of length length from lower to upper. Note that the autoregressive parameters λ, φ and the overdispersion parameter ψ must be positive. Only one sequence of initial values is considered for the autregressive, endemic and overdispersion parameters to create the grid, e.g. initial values are the same for each one of the seasonal and trend parameters.

Usage

1
2
create.grid(disProgObj, control, params = list(epidemic = c(0.1, 0.9, 5),
   endemic=c(-0.5,0.5,3), negbin = c(0.3, 12, 10)))

Arguments

disProgObj

object of class disProg

control

specified model

params

list of parameters: param=c(lower,upper,length)

  • epidemic autoregressive parameters λ and φ.

  • endemic trend and seasonal parameters β, γ_j.

  • negbin overdispersion parameter for negative binomial model ψ.

Value

matrix

matrix with gridSize starting values as rows

Author(s)

M. Paul

See Also

algo.hhh.grid

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# simulate data
set.seed(123)
disProgObj <- simHHH(control = list(coefs = list(alpha =-0.5, gamma = 0.4,
                     delta = 0.6)),length=300)$data

# consider the model specified in a control object for algo.hhh.grid
cntrl1 <- list(lambda=TRUE, neighbours=TRUE, 
               linear=TRUE, nseason=1)
cntrl2 <- list(lambda=TRUE, negbin="single")

# create a grid of initial values for respective parameters
grid1 <- create.grid(disProgObj, cntrl1, 
                     params = list(epidemic=c(0.1,0.9,3), 
                                   endemic=c(-1,1,3)))
grid2 <- create.grid(disProgObj, cntrl2, 
                     params = list(epidemic=c(0.1,0.9,5), 
                                   negbin=c(0.3,12,10)))

jimhester/surveillance documentation built on May 19, 2019, 10:33 a.m.