ndtri
→Tensorndtri(p: Tensor)Inverse standard normal CDF (probit / quantile function).
Computes , the quantile function of the standard normal distribution. This is the workhorse for sampling Gaussian variates from uniforms via inverse-CDF, for probit regression, and for converting tail probabilities back to standard scores.
Parameters
pTensorReturns
Tensor element-wise, same shape and dtype as
p; values are unbounded reals.
Notes
The implementation uses the Beasley-Springer-Moro rational approximation. The unit interval is split into a central region with , , in which a rational polynomial in is evaluated, and two symmetric tail regions in which a rational polynomial in is used:
The approximation is accurate to roughly over its supported domain. Boundary behaviour: , and the function blows up to at the endpoints.
Examples
>>> import lucid
>>> from lucid.special import ndtri
>>> ndtri(lucid.tensor([0.025, 0.5, 0.975]))
Tensor([-1.9600, 0.0000, 1.9600])