fitter
fitter copied to clipboard
Bug: get_best() returns worst fitting distribution when method is set to the ks_statistic
trafficstars
The logic for the identification of the best distribution fit in the get_best() function when the ks_statistic method is selected is backwards given the null hypothesis of the KS test. It looks like the get_best() function is returning the distribution with the minimum KS p-value. But the null hypothesis of the KS test is that the sample is distributed according to the reference distribution. And selecting the model with the minimum KS p-value means we're potentially picking the worst fitting distribution.
@andymd26 do you have a simple example to fix the potential issue ? thanks in advance