powered by
This returns an event time with a distribution resulting from piece-wise constant hazards using the inversion method.
PCWInversionMethod(haz, pw, LogU)
This returns one single event time.
(numeric) piecewise constant hazard.
numeric
(numeric) time intervals for the piecewise constant hazard.
(numeric) transformed uniformly distributed random variables (log(1-U)).
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