简体   繁体   中英

fitting exponential and power law distributions in R and comparing better fit

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 eg

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

install.package("poweRlaw")

Look at the first example in the first vignette .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM