I want to computer gamma fit over the axis 0 from my array (3d). I've try the code below but something its wrong.
import scipy.stats as st
import numpy as np
myarray = np.random.rand(20, 3, 3)
a, myloc, myscale = st.gamma.fit(myarray, axis=0)
I want to computer gamma fit over the axis 0 from my array (3d). I've try the code below but something its wrong.
import scipy.stats as st
import numpy as np
myarray = np.random.rand(20, 3, 3)
a, myloc, myscale = st.gamma.fit(myarray, axis=0)
The fit
method does not accept an axis
argument.
Actually, in scipy 0.15.1 (and probably older versions), it does "accept" it, but it ignores it. This looks like a bug. It should raise a TypeError
when you give it any argument that it doesn't actually use, but that is not how it currently works:
In [20]: from scipy.stats import gamma
In [21]: gamma.fit([1,2,3,3,3,4,5,7])
Out[21]: (3.6899039741659925, 0.049374155400321737, 0.93515411814698823)
In [22]: gamma.fit([1,2,3,3,3,4,5,7], axis=123)
Out[22]: (3.6899039741659925, 0.049374155400321737, 0.93515411814698823)
In [23]: gamma.fit([1,2,3,3,3,4,5,7], flibbity=123)
Out[23]: (3.6899039741659925, 0.049374155400321737, 0.93515411814698823)
Bug report: https://github.com/scipy/scipy/issues/4932
It should be scipy.stats
instead of scipy.stat
.