Obtaining bayesian error rate

조회 수: 3 (최근 30일)
Sowmya MR
Sowmya MR 2016년 9월 25일
편집: Massimo Zanetti 2016년 9월 26일
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
Massimo Zanetti
Massimo Zanetti 2016년 9월 26일
편집: Massimo Zanetti 2016년 9월 26일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by