csgillespie / poweRlaw

This package implements both the discrete and continuous maximum likelihood estimators for fitting the power-law distribution to data. Additionally, a goodness-of-fit based approach is used to estimate the lower cutoff for the scaling region.
109 stars 24 forks source link

Question on power-law fit #15

Closed akastrin closed 10 years ago

akastrin commented 10 years ago

I try to fit power law to node degree data; each line in the file refers to particular node degree (i.e. degree frequency). Histogram of the observed data is pasted below (Figure 1). Estimated xmin value is 19 with power-law exponent of 10.6.

I found strange problem when I plot m_pl object. x scale of the plot is in range 1:30 (Figure 2) although the max degree is 16,668.

Thanks in advance for any pointers.

Best, Andrej

histogram

degree_distribution

library(poweRlaw)
library(repmis) # Need to download data from Dropbox

# Download data from Dropbox
url <- "https://dl.dropboxusercontent.com/u/3340528/degrees.txt"
data <- repmis::source_data(url, header = TRUE)

# Estimate parameters
deg <- data$degree
tab <- table(deg)
m_pl <- displ$new(tab)
est <- estimate_xmin(m_pl)
m_pl$setXmin(est)

# Plot distribution
plot(m_pl)
lines(m_pl)
csgillespie commented 10 years ago

I presume that you solved your problem?