TheoreticalEcology / s-jSDM

Scalable joint species distribution modeling
https://theoreticalecology.github.io/s-jSDM/
GNU General Public License v3.0
63 stars 14 forks source link

Phylogeny #58

Open MaximilianPi opened 3 years ago

MaximilianPi commented 3 years ago

I got a question from a user how to include a phylogenetic distance matrix. At some point we have to finally tackle this problem. At the moment I can think of two options: a) phylogenetic distance matrix as a kind of species-species "prior" on the env weights b) treat phylogenetic eigenvectors as traits and fit a fourth-corner-model (as they do in the gllvm pkg: see )

florianhartig commented 3 years ago

I think the most common PGLS structure would be to fit the phylogenetic RE not on the effects, but first simply on the residuals, i.e.

y ~ env + E_phyl

Technically, this is identical to the spatial CAR than Andreas tried to implement, except that it is correlated in species and not in sites, and parameterized by phylogenetic distance.

This idea can be extended to a random slope model with a phylogenetic correlation on the RE, but I have rarely seen this, not sure how common this is.

Question is if we should allow this additional to the species - species association. I think it might be possible to fit both, the the species-species structure would basically measure deviations of the phylogenetic structure, but for me this is a case where I feel we should not create too many options to the user, or else it might get cofusing. Maybe the solution would be to add a module for CAR structures or structured REs to the model, then this can cover space + phylo.

About priors / weights on env etc.: hmm .... the technically clean solution would probably be to have structured REs on everything, but this will be a lot of work.

phylogenetic eigenvectors: this seems to be a low-hanging fruit, as we have to do nothing, just add a help to explain how to do this, right?

OndroV commented 7 months ago

Hello,

is there anything new in this regard? ( Search of "phylo" or "phylogeny" finds only this thread, maybe @fbkarsdorp 's question is related as well)

It would be nice to group species / OTUs by phylogeny or other parameters (ecological, morphological traits...). If it is already possible as @florianhartig said, I'd be very grateful for explanation in help.

Best, Ondrej

florianhartig commented 7 months ago

There is nothing new. But @OndroV, regarding your question: it depends on what you want to do. With the current sjSDM version, there are no specific distance-weighted REs or something like that, but there are standard things that you can do with any regression model, e.g.

Cheers Florian