WGR3 (MV) {bWGR}R Documentation

Multivariate Regression

Description

Multivariate model to find breeding values.

Usage

  mkr(Y,K)
  mrr(Y,X)

Arguments

Y

Numeric matrix of observations x trait. NA is allowed.

K

Numeric matrix containing the relationship matrix.

X

Numeric matrix containing the genotyping matrix.

Details

The model for the kernel regression (mkr) is as follows:

Y = Mu + UB + E

where Y is a matrix of response variables, Mu represents the intercepts, U is the matrix of Eigenvector of K, b is a vector of regression coefficients and E is the residual matrix.

The model for the ridge regression (mrr) is as follows:

Y = Mu + XB + E

where Y is a matrix of response variables, Mu represents the intercepts, X is the matrix of genotypic information, B is the matrix of marker effects, and E is the residual matrix.

Algorithm: Residuals are assumed to be independent among traits. Regression coefficients are solved via a multivaraite adaptation of Gauss-Seidel Residual Update. Variance and covariance components are solved with an efficient variation of EM-REML.

Other related implementations:

01) mkr2X(Y,K1,K2): Solves multi-trait kernel regressions with two random effects.

02) mrr2X(Y,X1,X2): Solves multi-trait ridge regressions with two random effects.

03) mrrR(Y,X): Variation of mrr that assumes correlated residuals.

Value

Returns a list with the random effect covariances (Vb), residual variances (Ve), genetic correlations (GC), matrix with marker effects (b) or eigenvector effects (if mkr), intercepts (mu), heritabilities (h2), and a matrix with fitted values (hat).

Author(s)

Alencar Xavier

Examples

  ## Not run: 
    
    # Load data and compute G matrix
    data(tpod)
    gen = CNT(gen)
    K = tcrossprod(gen)
    K = K/mean(diag(K))
    
    # Phenotypes: 3 traits correlated r=0.5
    G0 = 0.5+diag(0.5,3) 
    G = kronecker(G0,K)
    diag(G)=diag(G)+0.001
    L = chol(G)
    TBV = crossprod(L,rnorm(196*3))
    Y = rnorm(196*3,10+TBV,sd(TBV))
    Phe = matrix(Y,ncol=3)
    TBV = matrix(TBV,ncol=3)
    
    # Fit kernel and regression models
    test1 = mkr(Phe,K)
    test2 = mrr(Phe,gen)
    
    # Genetic correlation
    test1$GC
    test2$GC
    
    # Heritabilies
    test1$h2
    test2$h2
    
    # Goodness of fit
    diag(cor(TBV,test1$hat))
    diag(cor(TBV,test2$hat))
    
    
  
## End(Not run)

[Package bWGR version 1.6.5 Index]