# Load the diabetes data...
data(diabetes, package="BayesBridge");
cov.name = colnames(diabetes$x);
y = diabetes$y;
X = diabetes$x;
# Center the data.
y = y - mean(y);
mX = colMeans(X);
for(i in 1:442){
X[i,] = X[i,] - mX;
}
# Expectation maximization.
out = trace.beta(y, X);
Run the code above in your browser using DataLab