I was caught in the same trap as another innocent, in thinking that
scipy.stats.invnorm was the inverse of the normal distribution:
http://bytes.com/topic/python/answers/478142-scipy-numpy-inverse-cumulative-normal
In my desire to improve the docstring, I started looking; after a
while I found this:
http://en.wikipedia.org/wiki/Inverse_Gaussian_distribution
- and that seems to fit the invnorm code.
A Google search for 'inverse normal distribution' does not include the
page above in the first 20 hits, but does find the inverse of the
normal distribution, and this:
http://en.wikipedia.org/wiki/Normal-inverse_Gaussian_distribution
I wonder whether it would be good to rename scipy.stats.invnorm to
scipy.stats.invgauss ? Maybe with a deprecation warning to invnorm?
Best,
Matthew
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
in general I wouldn't mind, but for naming consistency I prefer the current name
distributions created by some transformation of the normal distribution:
>>> [i for i in dir(stats) if 'norm' in i and isinstance(getattr(stats,i), stats.distributions.rv_generic)]
['foldnorm', 'halfnorm', 'invnorm', 'lognorm', 'norm', 'powerlognorm',
'powernorm', 'truncnorm']
I don't think the confusion persists very long, invnorm is a
distribution, the inverse function of the cdf of the normal
distribution is a function or in our case a method (ppf).
Josef
But from http://en.wikipedia.org/wiki/Inverse_Gaussian_distribution
it looks like it's not a inverse transformation. In that case a
different name might reduce some confusion.
I will look at what invnorm really is, (I don't know)
Josef
> But from http://en.wikipedia.org/wiki/Inverse_Gaussian_distribution
> it looks like it's not a inverse transformation. In that case a
> different name might reduce some confusion.
>
> I will look at what invnorm really is, (I don't know)
My impression is that the accepted name for this distribution is
'inverse Gaussian' or 'Wald' - but I don't think anyone else calls it
the 'inverse normal' - I am happy to be corrected if I am wrong.
Given that 'inverse normal' confused both of us, in different ways, do
you agree that a switch would be good?
See you,
I agree with the switch, I forgot to reply
I had checked Johnson, Kotz and Balakrishnan, and they have 3 or 4
parameterizations of the Inverse Gaussian, one of them is Wald, I
haven't checked yet if scale is a missing parameter in their version.
According to JKB, Tweedie called it the inverse gaussian because the
cumulants of IG and normal are (somehow) inversely related. But it is
not a transformation as e.g. lognorm.
(IG as abbreviation is confusing because I have seen IG for inverse
gamma or something like this.)
Numpy.random has this distribution available as wald, invnorm.rvs =
np.random.wald
My impression is InverseGaussian is the main name, in indices I saw
"Wald (see Inverse Gaussian)".
So the main question is whether to call it invgauss or wald, assuming
nobody objects to a renaming to clarify this.
I still want to compare parameterizations, but I'm in favor of renaming it.
Josef
I just hit this when doing some coding. Any objections to me
submitting a patch to rename to invgauss and deprecating 'invnorm'?
Best,
Jarrod
Thanks,