问题描述
我有一个我知道具有Pareto分布的数据集。有人可以指出我如何在Scipy中拟合此数据集吗?我得到了下面的代码来运行,但是我不知道返回给我的是什么(a,b,c)。另外,在获得a,b,c之后,如何使用它们计算方差?
I have a data set that I know has a Pareto distribution. Can someone point me to how to fit this data set in Scipy? I got the below code to run but I have no idea what is being returned to me (a,b,c). Also, after obtaining a,b,c, how do I calculate the variance using them?
import scipy.stats as ss
import scipy as sp
a,b,c=ss.pareto.fit(data)
推荐答案
要非常小心地拟合幂律!实际上,许多报告的幂律实际上与幂律不符。有关所有详细信息,请参见(有关(如果您无权访问该日记)。他们有一个,该文章现在链接到Python实现。不知道它是否使用Scipy,因为我上次使用它时使用了R的实现。
Be very careful fitting power laws!! Many reported power laws are actually badly fitted by a power law. See Clauset et al. for all the details (also on arxiv if you don't have access to the journal). They have a companion website to the article which now links to a Python implementation. Don't know if it uses Scipy because I used their R implementation when I last used it.
这篇关于用(python)Scipy拟合pareto分布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!