Obtaining bayesian error rate
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Massimo Zanetti
il 26 Set 2016
Modificato: Massimo Zanetti
il 26 Set 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.
Risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!