Chapter 3: gaussian posteriors derived from jeffreys priors
Chapter 3: gaussian posteriors derived from jeffreys priors
We will use two steps to demonstrate transformation invariance. First, we plot the original-coordinates posteriors for the two parameterizations of the likelihood (here, in terms of standard deviation and precision). Then, we numerically transform each of these priors into the other coordinates and compute (and plot) the resulting transformed posteriors.
Step 1: Plot original-coordinates posteriors:
sig=linspace(0,20,52); sig=sig(2:end); rho=sort(sig.^-2); %rho reverse order unless sorted
d=[-2.25 -1.02 4.13 2.48 -3.71]; n=length(d);
sigma:
figure(19); clf; hold on; box off;
prisig=sig.^-1; Lsig=sig.^-n.* exp(-.5*(sig.^-2)*sum(d.^2)); psig=prisig.*Lsig;
plot(sig,psig./max(psig),'ko','MarkerSize',8,'LineWidth',2);
rho:
figure(20); clf; hold on; box off
prirho=rho.^-1; Lrho=rho.^(n/2).*exp(-.5*rho* sum(d.^2)); prho=prirho.*Lrho;
plot(rho,prho./max(prho),'ko','MarkerSize',8,'LineWidth',2);
Step 2: Plot transformed posteriors:
First define the transforms:
f1=@(x) (x).^-(1/2); f2=@(x) x.^-2;
Then plot each transformed posterior atop the original:
SIG:
figure(19); axis([0 10 0 1])
prisigx=pTX(rho,prirho,f1); psigx=prisigx(:,1).*Lsig';
plot(prisigx(:,2),psigx/max(psigx),'-','LineWidth',2);
RHO:
figure(20); axis([0 .25 0 1])
prirhox=pTX(sig,prisig,f2); prhox=prirhox(:,1).*Lrho';
plot(prirhox(:,2),prhox/max(prhox),'-','LineWidth',2)