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

My code bog down on drawing pdf if best fit distribution is T distribution #39

Open
bbxudavid opened this issue Sep 26, 2023 · 6 comments

Comments

@bbxudavid
Copy link

Use distfit to find the best theoretical distribution for the claim cost data
dfit = distfit(todf=True)
result = dfit.fit_transform(cost)
dfit.plot(chart='pdf')

@bbxudavid
Copy link
Author

bbxudavid commented Sep 26, 2023

With distfit in python, My code bog down when I trying to draw pdf of the best distribution if best fit distribution is T distribution.

@erdogant
Copy link
Owner

Not sure what you mean with "My code bog down".

@bbxudavid
Copy link
Author

It is unable to progress to draw plot dfit.plot(chart='pdf') if best fit distribution is T distribution.

@erdogant
Copy link
Owner

erdogant commented Oct 3, 2023

Can you show the error by example?
This works for me.

from distfit import distfit
import numpy as np

dfit = distfit(todf=True, distr='t')
cost = np.random.normal(0, 2, 10000)
result = dfit.fit_transform(cost)
dfit.plot(chart='pdf')

@bbxudavid
Copy link
Author

When I run code in python visual in Power BI, it always sticks in drawing plot dfit.plot(chart='pdf') if best fit distribution is T distribution.

@erdogant
Copy link
Owner

erdogant commented Oct 5, 2023

Interesting. But I am not sure how I can debug this error using your configurations.

You can try to open the distfit.py file, go to def _plot_parametric and add various print statements to see how far it comes before it gets stuck. If I know at which lines it hampers, I can then look at it.

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

No branches or pull requests

2 participants