SIRsim: Markovian SIR epidemic model

Description Usage Arguments Details Value

Description

Simulate from a Markovian SIR epidemic model.

Usage

1
2
SIRsim(beta, gamma, S0, I0, R0, t0, norm_beta = TRUE, t_end = Inf,
  step_end = Inf, thinning = 0)

Arguments

beta

The infection parameter

gamma

Recovery rate

S0

Initial number susceptible

I0

Initial number infectious

R0

Initial number recovered

t0

Initial time

norm_beta

Whether beta should be normalised (i.e. divided) by population size

t_end

Time at which the simulation will terminate

step_end

Number of steps after which the simulation will terminate

thinning

An integer determining what type of output to return. Zero gives the final state. A positive value thins the output by this factor i.e. output=1 gives all output, output=2 gives results for step 0,2,4,... The final state is always returned.

Details

This function performs a simulation. This terminates when (a) the specified time is reached or (b) the specified number of steps have been performed or (c) zero infectious remain. A simulation terminated for (a) or (b) can be continued by starting another simulation from the final state.

Value

A dataframe with columns step (number of steps performed), S, I, R (state at this step) and elapsed (computer time taken). The steps reported depend on the thinning variable.


dennisprangle/lazyABCexample documentation built on May 15, 2019, 3:25 a.m.