Learn R Programming

simIDM (version 0.1.0)

getPCWDistr: Piecewise Exponentially Distributed Event Times

Description

This returns event times with a distribution resulting from piece-wise constant hazards using the inversion method.

Usage

getPCWDistr(U, haz, pw, t_0)

Value

This returns a vector with event times.

Arguments

U

(numeric)
uniformly distributed random variables.

haz

(numeric)
piecewise constant hazard.

pw

(numeric)
time intervals for the piecewise constant hazard.

t_0

(numeric)
the starting times.

Examples

Run this code
getPCWDistr(U = runif(3), haz = c(1.1, 0.5, 0.4), pw = c(0, 7, 10), t_0 = c(0, 1, 4.2))

Run the code above in your browser using DataLab