필터 지우기
필터 지우기

how find optimal threshold?

조회 수: 5 (최근 30일)
alex
alex 2022년 10월 21일
답변: Star Strider 2022년 10월 21일
Hi I have this code and my density functions are P(w1)=1/3 and P(w2)=2/3
x = [-5:.1:5];
plota = normpdf(x,0,1);
plotb = normpdf(x,1,0.8);
figure; hold on;
plot(x,plota,'r');
plot(x,plotb,'b');
How can I get optimal threshold like this

채택된 답변

Star Strider
Star Strider 2022년 10월 21일
I am not certain what you are asking.
The ‘threshold’ as illustrated would be the mean (or median) of the selected normal distribution.
To get ‘area1’ and ‘area2’ —
x = [-5:.01:5];
plota = normpdf(x,0,1);
plotb = normpdf(x,1,0.8);
mean_a = mean(plota);
x_b = normpdf(mean_a,1,0.8);
area_a = 1 - normcdf(mean_a,0,1)
area_a = 0.4602
area_b = 1 - normcdf(mean_a,1,0.8)
area_b = 0.8697
figure
hold on
plot(x,plota,'r')
plot(x,plotb,'b')
plot([1 1]*mean_a, [0 1]*normpdf(mean_a,0,1), '--k')
patch([x(x>=mean_a) flip(x(x>=mean_a))], [zeros(size(x(x>=mean_a))) flip(normpdf(x(x>=mean_a),0,1))],'r', 'FaceAlpha',0.5)
patch([x(x>=mean_a) flip(x(x>=mean_a))], [zeros(size(x(x>=mean_a))) flip(normpdf(x(x>=mean_a),1,0.8))],'b', 'FaceAlpha',0.5)
hold off
I am not certain where you want to go from there.
.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by