You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two minor issues in the bootstrap_p documentation I believe.
I think there is a discrepancy between what algorithm 2 in vignette 1: an introduction to using the poweRlaw package says is the p value and what bootstrap_p computes. It appears bootstrap_p is computing P(KS_sim >= KS_d) but algorithm 2 states P(KS_sim < KS_d), where KS_sim is the distribution of simulated KS statistics and KS_d is the KS-statistic of the observed data with the fitted distribution. I think bootstrap_p is correct and algorithm 2 incorrect.
Algorithm 2 line 9: KS_d > KS_sim, then P = P + 1.
bootstrap_p line 37 (poweRlaw v0.70.2): p = sum(nof[1, ] >= gof_v[["gof"]], na.rm = TRUE)/no_of_sims
# Where gof_v[["gof"]] is KS_d and nof[1, ] is KS_sim.
The bootstrap procedure specified by Clauset et al. (2009) specifies that for each simulation, a new x_min and alpha should be simulated to prevent getting a biased estimate of the p-value (page 677, paragraph 3). If you pass an argument to pars in bootstrap_p, it will use this argument as the parameters of the fitted distribution when computing KS_sim. A quick simulation shows this leads to 2 different distributions of the KS statistic. Believing Clauset et al., the simulation with the prespecified parameter is biased towards larger values. A quick note in algorithm 2 would be helpful but not necessary! In either case the simualted data is fine but for an estimated KS statistic on the right tail of the distributions, you could mistakenly fail to reject the power law.
Hi,
There are two minor issues in the bootstrap_p documentation I believe.
Algorithm 2 line 9: KS_d > KS_sim, then P = P + 1.
The text was updated successfully, but these errors were encountered: