Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/predict.gpMod.r
S3 predict
method for objects of class gpMod
. A genomic
prediction model is used to predict the genetic performance for e.g.
unphenotyped individuals using an object of class gpMod
estimated by
a training set.
1 2 |
object |
object of class |
newdata |
for |
... |
not used |
For models, model="RR"
and "BL"
, the prediction for the
unphenotyped individuals is given by
ghat=muhat + W mhat
with the estimates taken from the
gpMod
object. For the prediction using model="BLUP"
, the full
relationship matrix including individuals of the training set and the
prediction set must be specified in the gpMod
. This model is used to
predict the unphenotyped individuals of the prediction set by solving the
corresponding mixed model equations using the variance components of the fit
in gpMod
.
a named vector with the predicted genetic values for all individuals
in newdata
.
Valentin Wimmer
Henderson C (1977) Best linear unbiased prediction of breeding values not in the model for records. Journal of Dairy Science 60:783-787
Henderson CR (1984). Applications of linear models in animal breeding. University of Guelph.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # Example from Henderson (1977)
y <- c(132, 147, 156, 172)
dat <- data.frame(y = y, time = c(1, 2, 1, 2), row.names = c("ID1", "ID2", "ID3", "ID4"))
ped <- create.pedigree(
ID = c("ID6", "ID5", "ID1", "ID2", "ID3", "ID4"),
Par1 = c(0, 0, "ID5", "ID5", "ID1", "ID6"),
Par2 = c(0, 0, 0, 0, "ID6", "ID2")
)
gp <- create.gpData(pheno = dat, pedigree = ped)
A <- kin(gp, ret = "add")
# assuming h2=sigma2u/(sigma2u+sigma2)=0.5
# no REML fit possible due to the limited number of observations
names(y) <- paste("ID", 1:4, sep = "")
mod1 <- list(fit = list(sigma = c(1, 1),
X = matrix(1, ncol = 1, nrow = 4)),
kin = A, model = "BLUP", y = y, m = NULL)
# matrix A included all individuals (including those which should be predicted)
class(mod1) <- "gpMod"
predict(mod1, c("ID5", "ID6"))
# prediction 'by hand'
X <- matrix(1, ncol = 1, nrow = 4)
Z <- diag(6)[-c(1, 2), ]
AI <- solve(A)
RI <- diag(4)
res <- MME(X, Z, AI, RI, y)
res$u[1:2]
## Not run:
# prediction of genetic performance of the last 50 individuals in the maize data set
data(maize)
maizeC <- codeGeno(maize)
U <- kin(maizeC, ret = "realized")
maizeC2 <- discard.individuals(maizeC, rownames(maizeC$pheno)[1201:1250])
modU <- gpMod(maizeC2, model = "BLUP", kin = U)
predict(modU, rownames(maizeC$pheno)[1201:1250])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.