daijiang / phyr

Functions for phylogenetic analyses
https://daijiang.github.io/phyr/
GNU General Public License v3.0
30 stars 10 forks source link

predicted values with INLA #50

Open arives opened 4 years ago

arives commented 4 years ago

Russell,

While updating rr2, I found that the bayes=T version of pglmm returns the "nearest_node" predicted values even when the "tip_rm" option is used. Is there a structural reason for this? For R2_pred, the "tip_rm" option makes more sense.

Thanks, Tony

daijiang commented 4 years ago

Here is the function. https://github.com/daijiang/phyr/blob/master/R/pglmm-utils.R#L904-L911

rdinnager commented 4 years ago

Thanks Daijiang for the reminder. Looks like I chose to ignore the gaussian.pred option. I think it was because I didn't really know what those two options meant (still not sure), I just wanted to get it working, and planned to come back to it later. But then I forgot to. Could you explain briefly what tip_rm means? Or point to somewhere where it is explained? If it requires predicting with new data, my implementation currently can't do this, but I have been meaning to update it so that it can.

daijiang commented 4 years ago

Russell, tip_rm means removing a record (sort of like remove a tip species from a phylogeny) and then using the remaining data to predict the value. nearest_node means after removing the record, make prediction for the most common ancestor instead of itself. @arives probably can correct me and explain better here.

arives commented 4 years ago

Daijiang and Russell,

Your explanation of tip_rm matches mine, but I think the prediction of nearest_node includes all of the tip values. I don't think I wrote this code, but maybe I did. Performing the nearest_node prediction with all data is equivalent to what you would do for a random effect – predict the value of the random effect from all data. The problem with phylogenies is that the branch length between tips and nearest nodes can be very short.

I'm not exactly sure what INLA is doing, but the values I get are similar to nearest_node as described above when bayes = F.

Cheers, Tony

From: Daijiang Li notifications@github.com Reply-To: daijiang/phyr reply@reply.github.com Date: Thursday, June 18, 2020 at 6:51 PM To: daijiang/phyr phyr@noreply.github.com Cc: "Anthony R. Ives" arives@wisc.edu, Mention mention@noreply.github.com Subject: Re: [daijiang/phyr] predicted values with INLA (#50)

Russell, tip_rm means removing a record (sort of like remove a tip species from a phylogeny) and then using the remaining data to predict the value. nearest_node means after removing the record, make prediction for the most common ancestor instead of itself. @ariveshttps://github.com/arives probably can correct me and explain better here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/daijiang/phyr/issues/50#issuecomment-646360830, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYX6LESOICEDLFWGILDUTTRXKR7BANCNFSM4OAYVZZQ.