BGLR fits Guassian models of the form
where
The terms of the linear predictor (ETA, when this term is not included in the model, by default, BGLR fits an intercept model of the form
The following script shows how to fit this model, which will estimate
Simulating posterior samples for an intercept only model
library(BGLR)
# simulating data
mu=123
n=1000
error=rnorm(n,sd=2)
y=mu+error
# fitting the model
fm=BGLR(y=y, nIter=6000,burnIn=1000, verbose=FALSE)Retrieving posterior means and posterior SDs.
# sample mean versus posterior mean of mu (MOM versus posterior mean)
round(c("MOM"=mean(y), "Bayes"=fm$mu), 4)
# Error variance (MOM versus posterior mean)
round( c("MOM"=var(y),"Bayes"=fm$varE),4)