synbreed (version 0.12-6)

MME:

Description

Set up Mixed Model Equations for given design matrices, i.e. variance components for random effects must be known.

Usage

MME(X, Z, GI, RI, y)

Arguments

X
Design matrix for fixed effects
Z
Design matrix for random effects
GI
Inverse of (estimated) variance-covariance matrix of random (genetic) effects multplied by the ratio of residual to genetic variance
RI
Inverse of (estimated) variance-covariance matrix of residuals (without multiplying with a constant, i.e. \(\sigma^2_e\))
y
Vector of phenotypic records

Value

A list with the following arguments
b
Estimations for fixed effects vector
u
Predictions for random effects vector
LHS
left hand side of MME
RHS
right hand side of MME
C
Generalized inverse of LHS. This is the prediction error variance matrix
SEP
Standard error of prediction for fixed and random effects
SST
Sum of Squares Total
SSR
Sum of Squares due to Regression
residuals
Vector of residuals

Details

The linear mixed model is given by $$\bf y = \bf X \bf b + \bf Z \bf u + \bf e $$ with \(\bf u \sim N(0,\bf G)\) and \(\bf e \sim N(0,\bf R)\). Solutions for fixed effects \(b\) and random effects \(u\) are obtained by solving the corresponding mixed model equations (Henderson, 1984) $$\left(\begin{array}{cc} \bf X'\bf R^{-1}\bf X & \bf X'\bf R^{-1}\bf Z \\ \bf Z'\bf R^{-1}\bf X & \bf Z'\bf R^{-1}\bf Z + \bf G^{-1} \end{array}\right) \left(\begin{array}{c} \bf \hat b \\ \bf \hat u \end{array}\right) = \left(\begin{array}{c}\bf X'\bf R^{-1} \bf y \\ \bf Z'\bf R^{-1}\bf y \end{array}\right)$$ Matrix on left hand side of mixed model equation is denoted by LHS and matrix on the right hand side of MME is denoted as RHS. Generalized Inverse of LHS equals prediction error variance matrix. Square root of diagonal values multiplied with \(\sigma^2_e\) equals standard error of prediction. Note that variance components for fixed and random effects are not estimated by this function but have to be specified by the user, i.e. \(G^{-1}\) must be multiplied with shrinkage factor \(\frac{\sigma^2_e}{\sigma^2_g}\).

References

Henderson, C. R. 1984. Applications of Linear Models in Animal Breeding. Univ. of Guelph, Guelph, ON, Canada.

See Also

regress, crossVal

Examples

Run this code
## Not run: ------------------------------------
# library(synbreedData)
# data(maize)
# 
# # realized kinship matrix
# maizeC <- codeGeno(maize)
# U <- kin(maizeC,ret="realized")/2
# 
# # solution with gpMod
# m <- gpMod(maizeC,kin=U,model="BLUP")
# 
# # solution with MME
# diag(U) <- diag(U) + 0.000001  # to avoid singularities
# # determine shrinkage parameter
# lambda <- m$fit$sigma[2]/ m$fit$sigma[1]
# # multiply G with shrinkage parameter
# GI <- solve(U)*lambda
# y <- maizeC$pheno[,1,]
# n <- length(y)
# X <- matrix(1,ncol=1,nrow=n)
# mme <- MME(y=y,Z=diag(n),GI=GI,X=X,RI=diag(n))
# 
# # comparison
# head(m$fit$predicted[,1]-m$fit$beta)
# head(mme$u)
## ---------------------------------------------

Run the code above in your browser using DataCamp Workspace