scipy.stats.invnorm - rename to invgauss?
Hi, 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-... 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
On Wed, Apr 7, 2010 at 2:45 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,
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-...
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?
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
Best,
Matthew _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
On Wed, Apr 7, 2010 at 3:05 PM, <josef.pktd@gmail.com> wrote:
On Wed, Apr 7, 2010 at 2:45 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,
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-...
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?
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).
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
Josef
Best,
Matthew _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
Hi,
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, Matthew
On Fri, Apr 9, 2010 at 3:38 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,
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?
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
See you,
Matthew _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
Hi, On Fri, Apr 9, 2010 at 2:55 PM, <josef.pktd@gmail.com> wrote:
On Fri, Apr 9, 2010 at 3:38 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,
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?
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.
I just hit this when doing some coding. Any objections to me submitting a patch to rename to invgauss and deprecating 'invnorm'? Best, Jarrod
On Tue, Feb 22, 2011 at 7:05 PM, Jarrod Millman <millman@berkeley.edu> wrote:
Hi,
On Fri, Apr 9, 2010 at 2:55 PM, <josef.pktd@gmail.com> wrote:
On Fri, Apr 9, 2010 at 3:38 PM, Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,
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?
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.
I just hit this when doing some coding. Any objections to me submitting a patch to rename to invgauss and deprecating 'invnorm'?
thanks, Ralf has already done it for 0.9 http://projects.scipy.org/scipy/ticket/1172 Josef
Best,
Jarrod _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
On Tue, Feb 22, 2011 at 4:23 PM, wrote:
thanks, Ralf has already done it for 0.9
Thanks, Jarrod
participants (3)
-
Jarrod Millman
-
josef.pktd@gmail.com
-
Matthew Brett