rorbars to reduce clutter
sigma = sqrt(v);
h=legend('location', 'northwest');
set(h, 'fontsize', fs); 
errorbar(xtest(ndx), mu(ndx), sigma(ndx));
title('plugin approximation (MLE)', 'fontsize', fs);
printPmtkFigure('linregPostPredPlugin')


%% Bayes
model = linregFitBayes(Xtrain, ytrain, ...
  'prior', 'gauss', 'alpha', 0.001, 'beta', 1/sigma2);
[mu, v] = linregPredictBayes(model, Xtest);
fig2=figure;
hold on;
plot(xtest, mu,  'k-', 'linewidth', 3, 'displayname', 'prediction');
%plot(xtest, ytestNoisefree, 