I am experimenting with setting the power law for empirical data using the powerlaw module. I created the following data following the power law of the distribution of indicator 2:
x = range(1,1000) y = [] for i in x: y.append(i**(-2))
I expect that the law with the established degree has an exponent of 2. However, the resulting exponent is very different from the theoretical value:
fitted_pl = powerlaw.Fit(y) fitted_pl.alpha Out[115]: 1.4017584065981563
Could you advise why this is happening, or indicate what I did wrong here?
Thanks for your kind reply!
python power-law
Moses xu
source share