Learn R Programming

EpiILM (version 1.2)

epimcmc:

Description

Runs an MCMC algorithm for the estimation of specified model parameters

Usage

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)

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 of simulation
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, \(\Omega_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 scale parameters for alpha
unif.range.a
Uniform prior: Maximum and minimum 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 scale parameters for beta
unif.range.b
Uniform prior: Maximum and minimum 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 scale parameters for spark
unif.range.sp
Uniform prior: Maximum and minimum range for spark

Value

Estimates
MCMC output
Loglikelihood
Log likelihood value of each posterior estimate

Details

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

References

Rob Deardon, Xuan Fang, and Grace Pui Suze 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.

See Also

traplot

Examples

Run this code


## 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)
## ---------------------------------------------

Run the code above in your browser using DataLab