Chapter 6: measurement as model comparison

S=34; F=19; N=S+F; theta=0.5;

f=linspace(0,1,1201)';

%%%%%%%%%%%%%%%%%%%%%%%%%

%%% 1d f distribution %%%

Lf=(S-.5)*log(f)+(F-.5)*log(1-f); Lf=Lf-max(Lf);

ciF=CIp(f,Lf);

figure(1); clf

subplot(2,1,1); hold on

plot(f,exp(Lf),'k--','LineWidth',1.75);

dciF=diff(ciF(1:2));

axis([0 1 0 1])

for n=1:2, plot(ciF(n)*[1 1],[0 1],'-','Color',.65*[1 1 1],'LineWidth',.7); end

evidence calculation

%%% compute evidence from N and S

L1=bpdf(S,N,theta); L2=(N+1)^-1;

EV=10*log10(L1/L2)