Description Usage Arguments Value Author(s) See Also Examples
A function that takes output from the calc.p function and simulates one stochastic realization
of rho. The function does so by calculating the mean and variance of p at the level indicated by the level
argument, and then derives the shape and rate parameters for the beta distribution.
1 | sim.rho(p, level)
|
p |
an array produced by the |
level |
the level of the data for which to generate the stochastic realization of rho (e.g. destination-, route- or month-level) |
a numerical matrix when level = 'route'
John Giles
Other simulation:
calc.hpd(),
calc.prop.inf(),
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.tau()
1 2 3 4 | d <- read.csv("./data/trip_durations_longform_metadata_13_34_42_85_10_14_16_99_urban_rural.csv", stringsAsFactors=F)
d <- mob.data.array(d=d, time='month', variable='duration', agg.int=1)
p <- calc.prop.remain(d=d, gen.t=3)
rho.hat <- sim.rho(p=p, level='route')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.