sim.lambda: Simulate decay rate (lambda)

Description Usage Arguments Value Author(s) See Also Examples

View source: R/hmob_funcs.R

Description

A function to simulate one stochastic realization of the decay rate lambda given the mean and standard deviation of the posterior distribution estimated by model of decay rate or a gravity model.

Usage

1
sim.lambda(mu, sigma, level)

Arguments

mu

mean of posterior distribution of decay rate lambda

sigma

standard deviation of posterior distribution of decay rate lambda

level

the level of the data at which the mean and standard deviation of lambda are given (e.g. destination-, route- or month-level)

Value

a numerical matrix when level = 'route'

Author(s)

John Giles

See Also

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.pi(), sim.rho(), sim.tau()

Examples

1
2
3
4
load('./output/gravity_model_route_8dists.Rdata')    # mod.grav  #  posterior estimates of gravity model parameters
tmp <- get.param.vals(n.districts=8, name='lambda', level='route', stats=mod.grav)

lambda.hat <- sim.lambda(mu=tmp$mean, sigma=tmp$sd, level='route')

gilesjohnr/hmob documentation built on Aug. 8, 2020, 1:26 a.m.