1

I am using the poweRlaw package to fit some data and calculate p-values. I noticed that in some cases, where there is not so much variation in the data combined with a relatively small number of observations, I am unable to calculate a p-value once the number of simulations passes a certain threshold.

Consider the following data:

library(poweRlaw)
vec<-c(1,1,1,1,1,2,1,1,4,1,1,1,1,1,1,1,1,2,1,1,1,2,2,1,2,1,
       1,2,1,1,2,1,1,1,1,1,1,2,2,2,2,1,1,1,1,2)

Can fit the power law and calculate the p-value:

pl=displ$new(vec)
est=estimate_xmin(pl)
bts=bootstrap_p(pl,no_of_sims=30,seed=42)

However, when I increase the number of simulations, to for instance 35, I get the following error:

Error in checkForRemoteErrors(val) : 
  one node produced an error: index 0 outside bounds

Actually I don't really understand what the error means practically. I guess an issue here is that the observed data probably doesn't follow a power law, at least not at this relatively low number of observations. But how come that this error occurs at 35 simulations but not 30?

4

1 回答 1

1

解决方案此问题已在 powerlaw 版本 0.7.1 中修复

运行update.packages()


我认为错误的出现是因为在引导过程中,主要1是在选择时。这会在估计缩放参数时导致数值不稳定。

我在https://github.com/csgillespie/poweRlaw/issues/56创建了一个问题

于 2015-10-29T13:36:18.920 回答