synbreed (version 0.12-6)

predict.gpMod:

Description

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.

Usage

# S3 method for gpMod
predict(object,newdata,...)

Arguments

object
object of class gpMod which is the model used for the prediction. If the model includes a relationshipMatrix, this must include both the individuals in the training data used for fitting gpMod and those which sould be predicted in newdata (see example below).
newdata
for model="BL" and "BRR" an object of class gpData with the marker data of the unphenotyped individuals. For model="BLUP" a character vector with the names of the individuals to predict. If newdata=NULL, the genetic performances of the individuals for the training set are returned.
...
not used

Value

a named vector with the predicted genetic values for all individuals in newdata.

Details

For models, model="RR" and "BL", the prediction for the unphenotyped individuals is given by $$\hat{g}'=\hat{\mu} + W'\hat{m}$$ 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.

References

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.

See Also

gpMod

Examples

Run this code
# Example from Henderson (1977)
dat <- data.frame(y=c(132,147,156,172),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
y <- c(132,147,156,172)
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])
## ---------------------------------------------

Run the code above in your browser using DataLab