2.7 A simple working example

We will illustrate some conceptual differences between the Bayesian and Frequentist statistical approaches performing inference given a random sample y=[y1,y2,,yN], where yiiidN(μ,σ2), i=1,2,,N.

In particular, we set π(μ,σ)=π(μ)π(σ)1σ. This is a standard non-informative improper prior (Jeffreys prior, see Chapter 3), that is, this prior is perfectivelly compatible with sample information. In addition, we are assuming independent priors for μ and σ. Then,

π(μ,σ)1σ×(σ2)N/2exp{12σ2Ni=1(yiμ)2}=1σ×(σ2)N/2exp{12σ2Ni=1((yiˉy)(μˉy))2}=1σexp{N2σ2(μˉy)2}×(σ)Nexp{12σ2Ni=1(yiˉy)2}=1σexp{N2σ2(μˉy)2}×(σ)(αn+1)exp{αnˆσ22σ2},

where ˉy=Ni=1N, αn=N1 and ˆσ2=Ni=1(yiˉy)2N1.

The first term in the last expression is the kernel of a normal density, μ|σ,yN(ˉy,σ2/N). The second term is the kernel of an inverted gamma density (Zellner 1996, p.~ 371), σ|yIG(αn,ˆσ2). Therefore, π(μ|σ,y)=(2πσ2/N)1/2exp{N2σ2(μˉy)2} and π(σ|y)=2Γ(αn/2)(αnˆσ22)αn/21σαn+1exp{αnˆσ22σ2}.

Observe that E[μ|σ,y]=ˉy, this is also the maximum likelihood (Frequentist) point estimate of μ in this setting. In addition, the Frequentist (1α)% confidence interval and the Bayesian (1α)% credible interval have exactly the same form, ˉy±|zα/2|σN, where zα/2 is the α/2 percentile of a standard normal distribution. However, the interpretations are totally different. The confidence interval has a probabilistic interpretation under sampling variability of ˉY, that is, in repeated sampling (1α)% of the intervals ˉY±|zα/2|σN would include μ, but given an observed realization of ˉY, say ˉy, the probability of ˉy±|zα/2|σN including μ is 1 or 0, that is why we say a (1α)% confidence interval. On the other hand, ˉy±|zα/2|σN has a simple probabilistic interpretation in the Bayesian framework, there is a (1α)% probability that μ lies in this interval.

If we want to get the marginal posterior density of μ,

π(μ|y)=0π(μ,σ|y)dσ01σ×(σ2)N/2exp{12σ2Ni=1(yiμ)2}dσ=0(1σ)N+1exp{N2σ2Ni=1(yiμ)2N}dσ=[2Γ(N/2)(NNi=1(yiμ)22N)N/2]1[Ni=1(yiμ)2]N/2=[Ni=1((yiˉy)(μˉy))2]N/2=[αnˆσ2+N(μˉy)2]N/2[1+1αn(μˉyˆσ/N)2](αn+1)/2

The fourth line is due to having the kernel of a inverted gamma density with N degrees of freedom in the integral.

The last expression is the kernel of a Student’s t density function with αn=N1 degrees of freedom, expected value equal to ˉy, and variance ˆσ2N(αnαn2). Then, μ|yt(ˉy,ˆσ2N(αnαn2),αn).

Observe that a (1α)% confidence interval and (1α)% credible interval have exactly the same expression, ˉy±|tαnα/2|ˆσN, where tαnα/2 is the α/2 percentile of a Student’s t distribution. But again, the interpretations are totally different.

The mathematical similarity between the Frequentist and Bayesian expressions in this examples are due to using a non-informative improper prior.