powered by
This returns event times with a distribution resulting from piece-wise constant hazards using the inversion method.
getPCWDistr(U, haz, pw, t_0)
This returns a vector with event times.
(numeric) uniformly distributed random variables.
numeric
(numeric) piecewise constant hazard.
(numeric) time intervals for the piecewise constant hazard.
(numeric) the starting times.
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