sim.tau: Simulate probability of leaving origin (tau)

Description Usage Arguments Value Author(s) See Also Examples

View source: R/hmob_funcs.R

Description

A function that takes a matrix containing the empirical proportion of individuals that leave origin i for each date in the trip duration data and simulates one stochastic realization of tau (the overall probability of leaving origin i). The function does so by calculating the mean and variance of p for each origin i, and then derives the shape and rate parameters for the beta distribution.

Usage

1

Arguments

p

A matrix giving the observed proportion of individuals of leaving origin i for each day in the trip suration data

Value

a numerical vector with values between 0 and 1

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

Examples

1
2
3
4
5
6
7
load('./data/leave_data.Rdata')
load('./data/stay_data.Rdata')

prop.leave <- leave/stay

tau.hat <- sim.tau(prop.leave)
head(tau.hat)

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