iqf | R Documentation |
Function factory for creating an inverse quantile function
iqf(QFUN)
QFUN |
bare name of the quantile function to be inverted. Assumes that the first argument in the quantile function is |
function. Approximated CDF for a given quantile function. The inverse function will have the following additional arguments, passed to stats::uniroot() lower=0, upper=1, tol=1e-6, silent=TRUE, trace=0. The resulting inverse quantile function is fully vectorized with regards to all of its arguments (shorter vectors are recycled).
qmyfun <- function(p, b, k){b*(log(p/(1-p))+k*p)}
pmyfun <- iqf(qmyfun)
x <- qmyfun(1:9/10, 2, 3)
pmyfun(x, 2, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.