简体   繁体   English

scipy.stats可以自动计算pmf吗?

[英]Can scipy.stats to calculate pmf automatically?

I have two questions. 我有两个问题。

1) I have an array like [1,2,3,4,5,5,3,1] . 1)我有一个像[1,2,3,4,5,5,3,1]的数组。 and I don't know which distributions it is. 我不知道它是哪个发行版。 Can I use scipy.stats to calculate pmf,cdf automatically? 我可以使用scipy.stats自动计算pmf,cdf吗?

2) scipy.stats is just like a library of distributions? 2) scipy.stats就像一个发行版库吗? If I want to analysis data, I have to find one distributions or define one? 如果要分析数据,我必须找到一种分布或定义一种分布? I need to manually calculate some of data, like pmf. 我需要手动计算一些数据,例如pmf。 Am I understanding correctly? 我理解正确吗?

Well, scipy.stats is not a library for telling you the distribution of data and calculating pmf and cdf automatically. 嗯,scipy.stats并不是一个用于告诉您数据分布并自动计算pmf和cdf的库。 Its a library for easing your tasks while estimating the probabily distribution. 它是一个库,用于简化任务, 同时估计概率分布。 You have to explore your data and find which distribution which fits your data with least error ,which is the ultimate task and scipy.stats helps you achieving this.... you don't have to reinvent the wheel as they say by writing all the mathematical functions again and again. 您必须浏览您的数据并找到最适合您的数据且误差最小的分布,这是最终的任务,而scipy.stats可以帮助您实现这一目标。... 您不必像编写这些文件那样重新发明轮子数学函数一次又一次。

Well, to answer your question in the comment, lets suppose you have a dataset, to get an insight and get a starting point for your analysis, what you'll do is plot the data in a historgram (which also shows distribution of data), now you can plot different distributions on the same plot using scipy.stats to get a feel of bestfit.... 好吧,为了在评论中回答您的问题,假设您有一个数据集,以获取洞察力并为您的分析提供一个起点,您要做的是将数据绘制在直方图中(还显示数据的分布 ) ,现在您可以使用scipy.stats在同一图上绘制不同分布,以获得最佳拟合的感觉。...

Check out this answer, it might help ya... 看看这个答案,可能对您有帮助...

https://stats.stackexchange.com/questions/132652/how-to-determine-which-distribution-fits-my-data-best https://stats.stackexchange.com/questions/132652/how-to-determine-which-distribution-fits-my-data-best

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM