Hi all,

I'mm running a 4-trait model in MCMCglmm in order to estimate selection on
three traits (the first trait being lifetime reproductive success). The
model gives me 1000 estimates of each of the variance components. I'm
primarily interested in the first 16 components, which make up the 4x4
individual-level VCV matrix, but there are other variance components, some
of which are not fitted to all traits. model$VCV spits this out as an
object with dimensions of 1000xN, where N is the number of VCV components.
Primarily, I would like to convert this into the thousand estimates of my
4x4 individual-level matrix, which I should then be able to use to
calculate selection gradients accounting for correlated selection and have
some measure of error around these estimates. For example, on a single
estimate of a 4x4 VCV matrix:

# matrix of VCV estimates
> I<-as.matrix(cbind(
+ c(1, 1, 0.1, 0.5),
+ c(1, 1, 0.1, 0.1),
+ c(0.1, 0.1, 1, 0.1),
+ c(0.5, 0.1, 0.1, 1)))

# get matrix, minus the trait we're estimating selection through, i.e. LRS
> Ipred<-I[2:4,2:4]
> Ipred
     [,1] [,2] [,3]
[1,]  1.0  0.1  0.1
[2,]  0.1  1.0  0.1
[3,]  0.1  0.1  1.0

# get a vector of covariances between predictors and fitness
> COV<-(I[1,])[2:4]

# calculate selection gradients
>Beta<-ginv(Ipred)%*%COV
> Beta
            [,1]
[1,] -0.03703704
[2,]  0.40740741
[3,]  0.96296296

An added complication is that two of these "traits" are random slopes, but
that will probably have to wait. I think for now my question is a
*relatively* straightforward one- how would I go about obtaining my 1000
4x4 matrices to plug into the above formulas in order to get selection
coefficients with some measure of error? I'd be very grateful if anyone has
any advice.

Best wishes,
Adam



-- 
Adam Hayward
Post-Doctoral Research Associate
Department of Animal and Plant Sciences
Alfred Denny Building
University of Sheffield
Western Bank
Sheffield S10 2TN
UK
http://www.huli.group.shef.ac.uk/adam-personal.html
http://adhayward.wordpress.com/
https://twitter.com/adhayward18

	[[alternative HTML version deleted]]

