Skip to content
Prev 14226 / 20628 Next

Specifying a model with a link function in MCMCglmm

Hi Sam,

Priors for covariance matrices are tricky but having nu=k (where k is 
the dimension of the matrix) is not a good idea. I tend to use parameter 
expanded priors of the form

list(V=diag(k), nu=k, alpha.mu=rep(0,k), alpha.V=diag(k)*1000)

The marginal priors for the variances are scaled F(1,1), but I'm not 
sure what they are for the covariances/correlation. For correlations I 
think it would be flatish but with peaks close to -1 and 1. Upping 
nu=k+2 probably makes the marginal prior for the correlation close to 
uniform over the -1/1 interval. Unfortunatley there seems to be little 
or no theoretical work on this prior in a multivariate context: I use it 
because it *seems* to have nice properties. For exampe, if I fitted a 
set of random effects which in reality are all zero, then it gives 
posterior support for the correlation across the range -1/1.

I would also add that I don't attempt to fit k>2 covariance matrices 
unless my data are up to the task.

Cheers,

Jarrod

k<-2
Ve<-rIW(diag(k), 10)
y<-MASS::mvrnorm(100, rep(0,k), Ve)
rfac<-gl(25,4)

#  the data are simply y~MVN(0, Ve)

my_data<-data.frame(y1=y[,1], y2=y[,2], rfac=rfac)

prior1<-list(R=list(V=diag(k), nu=0), G=list(G1=list(V=diag(k), nu=k, 
alpha.mu=rep(0,k), alpha.V=diag(k)*1000)))

m1<-MCMCglmm(cbind(y1,y2)~trait-1, random=~us(trait):rfac, 
rcov=~us(trait):units, data=my_data, prior=prior1,family=rep("gaussian", k))

hist(m1$VCV[,2]/sqrt(m1$VCV[,1]*m1$VCV[,4]), breaks=30)
# posterior correlation of the random effects: nice

prior2<-list(R=list(V=diag(k), nu=0), G=list(G1=list(V=diag(k), nu=k)))

m2<-MCMCglmm(cbind(y1,y2)~trait-1, random=~us(trait):rfac, 
rcov=~us(trait):units, data=my_data, prior=prior2,family=rep("gaussian", k))

hist(m2$VCV[,2]/sqrt(m2$VCV[,1]*m2$VCV[,4]), breaks=30)
# bad - look at the variances too!
On 18/02/2016 17:57, Sam H wrote:
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20160219/69af2092/attachment.pl>