figure, histogram(no_target, 'normalization', 'pdf')
histogram(target, 'normalization', 'pdf')
fx1=ksdensity(no_target,xx);
plot (xx, fx1,'-r', 'linewidth',1.5)
fx2=ksdensity(target,xx);
plot (xx, fx2,'-g', 'linewidth',1.5)
idmax1=find(fx1==max(fx1));
idm1=round(median(idmax1));
plot(xx(idm1),fx1(idm1),'b*');
idmax2=find(fx2==max(fx2));
idm2=round(median(idmax2));
plot(xx(idm2),fx2(idm2),'r*');
xlabel('values'), ylabel('estimated density')
legend('H_0 (Target Absent)','H_1 (Target Present)', 'fit(H_0)', 'fit(H_1)', strcat('max(H_0)=', num2str(max(fx1))), strcat('max(H_1)=', num2str(max(fx2))))
0 Comments
Sign in to comment.