Description
Description
Problem
When inverting a quantile function Q:
Derivative-based vs bracketing rootfinders
The existing derivative-based rootfinders (Newton, Powell) attempt to find the root outside of the
Target function for inverting QFs
For the task of inverting a quantile function (QF) the
Quantile-based likelihoods
Given the random sample
where
Quantile functions are easily extensible using the Gilchrist's transformation rules (Gilchrist, 2000). Modification of quantile functions can help create highly flexible quantile-based likelihoods, (ref Award 2153019), which may not be invertible.
Example
While logistic quantile function
Let's assume the data Y is inversely distributed as the Skew-Logistic Distribution2 with location
In Stan it would be implemented as:
parameters {
real mu; // location
real<lower=0> signa; // scale
real<lower=0,upper=1> delta; //skewness
}
model {
vector[N] u;
//Priors
target += normal_lpdf(mu| 0,1);
target += exponential_lpdf(sigma| 1);
target += beta_lpdf(delta| 1,1);
for (i in 1:N){
// numerically inverted quantile function, using bracketing rootfinding algorithm, i.e. on [0,1] without u_guess
u[i] = inv_qf(skewlogistic_qf, y[i], mu, sigma, delta, rel_tol, max_steps);
target += skewlogistic_ldqf_lpdf(u[i] | lambda);
}
}
generic QF inverting function with the scalar/vector signature
real inv_qf(function qf, data real x, data real rel_tol, data int max_steps,...)
vector inv_qf(function qf, data vector x, data real rel_tol, data int max_steps,...)
takes a reference to a quantile function qf(u,...)
with the parameters passed through the ellipsis ...
. The tolerance rel_tol
and maximum number of steps max_steps
regulate the convergence.
Expected Output
The output of the inv_qf()
is the vector(real) values of depths u
, which are roots of target function x
given the value of parameter qf()
through ellipsis).
Current Version:
v4.5.0
References
Gilchrist W. 2000. Statistical modelling with quantile functions. Boca Raton: Chapman & Hall/CRC.
Footnotes
-
An alternative (non-decreasing) formulation of the target function $\Omega^{+}(u \vert x,\theta)=Q(u\vert\theta)-x$ is equally plausible. ↩
-
We say that the data Y is "inversely distributed as SLD", because SLD lacks the CDF, therefore, the data can not be "distributed as". The depth, corresponding to observations of Y is distributed as SLD (via the quantile function). Therefore Y is said to be "inversely distributed as" (Perepolkin, Goodrich & Sahlin, 2021). ↩