rbayesianmcmcmultivariate-testing

How to properly code a scaled inverse Wishart prior for a MCMCglmm model?


I am running a multivariate model (4 response variables) with two random effects using MCMCglmm(). I am currently using a inverse Wishart prior.

###current set up for prior
prior.miw<-list(R=list(V=diag(4), nu=0.002), 
                G=list(G1=list(V=diag(4), 
                nu=0.002,   
                alpha.mu=c(0,0,0,0), 
                alpha.V=diag(4)*1000),
                G2=list(V=diag(4), #need to repeat to deal with second random effect
                nu=0.002,   
                alpha.mu=c(0,0,0,0), 
                alpha.V=diag(4)*1000)))

Based on my model, it appears I should really run a scaled inverse Wishart prior (see page 14 of Lemoine 2019).

enter image description here

My question: how do I make this into a prior that is suitable for my MCMCglmm() model?

Additionally, if this is NOT the sort of prior I should be running, please feel free to weigh in.


Solution

  • This is a two-part question:

    The general trick is to decompose the covariance matrix into a multivariate component (the correlation matrix or inverse correlation matrix or something) and a vector of scaling parameters for the standard deviations (or inverse standard deviations); Lemoine suggests U(0,100) for the scaling priors, which I think is bad (why flat? I can't get to the precise page of Gelman and Hill 2007 where they discuss which distribution to use for scaling priors ... but I would be a little surprised if they actually recommended a uniform distribution on the variance scale ...)

    update having actually looked at your code (!): I think you're doing the right thing, except that nu=0.002 seems really extreme; see end for that discussion.

    This is basically what MCMCglmm does, but it uses a different (IMO better) choice for the scaling priors. It sounds scary:

    These priors are all from the non-central scaled F-distribution, which implies the prior for the standard deviation is a non-central folded scaled t-distribution (Gelman, 2006).

    but it boils down to choosing four parameters, only two of which you really have to think about.

    For the univariate case Hadfield says the t prior with V=1 is

    2 * dt(sqrt(v)/sqrt(alpha.V), df = nu, 
           ncp = alpha.mu/sqrt(alpha.V))
    

    with v restricted to be zero.

    I wish Hadfield had given an example of parameter expansion in a multivariate inverse-Wishart case. Where did you find yours?


    I think nu=0.002 is a dangerous choice. Why?

    It's tempting to make your priors "as flat as possible", but this has two potentially bad consequences.