r.pw_exp {VirtualPop}R Documentation

Draws Waiting Times from a Piecewise-Exponential Distribution.

Description

The function produces n realizations of a piecewise-exponentially distributed random waiting time.

Usage

r.pw_exp(n, breakpoints, rates)

Arguments

n

Number of random draws

breakpoints

Breakpoints in piecewise-exponential distribution

rates

Piecewise-constant rates

Value

Vector of waiting times, drawn randomly from a piecewise-exponential survival function.

Examples



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)



[Package VirtualPop version 2.0.2 Index]