G.predict {ASRgenomics} | R Documentation |
Generates the conditional predictions of random effects (BLUPs)
Description
Predicts random effects values for individuals with unobserved responses (here called x
,
a vector of length ) based on known random effect values for individuals with
observed responses (here called
y
, a vector of length ). This is done using the
common genomic relationship matrix
for all
individuals (full matrix of dimension
).
The prediction of unobserved responses will be performed through the
multivariante Normal conditional distribution. These predictions are identical to
what would be obtained if the entire set of individuals () were included into a
GBLUP animal model fit with individuals in the set
x
coded as missing.
The user needs to provide the matrix in full form.
Individual names (
) should be assigned to
rownames
and colnames
, and these
can be in any order. If the variance-covariance matrix of the set y
is provided,
standard errors of random effects in set x
are calculated.
Usage
G.predict(G = NULL, gy = NULL, vcov.gy = NULL)
Arguments
G |
Input of the genomic relationship matrix |
gy |
Input of random effects (e.g. breeding values) for individuals with known values.
Individual names should be assigned to |
vcov.gy |
The variance-covariance matrix associated with the random effects from the
individuals with known values (set |
Value
A data frame with the predicted random effect values for individuals with
unobserved responses in the set x
. If the variance-covariance matrix is provided,
standard errors are included in an additional column.
Examples
## Not run:
library(asreml) # Load asreml.
# Example: Apple data creating 100 missing observations.
# Prepare G (nx + ny).
G <- G.matrix(M = geno.apple, method = "VanRaden", sparseform = FALSE)$G
dim(G)
# Prepare subset of data.
# Select only 147 from 247 individuals from pheno.apple and geno.apple.
Gy <- G[1:147, 1:147]
phenoy <- pheno.apple[1:147, ]
# Obtain the BLUPs for the 147 individuals using ASReml-R.
# Blend Gy.
Gyb <- G.tuneup(G = Gy, blend = TRUE, pblend = 0.02)$Gb
# Get the Gy inverse
Gyinv <- G.inverse(G = Gyb, sparseform = TRUE)$Ginv.sparse
# Fit a GBLUP model
phenoy$INDIV <- as.factor(phenoy$INDIV)
modelGBLUP <-
asreml(
fixed = JUI_MOT ~ 1,
random = ~vm(INDIV, Gyinv),
workspace = 128e06,
data = phenoy)
# Obtain Predictions - BLUP (set y).
BLUP <- summary(modelGBLUP,coef = TRUE)$coef.random
head(BLUP)
gy <- as.matrix(BLUP[, 1])
rownames(gy) <- phenoy$INDIV
# Ready to make conditional predictions.
g.cond <- G.predict(G = G, gy = gy)
head(g.cond)
## End(Not run)