## Compute quantiles of normal distribution
unr <- unuran.new("normal()","hinv")
uqhinv(unr,0.975)
uqhinv(unr,c(0.025,0.975))
## Compute quantiles of user-defined distribution
cdf <- function (x) { 1.-exp(-x) }
pdf <- function (x) { exp(-x) }
dist <- new("unuran.cont", cdf=cdf, pdf=pdf, lb=0, islog=FALSE)
unr <- unuran.new(dist, "hinv; u_resolution=1.e-12")
uqhinv(unr,seq(0,1,0.05))Run the code above in your browser using DataLab