I have a network which I need to fit with power law distribution and exponential distribution and compare them, choosing the better fit.
I have degree distribution data retrived using igraph package degree.distribution function:
degree.distribution (data, mode = "all", cumulative = FALSE)
which returns results vector e.g.
0.000000000 0.289772727 0.278409091 0.159090909 0.204545455 0.051136364 0.005681818 0.011363636
I tried fitting it using igraph's power.law.fit as below:
power.law.fit(deg.dist, impelementation = "plfit")
$continuous
[1] TRUE
$alpha
[1] 1.493625
$xmin
[1] 0.008
$logLik
[1] 10.32315
$KS.stat
[1] 0.1248314
$KS.p
[1] 0.9996425
my question is: I need to fit the data to an exponential distribution as well and compare the results, so I'm looking for a way to create the fits that returns comparable parameters. If there's better ways to find a power law fit, I'd be happy to try them.
Thank you
The poweRlaw package fits the power law and exponential distributions. You can install it in the usual way
Look at the first example in the first vignette.