zdk123 / SpiecEasi

Sparse InversE Covariance estimation for Ecological Association and Statistical Inference
GNU General Public License v3.0
189 stars 65 forks source link

Model selection for rank/beta penalty criterion of the SLR #224

Open erfanshekarriz opened 1 year ago

erfanshekarriz commented 1 year ago

Dear Zachary, I hope all is well.

I wanted to inquire about your pre-print and the beta/rank penalty parameter tuning for model selection.

Specifically in your manuscript, you've written :

I understand what you mean, but can't seem to find the "rank"-path in the SE object. A reviewer has asked me to at minimum undergo the same model selection using the extended Bayesian Information Criterion (eBIC) for my final revision, and your help would be most appreciated.

Is there a piece of code you could provide to select the optimal rank?

Best,

Erfan

erfanshekarriz commented 1 year ago

Nevermind!

I seem to have found it.

ranks <- round(exp(seq(log(2), log(32), len=6)))
se.slr <- spiec.easi(phy_taxfilt, method='slr', nlambda=50,
           lambda.min.ratio=1e-2, r=ranks, lambda.log=TRUE,
           pulsar.params=list(ncores=32, rep.num=30))
se.slr$ebic <- sapply(se.slr, function(x)
                       ebic(x$refit$stars, x$est$data,
                            x$est$loglik[x$select$stars$opt.index]))

Please correct me if I'm wrong, but I assume the model with the lowest eBIC is the best to go with.

Thanks for the awesome package!

Erfan

zdk123 commented 1 year ago

That's correct. I'll add docs for this.