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

Density Function Probability BIGGER than 1 #106

Open
ThalesArakawa opened this issue Feb 11, 2025 · 1 comment
Open

Density Function Probability BIGGER than 1 #106

ThalesArakawa opened this issue Feb 11, 2025 · 1 comment

Comments

@ThalesArakawa
Copy link

Hi!

I'm having an problem with Fitter. First of all, i'm trying to fit under all distributions, getting a bad result in all. But when i'm looking to the plot, i see this.

Image

An DFP with values bigger than 1.

I try rounding the values, truncate, take absolute values and nothing... In my dataset with more than 150 features i have a couple of relative features (values close to zero) and this problem repeat with this features, the other's is ok.

Here a sample of data

problematic_data.txt

@ThalesArakawa ThalesArakawa changed the title Density Function Propability BIGGER than 1 Density Function Probability BIGGER than 1 Feb 11, 2025
@cokelaer
Copy link
Owner

@ThalesArakawa . First of all, thanks for using fitter.
Concerning the tile (density function greater than 1), I agree it is not intuitive but correct. What will change the values of the y-axis is the step/bins used in the histgram. Indeed, to compute the final density, this is taken into account. For instance, play with the binning in the histogram (parameter bin or bins) and see the impact. Yet, at the end, sum of the X_i over i times dX (dX is your step, or width of each bar) should be 1.

You data has a large peak at 0 indeed. and then another one at -1. This is clearly not going to fit well with any continuous distribution.

Fitter uses standard distribution from scipy. check their shapes on scipy documentation but I doubt you will find that fit your data. Now, it you can get rid of the peak at 0 and -1, maybe the underlying data would be more interesting. depends on your scientific problem really. You may also consider adding +1 to all the data since your distribution looks like it starts at -1.

I see you have also outliers, maybe you can try to remove some.

best

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