I am currently trying to determine which distribution fits the dataset I currently have.
The data ranges from 0-100, and the y values represent the probability of the x value being called.
For example, the Y values may be [0.01,0.02,0.06,0.07,0.04,0.03,0.035] for an array length of 100.
for a in range(len(DISTRIBUTIONS)):
dist=DISTRIBUTIONS[a]
param=dist.fit(y)
arg = param[:-2]
loc = param[-2]
scale = param[-1]
dist_pdf=dist.pdf(x, loc=loc, scale=scale,*arg)
pdf=pd.Series(dist_pdf,x)
This is my current code, I have an array of distributions which isn't included here. I believe my problem is with the arg, loc and scale parameters as when I run fit, the array returned varies in length depending on the distribution being fitted and my current solution doesn't work.
question from:
https://stackoverflow.com/questions/66054298/fitting-best-distribution 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…