Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example from readthedocs not working even if I downsample the array #38

Open
miguelcarcamov opened this issue Jun 17, 2021 · 3 comments

Comments

@miguelcarcamov
Copy link

miguelcarcamov commented Jun 17, 2021

Hello, I am trying to run the example from readthedocs which is:

from scipy import stats
data = stats.gamma.rvs(2, loc=1.5, scale=2, size=100000)

from fitter import Fitter
f = Fitter(data, timeout=3000, distributions=['gamma', 'rayleigh', 'uniform']) #Increasing time out time
f.fit()
f.summary()

and I am getting:

WARNING:root:SKIPPED uniform distribution (taking more than 3000 seconds)

WARNING:root:SKIPPED rayleigh distribution (taking more than 3000 seconds)

/home/miguel/.local/lib/python3.9/site-packages/scipy/stats/_continuous_distns.py:4530: IntegrationWarning: The integral is probably divergent, or slowly convergent.
  intg = integrate.quad(f, -xi, np.pi/2, **intg_kwargs)[0]
WARNING:root:SKIPPED gamma distribution (taking more than 3000 seconds)

WARNING:fitter.fitter:uniform was not fitted. no parameters available
WARNING:fitter.fitter:rayleigh was not fitted. no parameters available
WARNING:fitter.fitter:gamma was not fitted. no parameters available
WARNING:matplotlib.legend:No handles with labels found to put in legend.

My version of fitter from pip is 1.3.0...

Am I doing something wrong? The example from the readthedocs should work in principle right?

Also, I was thinking that there might a bug with the timeout parameter? no matter how much time I give it, it always returns SKIPPED x distribution (taking more than y seconds), where y can be a very large number.

@MigueLesPaul
Copy link

The same happened to me. testing with a simple example. I tried varying the initial data distribution parameters.

@kabirmdasraful
Copy link

@miguelcarcamov
I ran you your data and it gives me result without any skipping. I was using fitter 1.3.0
Out[6]:
sumsquare_error aic bic kl_div
gamma 0.000073 1494.092341 -2.103890e+06 inf
rayleigh 0.018802 2858.246376 -1.548651e+06 inf
uniform 0.278573 711.116338 -1.279077e+06 inf

@cokelaer
Copy link
Owner

cokelaer commented Sep 2, 2021

@MigueLesPaul @miguelcarcamov I'm sorry about that. This is strange.
On version 1.3.0 and 1.4.0 I got the answer in a fraction of a second repeatedly.
It will be difficult to debug this on my side. Please make sure scipy is up-to-date. Try with 10,000 sample then 1,000 and see it converges but I'm still puzzled that it does not work. I see that you are under python3.9; maybe there is an issue with python3.9 not sure. I have added 3.9 to the continuous integration to see whether this work at least on github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants