如何使用 Python 估计幂律分布的指数?
我目前正在做一些网络分析,我想估计平均聚类系数与节点度的幂律分布的指数。首选方法是最大似然估计(MLE)
我知道这里已经实现了类似的代码:http:// tuvalu.santafe.edu/~aaronc/powerlaws/
然而,他们实现的代码专门绘制一条曲线 Pr(X >= x) vs x,其中 x 是给定序列中的节点。换句话说,Pr(X≥x)是X中存在等于或大于x的节点的概率。
我已经用谷歌搜索了好几天,但仍然没有找到任何可以做到这一点的工具,例如估计给定两个值序列的幂律分布的指数。
提前致谢。
I'm currently doing some network analysis and I want to estimate the exponent of a power-law distribution of the average clustering co-efficient vs node degree. The preferred method is maximum likelihood estimation (MLE)
I know similar code has been implemented here: http://tuvalu.santafe.edu/~aaronc/powerlaws/
However, the code they have implemented is specifically to plot a curve Pr(X >= x) vs x where x is a node in a given sequence. In other words, Pr(X >= x) is the probability that there is a node in X which is equal or larger than x.
I have Googled for days and I still haven't managed to find any tools which would do this e.g. estimating the exponent of a power-law distribution given two sequences of values.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这可能会晚一些,但您可以查看最近发布的“powerlaw”软件包。它有一个 iPython 笔记本,其中包含工作示例和图形。
I understand this may be late but you can look into the `powerlaw' package which was released recently. It has an iPython notebook with working examples and figures.
查看 scipy.optimize。如果必须使用最大似然,请定义似然函数并使用 fmin() 查找 - 似然的最小值(=似然的最大值)。如果可以接受其他方法,请考虑 curve_fit() (使用最小二乘拟合)。
Look into scipy.optimize. If you must use Maximum Likelihood, define a likelihood function and use fmin() to find the minimum of -likelihood (=maximum of likelihood). If, other methods are acceptable, consider curve_fit() (which uses least squares fitting).