crossVal(gpData, trait=1, cov.matrix = NULL, k = 2, Rep = 1, Seed = NULL,
sampling = c("random", "within popStruc", "across popStruc","commit"),
TS=NULL,ES=NULL, varComp = NULL, popStruc = NULL, VC.est = c("commit",
"ASReml","BRR","BL"),verbose=FALSE,...)gpDatanumeric or character. The name or number of the trait in the gpData object to be used as trait.list including covariance matrices for the random effects. Size and order of rows and columns should be equal to rownames of y.
If no covariance is given, an identity matrix and marker genotypes are used for a marker regression.numeric. Number of folds for k-fold cross validation, thus k should be in [2,nrow(y)] (default=2).numeric. Number of replications (default = 1).numeric. Number for set.seed() to make results reproducable."random", "within popStruc" or "across popStruc". If sampling is "commit" test sets have to specified in TS (see Details).id.TS .vector of variance components for the random effects, which has to be specified if VC.est="commit". The first variance components should be
the same order as the given covariance matrices, the last given variance component is nrow(y) assigning individuals to a population structure. If no popStruc is defined, family information of gpData is used. Only required for options sampling="within popStruc" or sASReml" or with Bayesian Ridge Regression "BRR" or Bayesian Lasso "BL" of the BLR package within the estimation set of each fold in the cross validation? IBLR function (see BLR).list with following items:set.seed()committed or reestimated with ASReml/BRR/BL)To account for the family structure (Albrecht et al. 2011), sampling can be defined as:
[object Object],[object Object],[object Object]
The following mixed model equation is used for VC.est="commit":
$$\bf y=\bf{Xb}+\bf{Zu}+\bf e$$ with $$\bf u \sim N(0,G\sigma^2_u)$$ gives the mixed model equations $$\left(\begin{array}{cc} \bf X'\bf X & \bf X'\bf Z \ \bf Z'\bf X & \bf Z'\bf Z + \bf G^{-1}\frac{\sigma^2_e}{\sigma^2_u} \end{array} \right) \left( \begin{array}{c} \bf b \ \bf u \end{array}\right) = \left(\begin{array}{c}\bf X'\bf y \ \bf Z'\bf y \end{array} \right)$$
Mosier CI (1951) I. Problems and design of cross-validation 1. Educ Psychol Measurement 11:5-11
Crossa J, de los Campos G, Perez P, Gianola D, Burgueno J, et al. (2010) Prediction of genetic values of quantitative traits in plant breeding using pedigree and molecular markers, Genetics 186:713-724
Gustavo de los Campos and Paulino Perez Rodriguez, (2010). BLR: Bayesian Linear Regression. R package version 1.2. http://CRAN.R-project.org/package=BLR
summary.cvData# loading the maize data set
data(maize)
maize2 <- codeGeno(maize)
<<<<<<< .mine
rad <- kin(maize2,ret="realized")
=======
U <- kin(maize2,ret="realized")
>>>>>>> .r361
# cross validation
cv.maize <- crossVal(maize2,cov.matrix=list(U),k=5,Rep=1,
Seed=123,sampling="random",varComp=c(26.5282,48.5785),VC.est="commit")
cv.maize2 <- crossVal(maize2,k=5,Rep=1,
Seed=123,sampling="random",varComp=c(0.0704447,48.5785),VC.est="commit")
# comparing results, both are equal!
cv.maize$PredAbi
cv.maize2$PredAbi
summary(cv.maize)
summary(cv.maize2)Run the code above in your browser using DataLab