JClavel / mvMORPH

mvMORPH: an R package for fitting multivariate evolutionary models to morphometric data
17 stars 5 forks source link

mvOU with count data - How to correctly model error structure? #5

Closed CamilleAnna closed 4 years ago

CamilleAnna commented 4 years ago

Hi,

In classic linear model, the distribution of the response, conditional on the model, is normally distributed. This assumption is relaxed in Generalised Linear Models by specifying the distribution of the response variable conditional on the model. For example for integer positive variable (like count data) the model is y ~ Pois(exp(Xb)). Said otherwise one must correctly specify the error structure.

I would like to use mvMORPH (mvOU in particular) to model data where one trait is continuous (continuous morphological trait) but the other is count data (a number of genes involved in a given metabolic function). I am not sure that this consideration still matter in OU/VAR models (I dont' see why it wouldn't thought?). If it does, is there a way to correctly parametrise/specify the model in mvOU function to correctly model the error structure and account for the difference in the error structure term for the two traits?

In classic data analysis packages (glm, MCMCglmm) there is a "family" argument where one can specify the family for each trait. But I could not really figure out from the source codes of these packages how this family argument is used exactly.

I hope this makes sense, Thank you, Camille

EDIT This is really out of my ground so this might be non-sense but I am wondering if the answer could lie somewhere in getting the returned log-likelihood function, and re-use it to optimise the parameters in an algorithm where I somehow specify the correct error structure...?

JClavel commented 4 years ago

Dear Camille,

Thanks for your email. The mvOU function is not a regression model (you don’t have a response and predictor – although you can parameterize the “alpha” matrix to set a directional dependence). The goal of the function is to fit a (gaussian) process that describes how the traits have co-evolved on a phylogenetic tree.

Unfortunately, the only regression model implemented for now in mvMORPH is a GLS (function mvgls) which represents a specific case of the GLM (or more precisely the GLMM) model [one where the errors are assumed to be gaussian]. The “regularized” mvglm (or rather mvglmm) function will hopefully come soon but still need some more tests and developments because there are no closed form solutions to the parameter estimates for the others distribution “families” (e.g., poisson, binomial…). I can warn you once this will be done.

Another “temporary” solution is to tweak the current mvMORPH version to retrieve the vcv matrix of the process and plug it into another glmm package…

Best wishes,

Julien


De : CSimonet notifications@github.com Envoyé : dimanche 23 février 2020 16:33 À : JClavel/mvMORPH mvMORPH@noreply.github.com Cc : Subscribed subscribed@noreply.github.com Objet : [JClavel/mvMORPH] mvOU with count data - How to correctly model error structure? (#5)

Hi,

In classic linear model, the distribution of the response, conditional on the model, is normally distributed. This assumption is relaxed in Generalised Linear Models by specifying the distribution of the response variable conditional on the model. For example for integer positive variable (like count data) the model is y ~ Pois(exp(Xb)). Said otherwise one must correctly specify the error structure.

I would like to use mvMORPH (mvOU in particular) to model data where one trait is continuous (continuous morphological trait) but the other is count data (a number of genes involved in a given metabolic function). I am not sure that this consideration still matter in OU/VAR models (I dont' see why it wouldn't thought?). If it does, is there a way to correctly parametrise/specify the model in mvOU function to correctly model the error structure and account for the difference in the error structure term for the two traits?

In classic data analysis packages (glm, MCMCglmm) there is a "family" argument where one can specify the family for each trait. But I could not really figure out from the source codes of these packages how this family argument is used exactly.

I hope this makes sense, Thank you, Camille

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/JClavel/mvMORPH/issues/5?email_source=notifications&email_token=ACSCJSMN5RC2J7JO5KEJUFTREKJLPA5CNFSM4KZ3QAA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IPSCIYQ, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACSCJSM76D34I57EXCXKCULREKJLPANCNFSM4KZ3QAAQ.

CamilleAnna commented 4 years ago

Hi,

thanks for your very clear reply, it does answer my question. I will keep an eye open on the future mvglmm.

Best, Camille