Help with adding a prior for a phylogeny covariance matrix

I am trying to provide a prior for my phylogeny in a brms model. I model the phylogeny following vignette(“brms_phylogenetics”) code bellow:

A <-ape::vcv.phylo(my_tree)
model <- brm(
binary_variable ~ 1 + covariate + (1 | dataset) + (1 | gr(taxo, cov = A)),
data = data,
family = bernoulli(),
data2 = list(A=A)

I have read in the literature and seen the recommendations for an LKJ prior on correlation matrices though I do not fully understand how to apply it to a covariance matrix. I believe the lkj prior is only appropriate for class “cor” which is not applicable in this model.
If there is any advice on how to add a prior for the phylogenetic covariance matrix that would be really helpful. At present I think I may have to convert A into a correlation matrix, perhaps using a cholesky decomposition but then I do not know how to incorporate this into the model.

Any advice v.appreciated


1 Like

Hi Tom,

In these phylogenetic regression models the correlation or covariance matrix is the phylogenetic tree that was estimated in another program (from molecular or morphological data). It is fixed, and the model doesn’t estimate it. If you followed the instructions from the brms phylo vignette like you did above, the tree should be in the proper vcv format for the model. The class cor comes up if you are estimating correlations IN the model, such as between response variables in a multivariate model, unique slopes for each level of a group level effect, or some other situations.

So for the model you posted, you’re good to go!

1 Like

Excellent, thanks alot!