uq {Runuran}R Documentation

Quantile function for UNU.RAN object

Description

Evaluates quantile of distribution approximately using a UNU.RAN object that implements an inversion method.

[Universal] – Quantile Function.

Usage

uq(unr, U)

Arguments

unr a "unuran" object that implements an inversion menthod.
U vector of probabilities.

Details

The routine evaluates the quantiles (inverse CDF) for a given (vector of) probabilities approximately. It requires a "unuran" object that implements an inversion method. Currently these are

Author(s)

Josef Leydold and Wolfgang H"ormann unuran@statmath.wu-wien.ac.at.

References

W. H"ormann, J. Leydold, and G. Derflinger (2004): Automatic Nonuniform Random Variate Generation. Springer-Verlag, Berlin Heidelberg.

See Also

unuran,unuran.new.

Examples

## Compute quantiles of normal distribution using method HINV
unr <- unuran.new("normal()","hinv")
uq(unr,0.975)
uq(unr,c(0.025,0.975))

## Compute quantiles of user-defined distributio using method HINV
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")
uq(unr,seq(0,1,0.05))

## Compute quantiles of user-defined distribution using method PINV
pdf <- function (x) { exp(-x) }
dist <- new("unuran.cont", pdf=pdf, lb=0, islog=FALSE)
unr <- unuran.new(dist, "pinv; u_resolution=1.e-12")
uq(unr,seq(0,1,0.05))


[Package Runuran version 0.8.0 Index]