
614 16 Regression
list(ntotal=43,
y = c(4.8, 4.1, 5.2, 5.5, 5.0, 3.4, 3.4, 4.9, 5.6, 3.7,
3.9, 4.5, 4.8, 4.9, 3.0, 4.6, 4.8, 5.5, 4.5, 5.3,
4.7, 6.6, 5.1, 3.9, 5.7, 5.1, 5.2, 3.7, 4.9, 4.8,
4.4, 5.2, 5.1, 4.6, 3.9, 5.1, 5.1, 6.0, 4.9, 4.1,
4.6, 4.9, 5.1),
x = c(-8.1, -16.1, -0.9, -7.8, -29.0, -19.2, -18.9, -10.6,
-2.8, -25.0, -3.1, -7.8, -13.9, -4.5, -11.6, -2.1,
-2.0, -9.0, -11.2, -0.2, -6.1, -1.0, -3.6, -8.2,
-0.5, -2.0, -1.6, -11.9, -0.7, -1.2, -14.3, -0.8,
-16.8, -5.1, -9.5, -17.0, -3.3, -0.7, -3.3, -13.6,
-1.9, -10.0, -13.5))
INITS
list(bb.0 = 0, b.1 = 0, tau=1)
The output is given in the table below. It contains Bayesian estimators b.0
for β
0
and b.1 for β
1
. In the least-squares regression we found b
1
= S
xy
/S
xx
=
0.0494, b
0
= y−b
1
·x =5.1494, and s =
p
MSE =0.6363. Since priors were non-
informative, we expect that Bayesian estimators will be close to the classical.
Indeed that is the case:
b.0 = 5.149, b.1 = 0.0494, and s = 0.6481.
The classical standard errors of estimators for
β
0
and β
1
are sb0 = 0.1484
and sb1 = 0.0138, while the corresponding Bayesian estimators are 0.1525
and 0.01418.
The classical 95% confidence interval for
β
1
was found to be [0.0216,0.0773].
The Bayesian 95% credible set for
β
1
is [0.02139,0.07733], as is evident from
val2.5pc and val97.5pc in the output below.
mean sd MC error val2.5pc median val97.5pc start sample
b.0 5.149 0.1525 3.117E-4 4.848 5.149 5.449 2001 200000
b.1 0.0494 0.0141 3.072E-5 0.02139 0.04944 0.07733 2001 200000
s 0.6481 0.0734 1.771E-4 0.5236 0.6415 0.811 2001 200000
yres[1] 0.05111 0.09944 2.175E-4 -0.1444 0.05125 0.2472 2001 200000
yres[2] -0.2537 0.1502 3.459E-4 -0.5499 -0.2533 0.0418 2001 200000
yres[3] 0.09544 0.1431 2.925E-4 -0.1861 0.09505 0.378 2001 200000
yres[4] 0.7363 0.09957 2.167E-4 0.5406 0.7364 0.9325 2001 200000
...
yres[41] -0.4552 0.1333 2.727E-4 -0.7173 -0.4555 -0.1919 2001 200000
yres[42] 0.245 0.1028 2.314E-4 0.04251 0.2451 0.4475 2001 200000
yres[43] 0.6179 0.125 2.879E-4 0.3718 0.6179 0.8632 2001 200000
Thus, the Bayesian approach to regression estimation is quite close to the
classical when the priors on
β
0
and β
1
and the precision τ =1/σ
2
are noninfor-
mative.
Example 16.2. Hubble Telescope and Hubble Regression. Hubble’s con-
stant (H) is one of the most important numbers in cosmology because it is
instrumental in estimating the size and age of the universe. This long-sought
number indicates the rate at which the universe is expanding, from the pri-
mordial “Big Bang.” The Hubble constant can be used to determine the intrin-
sic brightness and masses of stars in nearby galaxies, examine those same