Learn R Programming

pomp (version 0.45-8)

sir: SIR models.

Description

euler.sir is a pomp object encoding a simple seasonal SIR model. Simulation is performed using an Euler multinomial approximation. gillespie.sir has the same model implemented using Gillespie's algorithm. bbs is a nonseasonal SIR model together with data from a 1978 outbreak of influenza in a British boarding school.

Arguments

Details

This example is discussed extensively in the Introduction to pomp and Advanced topics in pomp vignettes.

The codes that construct these pomp objects can be found in the examples directory in the installed package. Do system.file("examples",package="pomp")) to find this directory. For the basic rprocess, dmeasure, rmeasure, and skeleton functions, these codes use compiled native routines built into the package's library. View src/sir.c in the package source or file.show("examples/sir.c") from an Rsession to view these codes.

The boarding school influenza outbreak is described in Anonymous (1978).

References

Anonymous (1978). Influenza in a boarding school. British Medical Journal 1:587

See Also

pomp-class and the vignettes

Examples

Run this code
pompExample(euler.sir)
plot(euler.sir)
plot(simulate(euler.sir,seed=20348585))
coef(euler.sir)

pompExample(gillespie.sir)
plot(gillespie.sir)
plot(simulate(gillespie.sir,seed=20348585))
coef(gillespie.sir)

pompExample(bbs)
plot(bbs)
coef(bbs)

Run the code above in your browser using DataLab