Hi all,
I have been thinking about implementing phylogenetic models in brms using alternatives to Brownian motion, including (but not limited to) Ornstein-Uhlenbeck. I see that including an OU kernel for modeling gaussian processes is planned (Add more Gaussian process kernels · Issue #234 · paul-buerkner/brms · GitHub), but isn’t available yet.
Since with brms I have been taking the approach of setting the phylogenetic variance-covariance matrix via a grouping term (as described in the brms phylogenetics vignette Estimating Phylogenetic Multilevel Models with brms), I wonder if first rescaling the branch lengths using an OU (or other) transformation would approximate the structure?
What I mean is, instead of this:
phylo <- ape::read.nexus("https://paul-buerkner.github.io/data/phylo.nex")
data_simple <- read.table(
"https://paul-buerkner.github.io/data/data_simple.txt",
header = TRUE
)
A <- ape::vcv.phylo(phylo)
model_simple <- brm(
phen ~ cofactor + (1|gr(phylo, cov = A)),
data = data_simple,
family = gaussian(),
data2 = list(A = A),
iter = 100
)
)
(from the brms vignette)
modify the tree branch lengths first, to fit OU expectations:
library(geiger)
rescale_phylo <- rescale(phylo, "OU", alpha = 1, sigsq = 1)
A_rescale <- ape::vcv.phylo(rescale_phylo)
model_rescale <- brm(
phen ~ cofactor + (1|gr(phylo, cov = A_rescale)),
data = data_simple,
family = gaussian(),
data2 = list(A_rescale = A_rescale),
iter = 100
)
)
I suspect this is a naive question and that there is something I’m missing with respect to the variance structure in the model since the kernels seem to differ in taking the square of the distance. (For one thing, I don’t entirely understand the difference in the implementation of the vcv matrix as a grouping term (as in the vignette) vs. as described in terms of a gaussian process in Statistical Rethinking with brms (14 Adventures in Covariance | Statistical rethinking with brms, ggplot2, and the tidyverse: Second edition).)
I would appreciate any thoughts on whether or not this is a reasonable approach, and what I might be missing!