Skip to content

MCMCglmm covariance matrix specification

4 messages · Walid Mawass, Srivats Chari, Jarrod Hadfield

#
Hey all,

Hope you are doing well during this time!

I have been racking my brain for weeks on how to do model this issue but I
have found nothing other than one old answer by Jarrod Hadfield (
https://stat.ethz.ch/pipermail/r-sig-mixed-models/2015q4/024036.html) which
recommends using an antedepedence model. Here is the issue:

I have constructed a bivariate animal model (trait1, trait2) with a random
interaction with the additive genetic random effect and the residual
variance,i.e. (trait:env):animal. The interaction variable is a categorical
environmental variable of 3 levels (Low, Mid, High). So my
variance-covariance matrix has a 6x6 shape (2traitsx3env). Hence, the
matrix would include both among-trait covariances within the same env and
between env, and cross-env covariances for the same trait:

trait1:low trait1:mid trait1:high trait2:low trait2:mid trait2:high
1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 1
(1 represent variances, 0 represent covariances)

I have already run the model with both the idh() and us() specification. In
the first case, no covariances are calculated at all, only variances are
calculated. In the second case, all types of covariances are calculated.

I need help figuring out how to specify the variance-covariance matrix in
MCMCglmm (and prior) in a way to tell the model not to estimate the
cross-env covariances, only the among-trait covariances should be
estimated:
trait1:low trait1:mid trait1:high trait2:low trait2:mid trait2:high
1 x x 0 x x
x 1 x x 0 x
x x 1 x x 0
0 x x 1 x x
x 0 x x 1 x
x x 0 x x 1
(1 represent variances, 0 represent covariances to be estimated, x
represent covariances fixed at 0, i.e. not estimated)

any help would be appreciated!
#
Hey Walid,

I had a similar problem a few months ago, I didn't want 1 trait to have any
covariance. I was not able to find a solution to it but after reading
several articles, I figured out a way.

Instead of not calculating the covariances at all (which I am not sure if
it's possible), you can set the value to 0 in the prior.

Here is my example-
I have 9 traits and I do not want my last trait to covary with any other
trait. Hence I set it to a very low value (0.001) for the within individual
covariance and use the fix command to specify which trait it is (in this
instance  my 9th trait).

final_priorv1 <- list(R = list(V =diag(c(1,1,1,1,1,1,1,1,0.001),9,9), nu =
0.002, fix = 9),
                      G = list(G1 = list(V = diag(9), nu = 9,
                                         alpha.mu = rep(0, 9),
                                         alpha.V  = diag(25^2,9,9))))

Remember this is within individual variance set to 0.001, you will still be
calculating the among individual covariance.

Found this solution from Dr. Houslay's MCMCGlmm Tutorial page 14. Link
here-->
https://tomhouslay.files.wordpress.com/2017/02/indivvar_mv_tutorial_mcmcglmm.pdf
Something similar from his other tutorial page 31-->
https://tomhouslay.files.wordpress.com/2017/02/indivvar_plasticity_tutorial_mcmcglmm1.pdf

With this prior, I was able to use the unstructured (us) covariance matrix
and I was able to get what I needed.

I feel what you are looking for is fairly similar, and I believe this
solution might work for you.

 Happy coding!

Regards,
Srivats.

Srivats Chari
<https://sites.google.com/ucd.ie/wildl-ecol-behav-at-ucd/people#h.p_DyWP_UxHDqgq>
Post-Graduate Research Student
Twitter- @WildlifeVats <https://twitter.com/WildlifeVats>

Laboratory of Wildlife Ecology and Behaviour
<https://sites.google.com/ucd.ie/wildl-ecol-behav-at-ucd>
School of Biology and Environmental Science (SBES),
University College Dublin (UCD).


On Wed, Feb 24, 2021 at 6:29 PM Walid Crampton-Mawass <
walidmawass10 at gmail.com> wrote:

            

  
  
#
Hi,

As I understand it you have 3 2x2 covariance matrices to be estimated,
one for each environment?

~us(at.level(env, 1):trait):animal+us(at.level(env,
2):trait):animal+us(at.level(env, 3):trait):animal

should work. I presume you have no shared pedigree between the
envrionments hence the cross-env covariances are not estimable? In the
computation time is long, get back to me; there are ways to
reparameterise it to make it faster but it's a bit fiddly.

For harder problems (where the covariance matrix can't be permuted such
that the estimable bits fall in blocks along the diagonal, as here) then
fixing elements to zero is probably not a good idea even if you could do
it (for example in asreml). The zero elements will force patterns in the
estimable elements to ensure positive-defitness. The antedependence
solution I posted earlier gets round this issue I believe.

Cheers,

Jarrod
On 24/02/2021 18:29, Walid Crampton-Mawass wrote:
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th? ann an Oilthigh Dh?n ?ideann, cl?raichte an Alba, ?ireamh cl?raidh SC005336.
#
Hi Jarrod,

Actually, I do have a shared pedigree and the cross-env covariances were
estimable. The goal of this analysis is to see if precision improves in any
way if I can set cross-env covariances to zero using the initial way my
matrices were constructed which is simply: ~us(env:trait):animal - which
includes cross-env covariances

I will try your proposal and get back to you. Though, I am thinking that a
model that does include cross-env covariances in my covariance matrix would
be a better choice so as to analyse cross-env genetic correlations (unless
I can still do that with your approach)

Thanks!