create.grid {surveillance} | R Documentation |
Computes a matrix of initial values
Description
For a given 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 λ, phi, psi must be positive.
For gamma, delta only one sequence of starting
values is considered to create the grid, i.e. intital values are the same
for each one of the seasonal parameters. nseason
is the number of
Fourier frequencies to be included.
Usage
create.grid(params = list(lambda=c(0.1,0.9,5), phi=c(0.1,0.9,5),
psi=c(0.3,12,10), beta=c(-0.5,0.5,3), gammaDelta=c(-0.5,0.5,3),
nseason=1))
Arguments
params |
list of parameters: param=c(lower,upper,length)
- lambda
- autoregressive parameter lambda.
- phi
- autoregressive parameter for adjacent units phi.
- psi
- overdispersion parameter for Negative Binomial model psi.
- beta
- linear trend beta.
- gammaDelta
- seasonal parameters gamma, delta.
- nseason
- number of Fourier frequencies S to be used
(if not specified,
nseason defaults to 1)
|
Details
Value
matrix |
matrix with gridSize starting values as rows |
Author(s)
M. Paul
Source
See Also
algo.hhh.grid
Examples
# 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=TRUE, linear=TRUE)
# create a grid of initial values for respective parameters
grid1 <- create.grid(params = list(lambda=c(0.1,0.9,5), phi=c(0.1,0.9,5),
beta=c(-1,1,3), gammaDelta=c(-1,1,3), nseason=1))
grid2 <- create.grid(params = list(lambda=c(0.1,0.9,5), psi=c(0.3,12,10),
beta=c(0,0,1)))
[Package
surveillance version 0.9-6
Index]