Learn R Programming

simIDM (version 0.1.0)

PCWInversionMethod: Single Piecewise Exponentially Distributed Event Time

Description

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

Usage

PCWInversionMethod(haz, pw, LogU)

Value

This returns one single event time.

Arguments

haz

(numeric)
piecewise constant hazard.

pw

(numeric)
time intervals for the piecewise constant hazard.

LogU

(numeric)
transformed uniformly distributed random variables (log(1-U)).

Examples

Run this code
PCWInversionMethod(haz = c(1.1, 0.5, 0.4), pw = c(0, 7, 10), LogU = log(1 - runif(1)))

Run the code above in your browser using DataLab