predict.gpMod: Prediction for genomic prediction models.

Description Usage Arguments Details Value Author(s) References See Also Examples

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

1
2
## S3 method for class '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

Details

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.

Value

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

Author(s)

Valentin Wimmer

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

 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
# 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])

## End(Not run)

synbreed documentation built on May 2, 2019, 3:23 a.m.