Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for phyr::pglmm #235

Open
florianhartig opened this issue Jan 29, 2021 · 5 comments
Open

Support for phyr::pglmm #235

florianhartig opened this issue Jan 29, 2021 · 5 comments
Milestone

Comments

@florianhartig
Copy link
Owner

florianhartig commented Jan 29, 2021

A user requests support for https://github.com/daijiang/phyr, developed by @daijiang

Perspective for this request: It seems that phyr is implementing a simulate function quite similar to lme4, so in principle, it should be possible to support phyr. In practice, I don't know how fast I will manage to do this.

Interim solution take your fitted model, simulate new data (using simulate), and feed this into createDHARMa - this will allow you to use most DHARMa functions. A code example is here. The vignette has some further comments / examples on creating custom simulation functions and reading them into DHARMa.

Note also that, in principle, you can also fit phylogenetic GLMMs with glmmTMB (which is fully supported).

@daijiang
Copy link

Thanks @florianhartig

phyr works with DHARMa thanks to @rdinnager, though with limited implementation at this moment. See an example here: https://daijiang.github.io/phyr/articles/phyr_example_empirical.html#model-assumption-checks-1

@florianhartig
Copy link
Owner Author

Hi @daijiang , thanks for the info, I didn't know that it works already. I'll check this out in more detail and see if we can make the support more "official". Cheers, F

@florianhartig
Copy link
Owner Author

@florianhartig florianhartig added this to the 0.3.4 milestone Feb 3, 2021
@florianhartig florianhartig modified the milestones: 0.3.4, 0.3.5 Feb 16, 2021
@florianhartig florianhartig modified the milestones: 0.5.0, 0.4.2 Apr 8, 2021
@florianhartig florianhartig modified the milestones: 0.4.2, 0.4.4 Jul 17, 2021
@florianhartig florianhartig modified the milestones: 0.4.4, 0.5.0 Aug 24, 2021
@florianhartig
Copy link
Owner Author

So, as reported in #377, this doesn't seem to be working for Models with with Bayes / INLA.

Based on a quick check, I suspect the problem is that there is no explicit simulate function for pglmm objects - for the MLE fits, the simulate probably still works because the structure of the object is such that falling back on the R default simulate function works - probably this is not the case any more if models are fit with INLA.

@daijiang - what I would propose is to provide an explicit simulate function (i.e. simulate.pglmm) in phyr. This function would then hide the problem that different objects may be underlying for other packages. In principle, it should be possible to simulate from INLA models as well.

@daijiang
Copy link

daijiang commented May 1, 2023

Thanks! We will take a look at it later and will follow up on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants