scipy.stats.sampling.TransformedDensityRejection.ppf_hat#

TransformedDensityRejection.ppf_hat(u)#

Evaluate the inverse of the CDF of the hat distribution at u.

Parameters
uarray_like

An array of percentiles

Returns
ppf_hatarray_like

Array of quantiles corresponding to the given percentiles.

Examples

>>> from scipy.stats.sampling import TransformedDensityRejection
>>> from scipy.stats import norm
>>> from math import exp
>>> 
>>> class MyDist:
...     def pdf(self, x):
...         return exp(-0.5 * x**2)
...     def dpdf(self, x):
...         return -x * exp(-0.5 * x**2)
... 
>>> dist = MyDist()
>>> rng = TransformedDensityRejection(dist)
>>> 
>>> rng.ppf_hat(0.5)
-0.00018050266342393984
>>> norm.ppf(0.5)
0.0
>>> u = np.linspace(0, 1, num=1000)
>>> ppf_hat = rng.ppf_hat(u)