Closed jcredberry closed 4 years ago
I have tried fitdistr
with the problematic resample, and it "worked":
> fitdistr(resample,densfun = "lognormal")
meanlog sdlog
-0.1984425 1.9213726
( 0.5793156) ( 0.4096380)
> exp(-0.1984425)
[1] 0.8200069
I am running both of them and due to the data, it seems that for some replicates fitdistr
finds the first mode as the location parameter, but estimate_pars
(I guess due to estimate_xmin
) sometimes finds the second mode. The bootstrap_p
function then does not reject the null hypothesis, although it is close to 7%. When both are somewhat closer, then the null is rejected. If I fix m_ln$min<-min(resample)
, then both estimations are close and the null hypothesis is close to be rejected, but it is never so (close to 6%).
Why is estimate_xmin
so sensitive?
This
fitdistr(resample,densfun = "lognormal")
fits a lognormal distribution. Not a truncated lognormal.
When I run
library(poweRlaw)
x = c(0.1984895, 3.0046058, 12.8631459, 15.4773498, 0.2062829, 0.1996015, 0.1960452, 15.4788675, 0.1935871, 0.2033684, 0.1929931)
m = conlnorm$new(x)
estimate_xmin(m)
gives the warning
Warning message:
In get_xmin_est(dat, xmins) :
Unable to estimate xmin. This may be due to numerical instabilities.
For example the parameter estimates are in the distribution tails.
What this means is that values of the lognormal (for a particular value xmin) are very large.
Also
plot(m)
indicates the data is decidedly odd.
Colin, I am trying to run
estimate_xmin
with a dataset of 12 points and bootstrap (my implementation, not yours). Most of the times it works perfectly, but sometimes it crashes with the following message:The function that I am using with
boot
is:With the following resample (found by hand) I am able to crash
estimate_xmin
:Using
conpl
it works, although the parameters have a large variance. Might this be the problem? As you can see most of the data is close to zero, then there is a huge jump to values larger than 10.Please, I need help as this is crucial in my work. Otherwise, I will have to rely on semiparametric bootstrap, which I know will underestimate the median centrality of my nodes.
Regards, Julio