Learn R Programming

dsfa (version 2.0.2)

cdf2quantile: Inverse cumulative distribution function

Description

Inverse cumulative distribution function

Usage

cdf2quantile(p, cdf, interval = c(-3, 3), ...)

Value

Numeric vector of p evaluated in the inverse cdf.

Arguments

p

numeric vector of probabilities.

cdf

function, cumulative distribution function which to invert.

interval

numeric vector of length 2, determining the lower and upper bound of the uniroot interval

...

other arguments for the cdf, e.g. mu, sigma_v, sigma_u, s...

Details

Code is a clone from the package gbutils.

Examples

Run this code
q=5
cdf <- pnorm(q=q, mean=1, sd=2)
q_numeric <- cdf2quantile(p=cdf, cdf=pnorm, mean=1, sd=2)
all.equal(q,q_numeric)

Run the code above in your browser using DataLab