Multitrait {BGLR} | R Documentation |

## Multi trait models

### Description

The Multitrait function fits Bayesian multitrait models with arbitrary number of random effects ussing a Gibbs sampler. The data equation is as follows:

y_{j}= 1μ

_{j}+ X

_{Fj}β

_{Fj}+X

_{1}β

_{j1}+ ... +X

_{k}β

_{jk}+ u

_{j1}+ ... + u

_{jq}+ e

_{j},

where:

- y
_{j}is a n-dimensional response vector of phenotypes (NAs allowed) with y_{ij}representing the phenotypic record of the i-th subject for the j-th trait. - μ
_{j}is an intercept. - X
_{Fj}is a matrix of fixed effects. - β
_{Fj}is a vector of fixed effects. - X
_{s}is an incidence matrix for predictors that are common for all individuals (e.g. markers), s=1,...,k. - β
_{js}is a vector of regression coefficients, s=1,..,k. Different priors can be assigned to these regression coefficients (spike-slab and Gaussian) and regression coefficients are correlated across traits. - u
_{jr}is a n-dimensional vector of random effects. - e
_{j}is a n-dimensional vector of residuals.

### Usage

```
Multitrait(y, ETA, intercept=TRUE,resCov = list(df0=5,S0=NULL,type="UN"),
R2=0.5, nIter=1000,burnIn=500,thin=10, saveAt="",verbose=TRUE)
```

### Arguments

`y` |
a matrix of dimension |

`ETA` |
(list) This is a two-level list used to specify the regression function (or linear predictor). Regression on covariates and other types of random effects are specified in this two-level list. For instance: ETA=list(list(X=W, model="FIXED"), list(X=Z,model="BRR"), list(K=G,model="RKHS")) specifies that the linear predictor should include: a linear regression on W with regression coefficients treated as fixed effects (i.e., flat prior), plus regression on Z, with regression coefficients modeled as in the Ridge Regression plus and a random effect with co-variance structure G. |

`intercept` |
logical, if TRUE (default) an intercept is included. |

`nIter` , `burnIn` , `thin` |
(integer) the number of iterations, burn-in and thinning. |

`resCov` |
A list used to define the co-variance matrix for model residuals (R). Four covariance strucures are
supported: i) Unstructured ( resCov=list(type="UN", df0=4, S0=V) specifies an UN-structured covariance matrix, with an Inverse Whishart prior with degree of freedom df0 (scalar) and scale matrix (t x t) V. |

`saveAt` |
(string) this may include a path and a pre-fix that will be added to the name of the files that are saved as the program runs. |

`R2` |
(numeric, |

`verbose` |
(logical) if TRUE the iteration history is printed, default TRUE. |

### Details

*Conditional distribution of the data*

Model residuals are assumed to follow a multivariate normal distribution, with null mean and
covariance matrix Cov((e'_{1},...,e'_{n})')=R_{0} ⊗ I
where R_{0} is a t x t (within-subject) covariance matrix of model residuals
and n-dimensional identity matrix. Therefore:

_{i1},...,y

_{it}| θ )=MN(η

_{i}, R

_{0})

where MN(.,.), denotes the multivariate normal distribution with mean
η_{i} and covariance matrix
R_{0}; here
η_{i} is
a t-dimensional vector whose entries
are the expected values of the response variable for the i-th individual.

*Prior distribution*

The prior distribution is structured hierarchically. The first level of the prior specifies the distribution of the fixed and random effects given the codispersion parameters (the covariance matrices of the random effects, see below). The priors for the codispersion parameters are specified in a deeper level of the hierarchy.

The intercepts and vectors of fixed effects are assigned flat prior (each unknown is assigned a Gaussian prior with null mean and very large variance).

The vectors of random effects u_{r}
are assigned independent multivariate normal priors with null mean and covariance matrices
Cov(u_{r})=G_{r}⊗K_{r},
u_{r} represent the vector of effects for the
r-th random effects (sorted by subject first and trait within subject),
G_{r} is an t x t (within-subject) covariance matrix
of the r-th random effect and K_{r} is
a user defined (between subjects) covariance matrix for the r-th
random effect, for instance, may be a pedigree or marker-based
relationship matrix. The covariance matrix of random effects are assigned Inverse Wishart
priors (for the case of unstructured options) or priors that are structured according to
some model (diagonal, factor analytic or recursive).

The vector or regression coefficients β_{s}
are assigned Gaussian and Spike Slab priors whose
covariance matrixes depend on a Ω_{s}
covariance matrix of dimmensions t x t (within subject).
The covariance matrix of random effects are assigned Inverse Wishart
priors (for the case of unstructured options) or priors that are structured according to
some model (diagonal, factor analytic or recursive).

*Algorithm*

Internally, samples from all the model unknowns are drawn using a Gibbs sampler (i.e., based on fully conditional distributions).

### Value

List containing estimated posterior means and estimated posterior standard deviations.

### Author(s)

Gustavo de los Campos, Paulino Perez-Rodriguez

### References

Burgueno, J., G. de los Campos, K. Weigel and J. Crossa. 2012. Genomic Prediction of Breeding Values when Modelling
Genotype x Environment Interaction using Pedigree and Dense Molecular Markers. *Crop Sci.*, **52(2)**:707-719.

de los Campos, G. and D. Gianola. 2007. Factor analysis models for structuring covariance matrices of additive genetic
effects: a Bayesian implementation. *Genet. Sel. Evol.*, **39**:481-494.

Cheng, H., K. Kadir, J., Zeng, D. Garrick and R. Fernando. 2018. Genomic Prediction from Multiple-Trait
Bayesian Regression Methods Using Mixture Priors. *Genetics*, **209(1)**: 89-103.

Sorensen, D. and D. Gianola. 2002. Likelihood, Bayesian, and MCMC methods in quantitative genetics.
*Springer-Verlag, New York*.

### Examples

```
## Not run:
library(BGLR)
data(wheat)
X<-wheat.X
K<-wheat.A
y<-wheat.Y
#Example 1, Spike Slab regression
ETA1<-list(list(X=X,model="SpikeSlab"))
fm1<-Multitrait(y=y,ETA=ETA1,nIter=1000,burnIn=500)
#Example 2, Ridge Regression
ETA2<-list(list(X=X,model="BRR"))
fm2<-Multitrait(y=y,ETA=ETA2,nIter=1000,burnIn=500)
#Example 3, Random effects with user defined covariance structure
#for individuals derived from pedigree
ETA3<-list(list(K=K,model="RKHS"))
fm3<-Multitrait(y=y,ETA=ETA3,nIter=1000,burnIn=500)
#Example 4, Markers and pedigree
ETA4<-list(list(X=X,model="BRR"), list(K=K,model="RKHS"))
fm4<-Multitrait(y=y,ETA=ETA4,nIter=1000,burnIn=500)
#Example 5, recursive structures for within subject covariance matrix
M1 <- matrix(nrow = 4, ncol = 4, FALSE)
M1[3, 2] <- M1[4, 2] <- TRUE # Adding recursion from trait 2 onto traits 3 and 4
M1[4, 3] <- TRUE # Adding recursion from trait 3 on trait 4
ETA5<-list(list(K=K,model="RKHS",Cov=list(type="REC",M=M1)))
fm5<-Multitrait(y=y,ETA=ETA5,nIter=1000,burnIn=500)
#Example 6, diagonal residual covariance matrix with the predictor
#used in example 5
residual1<-list(type="DIAG")
fm6<-Multitrait(y=y,ETA=ETA5,resCov=residual1,nIter=1000,burnIn=500)
## End(Not run)
```

*BGLR*version 1.1.2 Index]