Closed cdiener closed 4 years ago
Hmm... this might just be an issue with a bad error message. I'll need to check this, but my guess is that it shows that error (and shouldn't) when you run a LRT where the two models are identical. Is that the case in your actual use case as well?
It works as expected when using bbdml
and not differentialTest
.
> mod <- bbdml(reformulate("1", taxa_names(genera)[1]), ~ 1, data=genera)
> lrtest(mod, mod)
[1] 1
Also this was just for illustration. This also happens with sensible formulas and any data set and design formulae I have tried:
> differentialTest(~ DayAmdmt, ~ 1, ~ 1, ~ 1, data=genera, method="LRT")
Error in differentialTest(~DayAmdmt, ~1, ~1, ~1, data = genera, method = "LRT") :
All models failed to converge!
If you are seeing this, it is likely that your model is overspecified. This occurs when your sample size is not large enough to estimate all the parameters of your model. This is most commonly due to categorical variables that include many categories. To confirm this, try running a model for a single taxon with bbdml.
@cdiener Thanks, this might require some more specific debugging to figure out what the issue is, because LRT still seems to be working with my testing data sets. Is there a dataset you would be willing to share with me via email at bmartin6@uw.edu so that I can investigate the issue? If not I'll still work on this but it may take a bit longer to pin down.
The example above is using the the data set that is included in corncob (soil_phylo
) summarized on the genus level (genera <- tax_glom(soil_phylo, "Genus")
). I ran the commands shown above on two different machines with different R (3.6 vs. 4.0.2) and Bioconductor versions (3.10 vs. 3.11) and it fails on both.
To make it easier here is the standalone code to reproduce the issue:
library(corncob)
genera <- tax_glom(soil_phylo, "Genus")
differentialTest(~ DayAmdmt, ~ 1, ~ 1, ~ 1, data=genera, method="LRT")
Ah thanks @cdiener , I see the issue now! method
is a rarely-needed option to specify the optimization algorithm you would like to use. Replace method = "LRT"
with test = "LRT"
and it should fix your issue!
That being said, this should absolutely be a more informative error message, so I will leave this issue open until I fix that.
Oh shoot. My bad. Thanks!
No worries! In all seriousness, this is exactly the type of issue that helps me know where I can make the package more user-friendly, so I appreciate it!
Hi,
recently
differentialTest
always fails for me and wrongly reports that the optimization can not converge. However, the same optimization will work in abbdml
call.Session info: