Obtaining bayesian error rate
显示 更早的评论
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
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 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logistic Distribution 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!