statdivlab / corncob

Count Regression for Correlated Observations with the Beta-binomial
103 stars 22 forks source link

model optimization error bbdml and differentialTest #121

Closed amy-briggs closed 3 years ago

amy-briggs commented 3 years ago

Hello,

When I run differentialTest() and bbdml() using corncob v. 0.2.0, I keep getting the error, "Model could not be optimized! Try changing initializations or simplifying your model." I was able to fit these models successfully on this data in December, but have gotten a new computer and updated R from version 3.6 to 4.0.3 since then. When I attempted to run

corncob_da <- bbdml(formula = OTU.1 ~ DayAmdmt,
             phi.formula = ~ DayAmdmt,
             data = soil)

from the corncob vignette, I get the same error. I've tried reinstalling corncob and restarting R, without success. Do you have any other suggestions? Thank you in advance for any help.

Here is my Session Info: [1] ‘0.2.0’

sessionInfo() R version 4.0.3 (2020-10-10) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 10.16

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

attached base packages: [1] grid stats4 stats graphics grDevices utils datasets methods base

other attached packages: [1] magrittr_2.0.1 ggfortify_0.4.11 factoextra_1.0.7 glmmTMB_1.0.2.9000 scales_1.1.1
[6] egg_0.4.5 cowplot_1.1.1 gridExtra_2.3 corncob_0.2.0 microbiome_1.12.0 [11] phyloseq_1.34.0 data.table_1.13.6 bbmle_1.0.23.1 vegan_2.5-7 lattice_0.20-41
[16] permute_0.9-5 car_3.0-10 carData_3.0-4 lme4_1.1-26 Matrix_1.3-2
[21] forcats_0.5.0 stringr_1.4.0 purrr_0.3.4 readr_1.4.0 tidyr_1.1.2
[26] tibble_3.1.1 tidyverse_1.3.0 reshape2_1.4.4 dplyr_1.0.5 plyr_1.8.6
[31] MASS_7.3-53 ggplot2_3.3.3 dada2_1.18.0 Rcpp_1.0.5

loaded via a namespace (and not attached): [1] estimability_1.3 coda_0.19-4 knitr_1.30
[4] DelayedArray_0.16.0 hwriter_1.3.2 RCurl_1.98-1.2
[7] generics_0.1.0 BiocGenerics_0.36.0 xml2_1.3.2
[10] lubridate_1.7.9.2 SummarizedExperiment_1.20.0 assertthat_0.2.1
[13] xfun_0.20 hms_1.0.0 evaluate_0.14
[16] fansi_0.4.2 progress_1.2.2 dbplyr_2.0.0
[19] readxl_1.3.1 igraph_1.2.6 DBI_1.1.1
[22] ellipsis_0.3.1 ggpubr_0.4.0 backports_1.2.1
[25] ROI_1.0-0 RcppParallel_5.0.2 MatrixGenerics_1.2.0
[28] vctrs_0.3.7 Biobase_2.50.0 abind_1.4-5
[31] withr_2.4.2 bdsmatrix_1.3-4 emmeans_1.5.3
[34] GenomicAlignments_1.26.0 prettyunits_1.1.1 cluster_2.1.0
[37] ape_5.4-1 crayon_1.4.1 slam_0.1-48
[40] pkgconfig_2.0.3 labeling_0.4.2 GenomeInfoDb_1.26.2
[43] nlme_3.1-151 rlang_0.4.10 lifecycle_1.0.0
[46] registry_0.5-1 modelr_0.1.8 cellranger_1.1.0
[49] matrixStats_0.57.0 Rhdf5lib_1.12.0 boot_1.3-25
[52] reprex_0.3.0 png_0.1-7 bitops_1.0-6
[55] ROI.plugin.lpsolve_1.0-0 rhdf5filters_1.2.0 Biostrings_2.58.0
[58] ShortRead_1.48.0 jpeg_0.1-8.1 rstatix_0.7.0
[61] S4Vectors_0.28.1 ggsignif_0.6.1 zlibbioc_1.36.0
[64] compiler_4.0.3 RColorBrewer_1.1-2 detectseparation_0.2
[67] Rsamtools_2.6.0 cli_2.5.0 ade4_1.7-16
[70] XVector_0.30.0 TMB_1.7.18 mgcv_1.8-33
[73] tidyselect_1.1.0 stringi_1.5.3 yaml_2.2.1
[76] latticeExtra_0.6-29 ggrepel_0.9.0 tools_4.0.3
[79] parallel_4.0.3 rio_0.5.16 rstudioapi_0.13
[82] foreach_1.5.1 foreign_0.8-81 farver_2.1.0
[85] Rtsne_0.15 digest_0.6.27 GenomicRanges_1.42.0
[88] broom_0.7.6 httr_1.4.2 colorspace_2.0-0
[91] rvest_0.3.6 fs_1.5.0 IRanges_2.24.1
[94] splines_4.0.3 statmod_1.4.35 multtest_2.46.0
[97] xtable_1.8-4 jsonlite_1.7.2 nloptr_1.2.2.2
[100] lpSolveAPI_5.5.2.0-17.7 R6_2.5.0 pillar_1.6.0
[103] htmltools_0.5.0 glue_1.4.2 minqa_1.2.4
[106] BiocParallel_1.24.1 codetools_0.2-18 mvtnorm_1.1-1
[109] utf8_1.2.1 numDeriv_2016.8-1.1 curl_4.3
[112] zip_2.1.1 openxlsx_4.2.3 survival_3.2-7
[115] rmarkdown_2.6 biomformat_1.18.0 munsell_0.5.0
[118] rhdf5_2.34.0 GenomeInfoDbData_1.2.4 iterators_1.0.13
[121] haven_2.3.1 gtable_0.3.0

bryandmartin commented 3 years ago

Hi @amy-briggs,

Thanks for posting this. I haven't been able to reproduce it despite having the same operating system and package info, so I might need to ask some follow up questions to figure out what's going on here.

This issue comes from an error in optimization. Can you try manually (re-)installing the "trust" and "optimr" packages? I'm wondering if they aren't loading properly for some reason.

Bryan

amy-briggs commented 3 years ago

Oh, that worked! I'm so glad it was that simple. Thank you!