close all;
clear all;

%Initialize variables
m = 0.0;
a = 15.0; 
b = 3;
x = 9; 

%Compute parameters
y = -100:1:100;
mean = ((a^2)*x + (b^2)*m)/(a^2 + b^2);
var = ((a*b)^2)/(a^2 + b^2);
p_y_given_x = (1.0/sqrt(2*pi*var))*exp(-((y-mean).^2)/(2*var));
var2 = a^2;
p_y = (1.0/sqrt(2*pi*var2))*exp(-((y-m).^2)/(2*var2));

%Show information
figure;
plot(y,p_y_given_x,'b');
hold on
plot(y,p_y,'r');
legend('p(y|x)', 'p(y)');
sy = size(y);
axis([y(1),y(sy(2)),0,0.2]);
xlabel('y');
text(-70,0.14, '\mu=0');
text(-70,0.12, '\alpha=15');
text(-70,0.1, '\beta=3');


