Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
89 views
in Technique[技术] by (71.8m points)

python - Fitting best distribution

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...