# random sample from the uniform density
n <- 500
x <- runif(n)
# compute MLE of increasing hazard
mle <- find.shapeMLE(x, type="increasing")
# plot the fitted hazard
plot(mle)
rug(x)
# add true hazard to the plot
h.true <- function(x) 1/(1-x)
plot(h.true, col="red", add=TRUE)
Run the code above in your browser using DataLab