• No results found

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 E0i) = ψ(ai) − log bi, Var0i) = ψ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 E0i] = 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)

= Γ (ai1(ai) + Γ (ai)ψ(ai)2,

where ψ1(x) = dxdψ(x) is the trigamma function. Thus Var0i) = 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 E0i) = ψ(Ai) − log Bi, Var0i) = ψ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 E11; x2), Var11; x2), E12; x1) and Var12; 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−111; x1) + Var−111; x2) − Var−101) > 0, or Var−112; x1) + Var−112; x2) − Var−102) > 0.

If x1= x2= 0 then Var11; x1) = Var01). Thus, taking condition (ii), Var−111; x1) + Var−111; x2) − Var−101) = Var−111; 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) = ψ(ai) − log(bi), Var(2)i; x1, x2) = log(bi),

for ai and bi. Then θi; x1, x2∼gamma(ai, bi) and the posterior moments of θi are E(2)i; x1, x2) = ai

bi , Var(2)i; x1, x2) = ai 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

E01) = E02) = 3.384, Var01) = Var02) = 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

E11) = 3.631, E12) = 3.442, Var11) = 0.0132, Var12) = 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 a1= 77.01, b1 = 2.02, a2= 64.17 and b2 = 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θii) = 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

i

i = eµi = θi, and so dθi = θii. Hence the density of µi is

fµii) = baiiθiaie−biθi Γ (ai) . If we take logs,

lii) = 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

[lii)] = 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

mi = emi.

This gives ai− bimi = 0 so mi = 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

2i[lii)] = −biθi.

At the mode θi = ai/bi so, substituting this into the above equation,

 d2lii) Therefore the required prior variance is

Var0i) = − d2lii)

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

Var1i) < Var0i)

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

ai = 1

vi, bi = 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

E01) = E02) = 3.401, Var01) = Var02) = 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

E11) = 3.638, E12) = 3.500, Var11) = 0.0132, Var12) = 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 E1i; xj) and Var1i; 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 a1 = 77.02, b1 = 2.02, a2 = 64.18 and b2 = 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.