Do you think it would be useful to have fit() restrict to integers?
I guess currently nobody uses erlang.fit() because, at least in the example, it doesn't work with default parameters.
import numpy as np from scipy import stats
#add fitstart to erlang, otherwise it doesn't work stats.erlang._fitstart = stats.gamma._fitstart
np.random.seed(876589) rvs = stats.erlang.rvs(5, size=500)
for dist in [stats.erlang, stats.gamma]: print '\n', dist.name p0 = dist.fit(rvs) print stats.gamma.nnlf(p0, rvs), p0 print
for k in range(10): p = dist.fit(rvs, f0=k) print dist.nnlf(p, rvs), p
I think it returning an int is here to be exptected by an Erlang user. Hence, yes. I ran the above code, but got some warnings: Warning: invalid value encountered in subtract I did not pursue the origin of this though.
Josef
Nicky
On 5 May 2012 22:20, <josef.pktd@gmail.com> wrote:
Should we restrict the shape parameter to be an integer instead of a float?
http://projects.scipy.org/scipy/ticket/1647
Let's ask the users:
Does anyone want an exception if the shape parameter is not an integer? Is there a demand or use case for estimating the shape parameter as an integer instead of a float?
right now erlang and gamma are essentially the same, as far as I can see
Josef _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user