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.
From what I've understood, function ppareto in Shalizi's code is similar to plotting displ function in poweRlaw package when it comes plotting CCDF.
Here, I plotted pseudo distribution using ppareto, with log.p = F, lower.tail = F options, with alpha-value of 2.
As code suggests, the power-law fit has 1 - alpha = -1 slope.
Why does this happen? Am I doing this wrong? Is displ function different from ppareto?
Also, I tried to fit power-law on randomly generated power-law distributed data:
data <- dist_rand(displ.test, 100)
estimate.displ <- displ$new(data)
estimate.displ$setXmin(1)
estimate.displ$setPars(estimate_pars(estimate.displ)$pars)
estimate.displ$pars # happens to be 1.972
plot(estimate.displ, xlim = c(1,100), ylim = c(0.01, 1))
lines(estimate.displ) # the slope seems to be around 1.045, not 0.972
df <- lines(estimate.displ) # plotting this on ggplot also produces bent curve, not straight line
Turned out I was wrong. the function in Shalizi's codes equivalent of displ was pzeta, not ppareto.
pzeta function actually plots identical to that of displ.
I am sorry for the misunderstanding.
From what I've understood, function ppareto in Shalizi's code is similar to plotting displ function in poweRlaw package when it comes plotting CCDF. Here, I plotted pseudo distribution using ppareto, with log.p = F, lower.tail = F options, with alpha-value of 2. As code suggests, the power-law fit has 1 - alpha = -1 slope.
ppareto_test_2.pdf But when I plot the same thing in displ function,
displ_test_2.pdf
Two things are different:
Why does this happen? Am I doing this wrong? Is displ function different from ppareto?
Also, I tried to fit power-law on randomly generated power-law distributed data:
displ_randtest_2.pdf