fLatentSEIR.MH {stochasticGEM} | R Documentation |
fLatentSEIR.MH
is used to fit the SEIR general epidemic model with fixed latency duration via Markov chain Monte Carlo. In this compartmental model only the removal times are observed. The computation is based on the algorithm that is developed by O`Neill & Becker (2001).
fLatentSEIR.MH(N, infectionTimes = NULL, latencyTimes = NULL, removalTimes, START = NULL, priorValues = NULL, fixedLatencyDuration = NULL, minInfPeriod = 1, bayesReps = 10000, burnIn = 0, bayesThin = 1, updateIniInfGibbs=TRUE, verbose = FALSE, missingInfectionTimes = TRUE, infectious.density = "exponential")
N |
initial susceptible individuals |
infectionTimes |
removal times |
latencyTimes |
end of latency times |
removalTimes |
removal times |
START |
A vector with 2 or 3 elements, the infection rate and the removal rate for exponential distributed infectious periods, or the infection rate and the scale and shape parameter of the infectious period respectively for gamma/Weibull distributed infectious periods. Defaults to NULL. |
priorValues |
A list with elements infectionRate and removalRate for an exponential density or infectionRate , infectiousScale and infectiousShape for other densities, being vectors of length 2 containing the gamma prior coefficients for the corresponding parameters. A prior, theta , for the initial infection time is needed for the exponential (a scalar) and gamma (a vector of length 2). Priors are necessary, for instance when using a gamma density the first element of theta should be at least 1. |
fixedLatencyDuration |
The 'assumed' fixed value of the latency duration. The default is NULL |
minInfPeriod |
The minimum possible infectious period. The default is 1 |
bayesReps |
A positive integer denoting the number of MCMC draws. The default is 10000 |
burnIn |
A positive integer denoting the burn-in interval for the Markov chain, i.e., the number of initial draws that should not be stored. The default is 0. |
bayesThin |
A positive integer denoting the thinning interval for the Markov chain, i.e., the interval between successive values of the Markov chain. The default is 1. |
updateIniInfGibbs |
Update the initial infection time. The default is TRUE |
verbose |
Used to check activity of MCMC sampler. A dot is printed at every bayesReps /100 iteration. |
missingInfectionTimes |
Are missing values updated or fixed. By default the infection times are updated. |
infectious.density |
type of density. can be either exponential , gamma and weibull |
If certain elements of the starting values are missing an attempt is made to get suitable starting values. If 'infection.density' is exponential
the remRateSEIR
is returned instead of infScaleSEIR
and infShapeSEIR
.
a list
of components containing the folowing elements:
logLikelihood |
A Markov chain Monte Carlo object of the 'psuedo' log likelihood for each completed data set. The function mcmc in the coda library is used to create the object. |
fixedLatencyDuration |
The 'assumed' fixed value of the latency duration. |
infectionTimes |
Posterior mean of the infection times. |
removalTimes |
Removal times. |
infRateSEIR |
A Markov chain Monte Carlo object of the Gibbs draws for the infection rate. The function mcmc in the coda library is used to create the object. |
remRateSEIR |
A Markov chain Monte Carlo object of the Gibbs draws for the removal rate. The function mcmc in the coda library is used to create the object. |
infScaleSEIR |
A Markov chain Monte Carlo object of the Gibbs draws for the scale parameter of the gamma/Weibull distribution. The function mcmc in the coda library is used to create the object. |
infShapeSEIR |
A Markov chain Monte Carlo object of the Metropolis-Hastings draws for the shape parameter of the gamma/Weibull distribution. The function mcmc in the coda library is used to create the object. |
acceptRate |
Number of accepted draws for the infection times. |
bayesReps |
The number of MCMC draws |
burnIn |
The burn-in interval for the Markov chain. |
bayesThin |
The thinning interval for the Markov chain. |
bayesOut |
Number of saved iterations. |
infectiousPeriod |
A Markov chain Monte Carlo object of the infectious period. The function mcmc in the coda library is used to create the object. |
reproductionNumber |
A Markov chain Monte Carlo object of the reproduction number. The function mcmc in the coda library is used to create the object. |
initialSusceptible |
Initial susceptible individuals. |
initialInfective |
Initial infective individuals. |
Eugene Zwane e.zwane@gmail.com
O'Neill, P.D. & Roberts, G.O. (1999). 'Bayesian inference for partially observed stochastic epidemics' J.R. Statist. Soc. A. 162, 121-129.
O'Neill, P.D. & Becker, N.G. (2001). 'Inference for an epidemic when susceptibility varies' Biostatistics 2, 99-108.
O'Neill, P.D. (2002). 'A tutorial introduction to Bayesian inference for stochastic epidemic models using Markov chain Monte Carlo methods' Mathematical Biosciences 180, 103-114.
getValidSEIR
, SEIR.MH
, SIR.MH
, SIR.MLE
data(smallpox) priors <- list(infectionRate = c(1.0,0.01), removalRate = c(1.0,0.01), theta = c(0,0)) temp <- fLatentSEIR.MH(N=119, removalTimes=smallpox, priorValues=priors, fixedLatencyDuration = 10, bayesReps=1000, burnIn=500,bayesThin=1) summary(temp$infRateSEIR) summary(temp$remRateSEIR) summary(temp$infectiousPeriod) summary(temp$reproductionNumber) # # priors <- list(infectionRate = c(1.00,0.01), infectiousScale = c(1.0,0.01), infectiousShape = c(1.0,0.01), theta = c(1.0,0.01)) temp <- fLatentSEIR.MH(N=119, removalTimes=smallpox, priorValues=priors, fixedLatencyDuration = 10, bayesReps=1000, burnIn=500,bayesThin=1,infectious.density = "gamma") summary(temp$infRateSEIR) summary(temp$infScaleSEIR) summary(temp$infShapeSEIR) summary(temp$infectiousPeriod) summary(temp$reproductionNumber) # # priors <- list(infectionRate = c(1.00,0.01), infectiousScale = c(1.0,0.01), infectiousShape = c(1.0,0.01)) temp <- fLatentSEIR.MH(N=119, removalTimes=smallpox, priorValues=priors, fixedLatencyDuration = 10, bayesReps=1000, burnIn=500,bayesThin=1,infectious.density = "weibull") summary(temp$infRateSEIR) summary(temp$infScaleSEIR) summary(temp$infShapeSEIR) summary(temp$infectiousPeriod) summary(temp$reproductionNumber)