Obtaining bayesian error rate

3 views (last 30 days)
Sowmya MR
Sowmya MR on 25 Sep 2016
Edited: Massimo Zanetti on 26 Sep 2016
I am new to machine learning and i have derived general expressions for bayes decision boundary and trying to plot the graph for mu=1 and sigma^2=2; Trying to plot a figure which contains both class conditional pdfs p(x|ωi) and posterior probabilities p(ωi|x) with the location of the optimal decision region. I should also obtain the bayes error rate for it. Can someone please help me? This is what i have tried so far:
%Plott Class-Conditional
fplot( @(x) ( (1/sqrt(2*pi)) * exp(- (x.^2)/2) ) ,'Linewidth',2);
hold on;
fplot( @(x) ( (1/(2* sqrt(pi))) * exp( - (x.^2 - 2*x +1)/4) ) ,'Linewidth',2);
hold off;
legend({'P(x|w1)','P(x|w2)'}, 'FontSize',14)
xlabel('x' ,'FontSize', 12)
ylabel('p(x|wi)' , 'FontSize', 12)
title('Graph of class conditional pdfs p(x|wi)', 'FontSize', 14)
%Plott Posterior
fplot(@(x) ( ((1/sqrt(2*pi)) * exp(- (x.^2)/2))/( ((1/sqrt(2*pi)) * exp(- (x.^2)/2)) + ((1/(2* sqrt(pi))) * exp( - (x.^2 - 2*x +1)/4)) ) ) )
hold on;
fplot(@(x) ( ((1/(2* sqrt(pi))) * exp( - (x.^2 - 2*x +1)/4)) / ( ((1/(2* sqrt(pi))) * exp( - (x.^2 - 2*x +1)/4)) + (( (1/sqrt(2*pi)) * exp(- (x.^2)/2)) ) )))
hold off;
  1 Comment
Massimo Zanetti
Massimo Zanetti on 26 Sep 2016
Edited: Massimo Zanetti on 26 Sep 2016
I am trying to get. It seems you have two Gaussian distributions, one is given by parameters MU=1 and SIGMA^2=2. What about the other one?
The optimal decision is given by the point where the two curves intersect, and error rate correrponds to the overlapping areas of the two sub-graphs. Please, give me the parameters of the other Gaussian distribution.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!