seir: Parameter estimation in SEIR-Models based on ML or MCMC

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/functions.R

Description

Inference is perform for the parameters in an SEIR-model based on the data in experiment. The actuall class of options (OptionsML or OptionsMCMC) decides what type of inference is performed.

Usage

1
seir(experiment, options, debug = FALSE)

Arguments

experiment

Data corresponding to an Experiment

options

An object of class Options. The specific action (ML or MCMC estimation) is determined by the subclass of options.

debug

Boolean (default FALSE) specifying whether to yield additional debug information in case of problems. For example the ladybug.system.out and ladybug.system.err are not removed after the call and can be found in the current working directory.

Details

Estimation is performed by calling LadyBug using a .jcall to the appropriate method in the Java class sir.estimate.LadyBug. Output is read from file and converted into an appropriate object of class LBInference-class.

Currently the method branches on the appropriate method using an if. Should become a generic method as some point.

Note that the system.out and system.err from the java call are saved in the currented working directory (the directory has to be writable). After a successfull call the files are deleted unless one uses the debug option.

Value

An object of class Inference

Author(s)

U. Feldmann and M. Höhle

See Also

LBOptions-class,LBOptionsML-class,LBOptionsMCMC-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data("csfvML")
ml <- seir(csfvML, csfvML.opts)
ml

#MCMC Inference for the data from the Laevens experiment
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)

inf.mcmc <- seir(laevens,laevens.opts)
#Show some results
inf.mcmc

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

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