if (FALSE) {
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)
}
Run the code above in your browser using DataLab