Chapter 5: body temperature measurement
This is the most common problem in all of measurement, with a constant signal and constant noise. We start with the data, which involves one or more observations of thermometer mercury level.
d=[98.4 98.8 98.5 99.4 99.9];
mus=linspace(90,110,3001)';
sigmas=linspace(0,20,501); sigmas=sigmas(2:end);
N=length(d);
%%% 2d mu-sigma distribution
Lms=-(N/2*((mean(d.^2)-mean(d)^2)*(sigmas.^-2)+(mus-mean(d)).^2*(sigmas.^-2))+(N+1)*ones(size(mus))*log(sigmas));
figure; meshc(sigmas,mus,exp(Lms)); colormap bone
%%% marginal alpha distribution
Lm=logsum(Lms,2,diff(sigmas(1:2))); Lm=Lm-max(Lm);
ciM=CIp(mus,Lm);
%%% marginal sigma distribution
Ls=logsum(Lms,1,diff(mus(1:2))); Ls=Ls-max(Ls);
ciS=CIp(sigmas(:),Ls);
figure
%%% plot marginal alpha distribution
subplot(2,1,1); hold on
plot(mus,exp(Lm),'k--','LineWidth',1.75); dciM=diff(ciM(1:2)); axis([ciM(1)-.2*dciM ciM(2)+.2*dciM 0 1])
for n=1:2, plot(ciM(n)*[1 1],[0 1],'-','Color',.65*[1 1 1],'LineWidth',.7); end
%%% plot marginal sigma distribution
subplot(2,1,2); hold on
plot(sigmas,exp(Ls),'k--','LineWidth',1.75); dciS=diff(ciS(1:2)); axis([ciS(1)-.2*dciS ciS(2)+.2*dciS 0 1])
for n=1:2, plot(ciS(n)*[1 1],[0 1],'-','Color',.65*[1 1 1],'LineWidth',.7); end