I am writing a script to find the most suitable dataset distribution using scipy.stats. First I have a list of distribution names for which I repeat:
dists = ['alpha', 'anglit', 'arcsine', 'beta', 'betaprime', 'bradford', 'norm']
for d in dists:
dist = getattr(scipy.stats, d)
ps = dist.fit(selected_data)
errors.loc[d,['D-Value','P-Value']] = kstest(selected.tolist(), d, args=ps)
errors.loc[d,'Params'] = ps
Now, after this loop, I choose the minimum value of D to get the best fit. Now each distribution returns a specific set of parameters in ps, each with their names, etc. (For example, for "alpha" it will be alpha, while for "normal" they will also have std).
Is there a way to get evaluation parameter names in scipy.stats?
Thank you in advance
source
share