Probability distribution function,
for example, pnorm for the normal distribution,
which must be defined in the current workspace. This should
accept and return vectorised parameters and values.
p
Vector of probabilities to find the quantiles for.
log.p
logical; if TRUE, probabilities p are given as log(p).
lower.tail
logical; if TRUE (default), probabilities are P[X <= x]="" otherwise,="" p[x=""> x].=>
...
The remaining arguments define parameters of the
distribution pdist. These MUST be named explicitly.
Value
Vector of quantiles of the distribution at p.
Details
This function is intended to enable users to define "q" functions for
new distributions, in cases where the distribution function pdist is
available analytically, but the quantile function is not.
It works by finding the root of the equation $h(q) = pdist(q) - p = 0$.
Starting from the interval $(-1, 1)$, the interval width
is expanded by 50% until $h()$ is of opposite sign at either end.
The root is then found using uniroot.
This assumes a suitably smooth, continuous distribution.