epimcmc: Monte Carlo Simulation

Description Usage Arguments Details Value References Examples

Description

Runs an MCMC algorithm for the estimation of specified model parameters

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
epimcmc (type, x = NULL, y = NULL, inftime, tmin = NULL, tmax, infperiod = NULL, 

         niter, alphaini, betaini, sparkini = NULL, Sformula = NULL, 

         contact = NULL, pro.var.a, pro.var.b, pro.var.sp = NULL, prioralpha, 

         halfnorm.var.a = NULL, gamma.par.a = NULL, unif.range.a = NULL, priorbeta, 

         halfnorm.var.b = NULL, gamma.par.b = NULL, unif.range.b = NULL, 

         priorsp = NULL, halfnorm.var.sp = NULL, gamma.par.sp = NULL, 

         unif.range.sp = NULL, tempseed = NULL)

Arguments

type

Type of compartment framework, with the choice of "SI" for Susceptible-Infectious diseases and "SIR" for Susceptible-Infectious-Removed

x

X coordinates of individuals

y

Y coordinates of individuals

inftime

Times at which individuals are infected to initialize epidemic simulation

tmin

The first time point at which the infection occurs, default value is one

tmax

The last time point at which data is observed

infperiod

Length of infectious period for each individual

niter

Number of MCMC iterations

alphaini

Initial value of susceptibility parameter(s)(>0)

betaini

Initial value of spatial parameter(s) (>0) or network parameter (s) (>0) if contact is used

sparkini

Initial value of spark parameter (>=0)

Sformula

An object of class formula. See formula

Individual-level covariate information associated with susceptibility can be passed through this argument. An expression of the form ~ model is interpreted as a specification that the susceptibility function, Ω_s(i) is modelled by a linear predictor specified symbolically by the model term. Such a model consists of a series of terms separated by + and - operators. If there is no covariate information, Sformula is null

contact

Contact network matrix (matrices)

pro.var.a

Proposal density variance for alpha parameter(s)

pro.var.b

Proposal density variance for beta parameter(s)

pro.var.sp

Proposal density variance for spark parameter

prioralpha

Select the prior distribution for alpha parameter(s) with the choice of "halfnormal" for positive half normal distribution, "gamma" for gamma distribution and "uniform" for uniform distribution

halfnorm.var.a

Half normal prior variance for alpha

gamma.par.a

Gamma prior: shape and rate parameters for alpha

unif.range.a

Uniform prior: Minimum and maximum range for alpha

priorbeta

Select the prior distribution for beta parameter(s) with the choice of "halfnormal" for half normal distribution, "gamma" for gamma distribution and "uniform" for uniform distribution

halfnorm.var.b

Half normal prior variance for beta

gamma.par.b

Gamma prior: shape and rate parameters for beta

unif.range.b

Uniform prior: Minimum and maximum range for beta

priorsp

Select the prior distribution for spark parameter with the choice of "halfnormal" for half normal distribution, "gamma" for gamma distribution and "uniform" for uniform distribution

halfnorm.var.sp

Half normal prior variance for spark

gamma.par.sp

Gamma prior: shape and rate parameters for spark

unif.range.sp

Uniform prior: Minimum and maximum range for spark

tempseed

Integer seed value to initialize the (Fortran) random number generator, default value is a random seed.

Details

Independent Gaussian random walks are used as the Metropolis-Hastings MCMC proposal for all parameters

Value

A list is returned with the following components:

Estimates

MCMC output as coda object

Loglikelihood

Log likelihood value of each posterior estimate

References

Rob Deardon, Xuan Fang, and Grace P. S. Kwong (2014). Statistical modelling of spatio-temporal infectious disease tranmission in Analyzing and Modeling Spatial and Temporal Dynamics of Infectious Diseases, (Ed: D. Chen, B. Moulin, J. Wu), John Wiley & Sons.. Chapter 11.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Example 1:  spatial SI model 
# generate 100 individuals
## Not run: 
x <- runif(100, 0, 10)

y <- runif(100, 0, 10)

covariate <- runif(100, 0, 2)

out <- epidata(type = "SI", n = 100, Sformula = ~covariate, tmax = 15, 
              alpha = c(0.1, 0.3), beta = 5.0, x = x, y = y)


mcout <- epimcmc(type = "SI", x = x, y = y, inftime = out$inftime, Sformula = ~covariate, 
                tmax = 15, niter = 1000, alphaini = c(0.01, 0.01), betaini = 0.01,
                pro.var.a = c(0.01, 0.005), pro.var.b = 0.05, 
                prioralpha = "halfnormal", halfnorm.var.a = c(10**5, 10**5), 
                priorbeta = "halfnormal", halfnorm.var.b = 10**5)

## End(Not run)

EpiILM documentation built on May 2, 2019, 12:20 p.m.