1
$\begingroup$

InverseCDF works fine with the normal distribution quite far out on the right tail, but eventually I am getting an $\infty$ error. Thus

N[InverseCDF[NormalDistribution[], 1 - 9*10^-15]]

gives

7.66416

but

N[InverseCDF[NormalDistribution[], 1 - 9.1*10^-15]]

gives

How can I avoid getting the infinity error?

$\endgroup$
1

1 Answer 1

5
$\begingroup$

A series expansion helps to stabilize the calculation:

a[y_] = Assuming[0 < y < 1,
  FullSimplify[Normal[Series[InverseCDF[NormalDistribution[], 1-y], {y, 0, 1}]]]]
(*    Sqrt[-2*Log[y] - Log[-2*π*Log[2*π*y^2]]]    *)

Evaluation is now very stable even for small values of $y$:

a[9.1*10^-15]
(*    7.66047    *)

a[3.7*10^-81]
(*    19.0435    *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.