function [MAPs, MMSEs] = prob7mm(Ys)

xs = [-5:0.005:20];
ys = [];
MAPs = [];
MMSEs = [];

for Y=Ys,
  ypost = prob7(Y,xs);
  ys = [ys; ypost/max(ypost)];
  
  [m ii] = max(ypost);
  MAPs = [MAPs xs(ii)];
  [m ii] = sort(abs(ypost-mean(ypost)));
  MMSEs = [MMSEs xs(ii(1)) xs(ii(2))];
end;

clf;
hold on;
plot(xs,ys)

ypmaps = [];
ypmmses = [];

for ypi =1:length(MAPs),
  divisor = max( prob7(Ys(ypi),xs) );
  ypmaps = [ypmaps prob7(Ys(ypi),MAPs(ypi))/divisor];
end

for yi =1:length(Ys),
  divisor = max( prob7(Ys(yi),xs) );
  ypmmses = [ypmmses prob7(Ys(yi),MMSEs(2*(yi-1) + 1))/divisor];
  ypmmses = [ypmmses prob7(Ys(yi),MMSEs(2*(yi-1) + 2))/divisor];
end

plot(MAPs, ypmaps, '*');
plot(MMSEs, ypmmses, 'x');
hold off;
