估计幂律分布中的指数截止 [英] Estimate exponential cutoff in a power law distribution

查看:33
本文介绍了估计幂律分布中的指数截止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我一直在做一些社交网络分析,我偶然发现了在网络度上拟合概率分布的问题.

As I have been doing some social network analysis, I have stumbled upon the problem of fitting a probability distribution on network degree.

所以,我有一个概率分布 P(X >= x),从目视检查,它遵循指数截止的幂律而不是纯幂律(一条直线).

So, I have a probability distribution P(X >= x) which, from visual inspection, follows a power law with an exponential cutoff rather than a pure power law (a straight line).

因此,假设具有指数截止的幂律分布方程为:

So, given that the equation for power law distribution with exponential cutoff is:

f(x) = x**alpha * exp(beta*x)

f(x) = x**alpha * exp(beta*x)

我如何使用 Python 估计参数 alphabeta?

How might I estimate the parameters alpha and beta using Python?

我知道 scipy.stats.powerlaw 包存在,并且它们有一个 .fit() 函数,但这似乎不起作用,因为它只返回绘图的位置和比例,这似乎只对正态分布有用?这个包的教程也不够多.

I know scipy.stats.powerlaw package exists and they have a .fit() function but that doesn't seem to do the job as it only returns the location and scale of the plot, which seems to be useful only for normal distribution? There are also not enough tutorials on this package.

附言我很清楚 CLauset et al 的实施,但他们没有似乎提供了估计替代分布参数的方法.

P.S. I'm well aware of the implementation of CLauset et al but they don't seem to provide ways to estimate the parameters of alternate distributions.

推荐答案

Powerlaw 库可以直接用于估计参数如下:

Powerlaw library can directly be used to estimate the parameters as follows:

  1. 安装所有pythons依赖项:

  1. Install all the pythons dependencies:

pip install powerlaw mpmath scipy

  • 在 python 环境中运行 powerlaw 包:

  • Run the powerlaw package fit in a python environment:

    import powerlaw
    data = [5, 4, ... ]
    results = powerlaw.Fit(data)
    

  • 从结果中获取参数

  • get the parameters from the results

    results.truncated_power_law.parameter1 # power law  parameter (alpha)
    results.truncated_power_law.parameter2 # exponential cut-off parameter (beta)
    

  • 这篇关于估计幂律分布中的指数截止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆