# random sample from the uniform density
n <- 100
x <- runif(n)
# compute MLE of increasing hazard and evaluate fitted hazard at t=0.2
mle <- find.shapeMLE(x, type="increasing")
find.hazard(0.2, mle$h.val, mle$h.range, type=mle$type)
# compute MLE of unimodal hazard and evaluate fitted hazard at t=0.2
mle <- find.shapeMLE(x, type="unimodal")
find.hazard(0.2, mle$h.val, mle$h.range, type=mle$type, mode=mle$mode)
Run the code above in your browser using DataLab