LBInferenceMCMC-class: Class "LBInferenceMCMC" - results from MCMC inference in SEIR...

Description Objects from the Class Slots Extends Methods See Also Examples

Description

This class holds the results from MCMC inference for SEIR models, i.e. sample paths and provides routines to calculate R0

Objects from the Class

Objects can be created by calls of the form new("LBInferenceMCMC", paramHat, paramSe, aic, loglik, samplePaths).

Slots

samplePaths:

Object of class "data.frame" A data frame containing the va

paramHat:

Object of class "numeric" ~~

paramSe:

Object of class "numeric" ~~

aic:

Object of class "numeric" ~~

loglik:

Object of class "numeric" ~~

Extends

Class "LBInference", directly.

Methods

infValues

signature(object = "LBInferenceMCMC"): ...

infValues<-

signature(object = "LBInferenceMCMC"): ...

initialize

signature(.Object = "LBInferenceMCMC"): ...

plot

signature(x = "LBInferenceMCMC", y = "missing"): Important is the which argument

"beta"

CODA diagnostics for the beta parameter

"betabetaN"

Provides a diagnostic plot and HPD interval for the beta/betan ratio.

R0

signature(object = "LBInferenceMCMC"): Compute the basic reproduction ratio for each sample. Mean, median, etc. are then computed.

samplePaths

signature(object = "LBInferenceMCMC"): get the sample paths

show

signature(object = "LBInferenceMCMC"): as usual

summary

signature(object = "LBInferenceMCMC"): as usual

See Also

LBInference-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#Load Laevens (1999) data
data("laevens")
#Modify such that the checks at CRAN are only done with a
#minimum sample size (1000 samples, no thin and a burun of 1000).
if (!RLadyBug.options("allExamples")) {
  algo(laevens.opts) <- c(1000,1,1000)
}

#Algo part of the Options
algo(laevens.opts)

#Run SEIR model inference
inf.mcmc <- seir(laevens,laevens.opts)

#Results
inf.mcmc

#Analysis through coda (library coda is called when starting RLadyBug)
samples <- mcmc(samplePaths(inf.mcmc))
plot(samples[,"beta"])

#Look at the \beta/\beta_n ratio
ratio <- plot(inf.mcmc,which = "betabetaN")
c(mean=ratio$mean,ratio$hpd)

#R0
quantile(R0(inf.mcmc,laevens),c(0.025,0.5,0.975))

RLadyBug documentation built on May 2, 2019, 5:50 p.m.