I am writing a script to find the best-fitting distribution over a dataset using scipy.stats. I first have a list of distribution names, over which I iterate:
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 select the minimum D-Value in order to get the best fitting distribution. Now, each distribution returns a specific set of parameters in ps, each with their names and so on (for instance, for 'alpha' it would be alpha, whereas for 'norm' they would be mean and std).
Is there a way to get the names of the estimated parameters in scipy.stats?
Thank you in advance