algo.hhh.grid {surveillance}R Documentation

Function to try multiple starting values

Description

Tries multiple starting values in algo.hhh. Starting values are provided in a matrix with gridSize rows, the grid search is conducted until either all starting values are used or a time limit maxTime is exceeded. The result with the highest likelihood is returned.

Usage

  algo.hhh.grid(disProgObj, control=list(linear=FALSE, nseason=0, period=52,   
      neighbours=FALSE, negbin=FALSE, lambda=TRUE), thetastartMatrix,
      maxTime=1800, verbose=FALSE)

Arguments

disProgObj object of class disProg
control Control object:
    linear
    if true a linear trend is included.
    nseason
    number of Fourier frequencies to be used
    period
    period length (defaults to 52 for weekly data)
    neighbours
    if true a autoregressive parameter for adjacent areas is included.
    negbin
    if true negative binomial rather than poisson is used.
    lambda
    if true a autoregressive parameter is included.
thetastartMatrix matrix with initial values for all parameters specified in the control object as rows.
verbose if true progress information is printed
maxTime maximum of time (in seconds) to elapse until algorithm stopps.

Details

Value

list
    best
    result of a call to algo.hhh with highest likelihood
    allLoglik
    values of loglikelihood for all starting values used
    gridSize
    number of different starting values in thetastartMatrix
    gridUsed
    number of used starting values
    convergence
    if false algo.hhh did not converge for all (used) starting values

Author(s)

M. Paul, L. Held

Source

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.

See Also

meanResponse,create.grid

Examples

    
    # monthly counts of menigococcal infections in France
    data(meningo.age)
                  
    # specify model for algo.hhh.grid
    model1 <- list(lambda=TRUE, linear=TRUE)
    # create grid of inital values
    grid1 <- create.grid(params = list(lambda=c(0.1,0.9,5), beta=c(-1,1,3)))
    # try multiple starting values, print progress information
    algo.hhh.grid(meningo.age, control=model1, thetastartMatrix=grid1,
                  verbose=TRUE)
    
    # specify model
    model2 <- list(lambda=TRUE, neighbours=TRUE, linear=TRUE, negbin=TRUE,
                  nseason=1, period=12)
    grid2 <- create.grid(params = list(lambda=c(0.1,0.9,5), phi=c(0.1,0.9,5), 
                  beta=c(0,0.5,2), psi=c(0.3,12,10), gammaDelta=c(-0.5,0.5,3),
                  nseason=1))
    # run algo.hhh.grid, search time is limited to 60 sec
    algo.hhh.grid(meningo.age, control=model2, thetastartMatrix=grid2,
                  maxTime=60)


[Package surveillance version 0.9-2 Index]