mardi 14 juin 2016

Compute natural log of survival function of a Gaussian in Python/numpy/scipy


I can compute the natural log of the survival function of a Gaussian distribution using

np.log( scipy.stats.norm.sf(s) )

I need to compute the survival function for some ludicrously large values of s (maybe up to 1000), but the above function hits double point machine precision around s = 37. Is there some function I could use to compute the log of the survival function directly?

Note: I don't believe my underlying distribution is Gaussian out to that many sigma, but I need the survival function to compute some properties of weak signals (3-4 sigma), and I want the algorithm to do something reasonable in the presence of very strong signals.


Aucun commentaire:

Enregistrer un commentaire