3.13.1 Expectation and variance
In the case of Poisson random variables just one link function is commonly used. This is the natural logarithm and takes the form
ηi= log(θi),
for i = 1, 2. Clearly since θi ∈ [0, ∞) ⇒ ηi ∈ (−∞, ∞) and so ηi is unbounded. We link η1 and η2 into a Bayes linear structure. The prior and posterior expectations and variances of θ1, θ2 having made within-group updates are given in Equations 3.11 and
3.12.
We can find the prior expectations and variances of each ηi. They are E0(ηi) = ψ(ai) − log bi, Var0(ηi) = ψ1(ai),
where ψ(·) is the digamma function and ψ1(·) is the trigamma function.
Proof. In order to find the expectation and variance of ηi in terms of the parameters of the marginal gamma distributions consider the gamma function
Γ (y) = Z ∞
0
zy−1e−zdz.
Differentiating with respect to y gives d
dyΓ (y) = Z ∞
0 log(z) × zy−1e−zdz.
Each subsequent derivative simply multiplies the right hand side by a further log(z) inside the integration. Therefore, since biθi∼gamma(ai, 1), if z = biθi then
1 Γ (ai)
dn
dani Γ (ai) = E0[(log biθi)n].
Thus the expectation of each ηi can be found as E0[ηi] = E0[log θi]
= E0[log biθi] − log bi
= 1
Γ (ai) d
daiΓ (ai) − log bi
= ψ(ai) − log bi,
where ψ(x) = dxd log[Γ (x)] is the digamma function. The variance is then found from d2
da2iΓ (ai) = d
daiΓ (ai)ψ(ai)
= Γ (ai)ψ1(ai) + Γ (ai)ψ(ai)2,
where ψ1(x) = dxdψ(x) is the trigamma function. Thus Var0(ηi) = Var0(log biθi)
= E0[(log biθi)2] − E0[log biθi]2
= ψ1(ai) + ψ(ai)2− ψ(ai)2
= ψ1(ai).
The expectation and variance of ηi having observed xi successes in group i are E0(ηi) = ψ(Ai) − log Bi, Var0(ηi) = ψ1(Ai),
which are the same form as in the prior but with ai and bi replaced by Ai = ai+ xi and Bi = bi+ 1.
We propagate these changes in belief through to the other group using Equations 3.15 and 3.16. This gives E1(η1; x2), Var1(η1; x2), E1(η2; x1) and Var1(η2; x1).
We consider the sufficient condition for a unique commutative solution using Bayes linear kinematics. In this case it is
ψ1(ai+ xi) < ψ1(ai),
for some i. Thus, as long as we make a non-zero observation in either group Ai > aiand ψ1(Ai) < ψ1(ai) as the trigamma function is monotonically decreasing on R+. Thus, as long as we make a non-zero observation there will always be a unique commutative solution.
If x1= x2= 0 then clearly the sufficient condition does not hold. However, if we refer back to the conditions from Theorem 5 of Goldstein & Shaw (2004) as given in Section 3.4.2, then, using conditions (ii) and (iii), there is a unique commutative solution if
Var−11 (η1; x1) + Var−11 (η1; x2) − Var−10 (η1) > 0, or Var−11 (η2; x1) + Var−11 (η2; x2) − Var−10 (η2) > 0.
If x1= x2= 0 then Var1(η1; x1) = Var0(η1). Thus, taking condition (ii), Var−11 (η1; x1) + Var−11 (η1; x2) − Var−10 (η1) = Var−11 (η1; x2) > 0.
We can show condition (iii) holds using the same reasoning. Therefore, in the case of x1 = x2 = 0, there is still a unique, commutative Bayes linear kinematic solution.
This solution is given in Equations 3.18 and 3.19 and provides posterior expectations E(2)(ηi; x1, x2) and variances Var(2)(ηi; x1, x2).
Assuming θ1 and θ2 still have marginal gamma distributions (see Section 3.7.2), we find the parameter values of these distributions by solving
E(2)(ηi; x1, x2) = ψ(a∗i) − log(b∗i), Var(2)(ηi; x1, x2) = log(b∗i),
for a∗i and b∗i. Then θi; x1, x2∼gamma(a∗i, b∗i) and the posterior moments of θi are E(2)(θi; x1, x2) = a∗i
b∗i , Var(2)(θi; x1, x2) = a∗i b∗2i . 3.13.2 Example: piston ring failures
We wish to provide a Bayes linear Bayes solution to the problem of related numbers of piston ring failures presented in Section 2.6.4. For comparability we use the same prior specifications for the prior gamma distributions of θ1 and θ2 used in the copula methodology. That is a1 = a2 = 30 and b1 = b2 = 1. We specify a prior correlation between η1 and η2 of 0.25. This leads to prior specifications for each ηi of
E0(η1) = E0(η2) = 3.384, Var0(η1) = Var0(η2) = 0.0339.
When we observe x1= 44 piston ring failures in group 1 and x2 = 33 failures in group 2 then the resulting posterior expectations and variances of η1, η2 are
E1(η1) = 3.631, E1(η2) = 3.442, Var1(η1) = 0.0132, Var1(η2) = 0.0160.
Thus there has been a fairly large reduction in the uncertainty on observation of the data. We can propagate these changes through to the other group using Bayes linear kinematics. A unique commutative solution exists as we have observed some failures.
It is
E(2)(η1; x1, x2) = 3.633, E(2)(η2; x1, x2) = 3.471, Var(2)(η1; x1, x2) = 0.0131, Var(2)(η2; x1, x2) = 0.0157.
We use these values to calculate the posterior parameter values for θ1 and θ2 under the continued assumption of gamma marginal distributions. They are a∗1= 77.01, b∗1 = 2.02, a∗2= 64.17 and b∗2 = 1.98. From these we calculate the posterior expectations and
variances of the Poisson parameters.
E(2)(θ1; x1, x2) = 38.0918, E(2)(θ2; x1, x2) = 32.4102, Var(2)(θ1; x1, x2) = 18.8423, Var(2)(θ2; x1, x2) = 16.3699.
3.13.3 Mode and curvature
Just as with the beta-binomial model we can utilise a guide relationship in the gamma-Poisson setup. This time we shall define our guide relationship as
ηi ≈ µi = log(θi).
Thus, rather than using the mean and variance of µi directly, as we did in the previous section, we use a related quantity, ηi, with mean and variance given by the mode of µi and curvature at the mode of the log-density of µi as we did in the beta-binomial model.
The density of θi is
fθi(θi) = baiiθiai−1e−biθi Γ (ai) ,
and, in terms of µi, θi = eµi. To obtain the density of µi, first we must differentiate the density of θi to find the Jacobian. The derivative is
dθi
dµi = eµi = θi, and so dθi = θidµi. Hence the density of µi is
fµi(µi) = baiiθiaie−biθi Γ (ai) . If we take logs,
li(µi) = ailog bi+ ailog θi− biθi− log Γ (ai).
Differentiating this and setting the derivative equal to zero gives us the mode of µi. The derivative is
d dµi
[li(µi)] = ai
θi − bi
θi = ai− biθi. (3.30) Setting this equal to zero we find the mode. Let mi be the mode of µi. Then let
m∗i = emi.
This gives ai− bim∗i = 0 so m∗i = ai/bi, and the mode of µi is
mi = log ai
bi
.
To find the curvature we must differentiate Equation 3.30 a further time. The second derivative is given by
d2
dµ2i[li(µi)] = −biθi.
At the mode θi = ai/bi so, substituting this into the above equation,
d2li(µi) Therefore the required prior variance is
Var0(ηi) = − d2li(µi)
Hence, our two prior moments can be expressed solely in terms of the prior gamma parameters. They are
Having made the conjugate updates, the moments take the same form but using Ai = ai+ xiand Bi= bi+ 1 in place of ai and bi. Defining a Bayes linear structure for η1, η2, allows the updates to be propagated to ηj, j 6= i via Equation 3.15.
From Equation 3.17 there is a unique commutative solution to the problem using Bayes linear kinematics if
Var1(ηi) < Var0(ηi)
for i = 1 or 2 or both. This condition will clearly hold whenever we make a non-zero observation in either of the groups. Thus a unique commutative solution will virtually always exist. In fact we showed in the previous section that a commutative solution shall exist even if both observations are zero.
Having ascertained that a unique commutative Bayes linear kinematic solution exists it is given by Equations 3.18 and 3.19. Note that, once an adjusted mean and precision for ηi are found, the parameter values of the posterior gamma distributions are found, from posterior mean ¯mi and variance vi, as
a∗i = 1
vi, b∗i = 1 vie− ¯mi.
These can then be used to find posterior means and variances of θ1, θ2.
3.13.4 Example: piston ring failures
If we take the same prior values as in the previous example for the gamma distribution parameters and prior correlation then the resulting prior expectations and variances for η1, η2 are
E0(η1) = E0(η2) = 3.401, Var0(η1) = Var0(η2) = 0.033.
When we observe 46 failures in compressor 1 and 33 failures in compressor 2 then, having made full Bayesian updates within each group, the expectations and variances become
E1(η1) = 3.638, E1(η2) = 3.500, Var1(η1) = 0.0132, Var1(η2) = 0.0159.
We can now use Bayes linear kinematics to update our beliefs in both groups as a result of these mean and variance changes. This gives E1(ηi; xj) and Var1(ηi; xj) where j 6= i for each i. A commutative solution is available, using the sufficient condition, as we observe some piston ring failures. It is
E(2)(η1; x1, x2) = 3.639, E(2)(η2; x1, x2) = 3.478, Var(2)(η1; x1, x2) = 0.0130, Var(2)(η2; x1, x2) = 0.0156.
Solving for the posterior parameter values gives a∗1 = 77.02, b∗1 = 2.02, a∗2 = 64.18 and b∗2 = 1.98. Converting back to the expected numbers of piston ring failures results in posterior expectations and variances of
E(2)(θ1; x1, x2) = 38.0683, E(2)(θ2; x1, x2) = 32.3884, Var(2)(θ1; x1, x2) = 18.8170, Var(2)(θ2; x1, x2) = 16.3450.