Appendix: Pseudo Code for Step 1 of the Gibbs Sampler
a. First, generate a Wishart random variable A(i) = [Σ(i) ]-1 ~ W (S-1, ν ).
i. Let LL = S-1, where L is a lower triangular matrix from the Cholesky de-
composition of S-1. We obtain S-1 as the inverse of the estimated variance-
covariance matrix of the error terms.
ii. Assume that Q ~ W (I, ν ). Then LQL ~ W (LL, ν ) = W (S-1, ν )
iii. Now from Anderson (1984) UU ' = Q ~ W (I, ν ), where U is lower triangular,
all uij are independent, uij∙ ~ N(0,1), i > j, and u2i ~ χ2(ν — i + 1) random
variable, which implies that LUU 'L' ~ W (S-1, ν ). Thus, we draw uij values
and form Q(i) = U(i)U(i) .
iv. Now use L and Q(i) compute LQ(i)L'∕ν = A(i).
b. Compute Σ(i) = [A(i)]-1 , which is an inverse-Wishart random variable.
28