Learn R Programming

denvax (version 0.1.2)

synthetic.pop: Compute synthetic population trajectories from model parameters

Description

Compute synthetic population trajectories from model parameters

Usage

synthetic.pop(pars, runs = 100, popsize = 1000, maxAge = 70,
  rngseed = NULL)

Arguments

pars,

a list with elements `f_H`, `f_L`, and `p_H`; see serofit return value

runs,

the number of different serotype timelines to simulate

popsize,

the number of individuals to sample for each run

maxAge,

the length of each lifetime

rngseed,

an optional seed for the random number generator

Value

a matrix of integers 0-4, rows `runs*popsize` x columns `maxAge`

Details

Using fitted parameters for a two-risk, constant force of infection model, simulate a dengue annual exposures model for the requested number of serotype series (`runs`) and individuals (`popsize`). The resulting matrix is a collection of integers, 0-4. 0 indicates no infection, 1-4 infection by the corresponding serotype.

Examples

Run this code
# NOT RUN {
require(denvax);
data(morrison2010) # has counts by age
fit <- with(morrison2010, serofit(sero=Seropositive, N=Number, age.min=Age))
m2010pop <- synthetic.pop(fit, runs = 10, popsize = 10) # small sample size for example run time
head(m2010pop)

# }

Run the code above in your browser using DataLab