[R-sig-ME] prior error in mcmcglmm multi-response model

Walid Crampton-Mawass w@||dm@w@@@10 @end|ng |rom gm@||@com
Fri Jul 17 00:54:03 CEST 2020


Hello Victor,

The solution to your problem is in the syntax of the formula you wrote. You
provided a multivariate prior but the syntax you wrote for the random and
residual effects were still univariate. The proper way of writing your
model would this way:

modelTrait<-MCMCglmm(cbind(Trait1,Trait2, Trait3,Trait4,Trait5, Trait6,
Trait7, Trait8)~ trait -1 + trait:year+trait:pit,random= ~us(trait):ID+
us(trait):Dam ,ginverse=list(ID=Ainv1,
Dam=M1),family=rep("gaussian",8),prior=priorsd, , rcov=~us(trait):units,
data=data,nitt=10000,burnin=1000,thin=10)

One important note here is the usage of us() which builds an unstructured
covariance matrix for your random and residual effects meaning it will
calculate the covariances between the response traits for these parameters
- which is something I presume you would want to calculate. If not, and you
already know there is no covariances between the response traits, then you
can just replace us() with idh().

Last remark would be to suggest increasing the nitt and thin as to give the
algorithm more time to estimate the multiple posterior distributions for
the included parameters in your model - 10000 iterations is a low number in
my opinion, especially if your dataset is not that large and you have a
limited number of predictors.

Cheers

Walid Mawass
Ph.D. student in Evolutionary Biology at Université du Québec à
Trois-Rivières

On Thu., Jul. 16, 2020, 2:18 p.m. Victor Oribamise, <
victor.oribamise using gmail.com> wrote:

> Hello,
>
> I tried running this multi-response model in mcmcglmm with this prior:
>
> priorsd <- list(R=list(V=diag(8), nu=7.001), G = list(G1 =
> list(V=diag(8),nu=7.001), G2 = list(V=diag(8),nu=7.001)))
>
> and this model:
>
> modelTrait<-MCMCglmm(cbind(Trait1,Trait2, Trait3,Trait4,Trait5, Trait6,
> Trait7, Trait8)~year+pit,random= ~ID+Dam ,ginverse=list(ID=Ainv1,
> Dam=M1),family=rep("gaussian",8),prior=priorsd, , rcov=~units,
> data=data,nitt=10000,burnin=1000,thin=10)
>
>
> but I ran into this error:
>
>
> "Error in priorformat(if (NOpriorG) { :V is the wrong dimension for some
> prior$G/prior$R elements."
>
>
> What am I doing wrong? How do I correct this?
>
>
> And, this is a subset of my data:
>
>
> Trait1 Trait2 Trait3 Trait4 Trait5 Trait6 Trait7 Trait8 year pit
> 1 1 1 1 1 1 1 1 1954 1
> 1 1 1 1 1 1 1 1 1956 2
> 1 1 1 1 1 1 1 1 1957 2
> 1 1 1 1 1 1 1 1 1957 1
> 1 1 1 1 1 1 1 0 1978 2
> 1 1 1 1 1 1 1 1 1978 2
>
> Thanks.
>
>
> Victor
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list