r.pw_exp {VirtualPop} | R Documentation |
The function produces n realizations of a piecewise-exponentially distributed random waiting time.
r.pw_exp(n, breakpoints, rates)
n |
Number of random draws |
breakpoints |
Breakpoints in piecewise-exponential distribution |
rates |
Piecewise-constant rates |
Vector of waiting times, drawn randomly from a piecewise-exponential survival function.
breakpoints <- c(0, 10, 20, 30, 60)
rates <- c(0.01,0.02,0.04,0.15)
pw_sample <- VirtualPop::r.pw_exp (n=10, breakpoints, rates=rates)