Description Usage Arguments Value Author(s) See Also Examples
This function takes the output from a TSIR simulation and calculates the mean proportion infected in each district.
1 | calc.prop.inf(x, N)
|
x |
matrix of total infected for all districts in simulation |
N |
vector of population size of each district |
a dataframe
John Giles
Other simulation:
calc.hpd(),
calc.prop.remain(),
calc.timing.magnitude(),
calc.wait.time(),
decay.func(),
get.age.beta(),
get.beta.params(),
sim.TSIR.full(),
sim.TSIR(),
sim.combine.dual(),
sim.combine(),
sim.gravity.duration(),
sim.gravity(),
sim.lambda(),
sim.pi(),
sim.rho(),
sim.tau()
1 2 3 4 5 6 7 8 9 10 | load("./output/TSIR_sim_influenza_high.Rdata") # sim
load('./data/N_pop.rdata') # N.pop
# Get only relevant districts
districts <- colnames(sim$B$tot.inf)
N <- N[which(N$ID %in% districts), 'N']
# Calculate mean proportion infected in each district
prop.inf.basic <- calc.prop.inf(sim$B$tot.inf, N=N)
prop.inf.duration <- calc.prop.inf(sim$R$tot.inf, N=N)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.