BLRXy {BGLR} | R Documentation |
Bayesian Linear Regression
Description
The BLRXy(‘Bayesian Linear Regression’) function fits various types of parametric Bayesian regressions to continuos outcomes. This is a wrapper for function BLRCross.
Usage
BLRXy(y, intercept=TRUE, ETA,
nIter = 1500, burnIn = 500, thin = 5,
S0 = NULL, df0 = 5, R2 = 0.5,
verbose = TRUE, saveAt="",
rmExistingFiles = TRUE)
Arguments
y |
(numeric, |
intercept |
(logical) indicates if an intercept is included. |
ETA |
(list) This is a two-level list used to specify the regression function (or linear predictor). Regression on covariates and other types of random effects are specified in this two-level list. For instance: ETA=list(list(X=W, model="FIXED"), list(X=Z,model="BRR")), specifies that the linear predictor should include: an intercept (included by default), a linear regression on W with regression coefficients treated as fixed effects (i.e., flat prior), plus regression on Z, with regression coefficients modeled as in the Bayesian Ridge Regression. The following options are implemented for linear regressions: FIXED (flat prior), BayesA, BayesB, BRR (Gaussian prior), BayesC, SSVS and RKHS. |
nIter , burnIn , thin |
(integer) the number of iterations, burn-in and thinning. |
saveAt |
(string) this may include a path and a pre-fix that will be added to the name of the files that are saved as the program runs. |
S0 , df0 |
(numeric) The scale parameter for the scaled inverse-chi squared prior assigned to the residual variance, only used with Gaussian outcomes.
In the parameterization of the scaled-inverse chi square in BGLR the expected values is |
R2 |
(numeric, |
verbose |
(logical) if TRUE the iteration history is printed, default TRUE. |
rmExistingFiles |
(logical) if TRUE removes existing output files from previous runs, default TRUE. |
Author(s)
Gustavo de los Campos, Paulino Perez Rodriguez.
References
de los Campos G., H. Naya, D. Gianola, J. Crossa, A. Legarra, E. Manfredi, K. Weigel and J. Cotes. 2009. Predicting Quantitative Traits with Regression Models for Dense Molecular Markers and Pedigree. Genetics 182: 375-385.
de los Campos, G., D. Gianola, G. J. M., Rosa, K. A., Weigel, and J. Crossa. 2010. Semi-parametric genomic-enabled prediction of genetic values using reproducing kernel Hilbert spaces methods. Genetics Research, 92:295-308.
Examples
## Not run:
library(BGLR)
p=1000
n=1500
data(mice)
X=scale(mice.X[1:n,1:p],center=TRUE)
A=mice.A
A=A[1:n,1:n]
QTL=seq(from=50,to=p-50,by=80)
b=rep(0,p)
b[QTL]=1
signal=as.vector(X%*%b)
error=rnorm(sd=sd(signal),n=n)
y=error+signal
y=2+y
#Example 1
#BayesA
ETA=list(list(X=X,model="BayesA"))
fm1=BLRXy(y=y,ETA=ETA)
plot(fm1$yHat,y)
#Example 2, missing values
yNA<-y
whichNA<-sample(1:length(y),size=100,replace=FALSE)
yNA[whichNA]<-NA
fm2<-BLRXy(y=yNA,ETA=ETA)
plot(fm2$yHat,y)
points(fm2$yHat[whichNA],y[whichNA],col="red",pch=19)
#Example 3, RKHS with no-missing values
ETA<-list(list(K=A,model="RKHS"))
fm3<-BLRXy(y=y,ETA=ETA)
plot(fm3$yHat,y)
#Example 4, RKHS with missing values
fm4<-BLRXy(y=yNA,ETA=ETA)
plot(fm4$yHat,y)
points(fm4$yHat[whichNA],y[whichNA],col="red",pch=19)
## End(Not run)