CSU

Hayward

 

 

Statistics

Department


Appendix C: Derivations of Conditional
Distributions in Section 8


The purpose of this appendix is to show technical proofs of distributional relationships that characterize the Gibbs sampler in Section 8.

Binomial conditional distributions of X and Y.

To understand why the conditional distribution  X | A, p  is binomial, look at the first row (T=1) of Table 2 with a given value of the prevalence p in mind. Recall that P(T=1) = tph + p*q*, where h = P(T=1 | D=1) and q = P(T=0 | D=0). Conditional on T = 1, each of the A observations in the first row of the table either has D = 1 with probability g = ph/t (as shown in Section 3) or D = 0 with probability g* = 1 – ph/tp*q*/t. Thus it is clear that the conditional distribution of X, given A and p, is binomial with A trials and success probability ph/t. That is,

X | A, p ~ Bino(A, ph/t) = Bino(A, ph/(ph+p*q*)).

The derivation of the distribution of  Y | Bp   is similar.

Beta conditional distribution of prevalence.

In the Gibbs sampler of Section 8, we have the beta prior distribution of P,

f(p) µ pa – 1(1 – p)b 1 = pa – 1(p*)b – 1,   0 < p < 1,

where a, b > 0 and where we use the proportionality symbol µ to indicate that we display only the "kernel" of the distribution and ignore the constant.

Because the observable data consist of A and B, we would like to have an expression for the posterior distribution density f(p | ab), but to derive it is not an easy integration problem! That is why we turn to the Gibbs sampler, which involves the sampled random variables X and Y, and the conditional distribution P | A,  B,  X,  Y, as well as the two conditional distributions  X | Ap  and  Y | Bp  considered above. Accordingly, we now complete the derivations of the conditional distributions of Section 8 by finding the density f(p | abxy).

Altogether, the Gibbs sampler involves five random variables P, A, B, X, and Y. Using the definition of conditional distribution, we express their joint density function as

f(p, a, b, x, y) = f(a, b, x, y | p) f(p).

Then by the general version of Bayes' Theorem (see Appendix B),

f(p | a, b, x, y) µ f(a, b, x, y | p) f(p).

Thus we can find the form of the conditional density f(p | abxy) by evaluating the joint density as a product. Referring to the four entries in the body of Table 2 with a given prevalence p, we see that

f(abxy | p) µ (ph)x (ph*)y (p*q*)a – x (p*q)by.

We multiply this expression by f(p), and collect exponents, to obtain

f(p, a, b, x, y) µ px + y + a – 1 (p*)a + bxy + b – 1 ´ hx (h*)y (q*)ax qby.

Finally, we notice that the last four factors in our expression for the joint density do not involve p. Thus they become constants when we condition on A, B, X, and Y, and we obtain

f(p | a, b, x, y) µ px + y + a – 1 (p*)a + bxy + b – 1.

Here we identify the kernel of a beta distribution, and conclude that

P | ABX ,Y ~ Beta(X + Y + a, A + BXY + b).

as claimed in Section 8.