GHK algorithm

The GHK algorithm (Geweke, Hajivassiliou and Keane) is an importance sampling method for simulating choice probabilities in the multivariate probit model. These simulated probabilities can be used to recover parameter estimates from the maximized likelihood equation using any one of the usual well known maximization methods (Newton's method, BFGS, etc.). Train has well documented steps for implementing this algorithm for a multinomial probit model. What follows here will apply to the binary multivariate probit model.

Consider the case where one is attempting to evaluate the choice probability of $$ \Pr(\mathbf{y_i} |\mathbf{X_i\beta}, \Sigma) $$ where $$ \mathbf{y_i} = (y_1, ..., y_J), \ (i = 1,...,N)$$ and where we can take $$ j $$ as choices and $$ i $$ as individuals or observations, $$ \mathbf{X_i\beta} $$ is the mean and $$ \Sigma$$ is the covariance matrix of the model. The probability of observing choice $$ \mathbf{y_i} $$ is

\begin{align} \Pr(\mathbf{y_i}|\mathbf{X_i\beta}, \Sigma) = & \int_{A_J}\cdots\int_{A_1}f_N(\mathbf{y}^*_i|\mathbf{X_i\beta}, \Sigma) dy^*_1\dots dy^*_J \\ \Pr(\mathbf{y_i}|\mathbf{X_i\beta}, \Sigma) = & \int \mathbb{1}_{y^* \in A} f_N(\mathbf{y}^*_i|\mathbf{X_i\beta}, \Sigma) d\mathbf{y}^*_i \end{align} $$ Where $$ A = A_1 \times \cdots \times A_J $$ and,

A_j = \begin{cases} (-\infty,0] & y_j = 0 \\ (0, \infty) & y_j = 1 \end{cases} $$

Unless $$ J $$ is small (less than or equal to 2) there is no closed form solution for the integrals defined above (some work has been done with $$ J = 3 $$ ). The alternative to evaluating these integrals closed form or by quadrature methods is to use simulation. GHK is a simulation method to simulate the probability above using importance sampling methods.

Evaluating $$ \Pr(\mathbf{y_i}|\mathbf{X_i\beta}, \Sigma) = \int \mathbb{1}_{y^* \in A} f_N(\mathbf{y}^*_i|\mathbf{X_i\beta}, \Sigma) d\mathbf{y}^*_i $$ is simplified by recognizing that the latent data model $$ \mathbf{y_i^*} = \mathbf{X_i\beta} + \epsilon $$ can be rewritten using a Cholesky factorization, $$ \Sigma = CC' $$. This gives $$ \mathbf{y_i^*} = \mathbf{X_i\beta} + C\eta_i $$ where the $$ \eta_i $$ terms are distributed $$ N(0,\mathbf{I}) $$.

Using this factorization and the fact that the $$ \eta_i $$ are distributed independently one can simulate draws from a truncated multivariate normal distribution using draws from a univariate random normal.

For example, if the region of truncation $$ \mathbf{A} $$ has lower and upper limits equal to $$ [a,b] $$ (including a,b = $$ \pm\infty $$) then the task becomes

\begin{array}{lcl} a < & y^*_1 & < b \\ a < & y^*_2 & < b \\ \vdots & \vdots & \vdots \\ a < & y^*_J & < b \\ \end{array} $$ Note: $$ \mathbf{y_i^*} = \mathbf{X_i\beta} + C\eta_i $$, substituting:

\begin{array}{lcl} a < & x_1\beta_1 + c_{11}\eta_1 & < b \\ a < & x_2\beta_2 + c_{21}\eta_1 + c_{22}\eta_2 & < b \\ \vdots & \vdots & \vdots \\ a < & x_J\beta_J + \sum_{k=1}^J c_{J,k}\eta_k & < b \\ \end{array} $$

Rearranging above,

\begin{array}{ccc} \frac{a - x_1\beta_1}{c_{11}} & < \eta_1  < & \frac{b - x_1\beta_1}{c_{11}}\\ \frac{a - (x_2\beta_2 + c_{21}\eta_1)}{c_{22}} & <  \eta_2  < & \frac{b - (x_2\beta_2 + c_{21}\eta_1)}{c_{22}} \\ \vdots & \vdots & \vdots \\ \frac{a - (x_J\beta_J + \sum_{k=1}^{J-1} c_{J,k})}{c_{J,J}} & <  \eta_k  < & \frac{b - (x_J\beta_J + \sum_{k=1}^{J-1} c_{J,k})}{c_{J,J}} \\ \end{array} $$

Now all one needs to do is iteratively draw from the truncated univariate normal distribution with the given bounds above. This can be done by the inverse CDF method and noting the truncated normal distribution is given by,

u = \frac{ \Phi( \frac{x-\mu}{\sigma}) - \Phi(\frac{a-\mu}{\sigma}) }{ \Phi(\frac{b-\mu}{\sigma}) - \Phi(\frac{a-\mu}{\sigma})} $$ Where $$ u $$ will be a number between 0 and 1 because the above is a CDF. This suggests to generate random draws from the truncated distribution one has to solve for $$ x $$ giving,

x = \sigma F^{-1}(u*(F(\beta) - F(\alpha)) + F(\alpha)) + \mu $$ where $$ \alpha = \frac{a-\mu}{\sigma} $$ and $$ \beta = \frac{b-\mu}{\sigma} $$ and $$ F $$ is the standard normal CDF. With such draws one can reconstruct the $$ \mathbf{y^*_i} $$ by its simplified equation using the Cholesky factorization. These draws will be conditional on the draws coming before and using properties of normals the product of the conditional PDFs will be the joint distribution of the $$ \mathbf{y^*_i} $$,

q(\mathbf{y^*_i}|\mathbf{X_1\beta}, \Sigma) = q(y^*_1|\mathbf{X_1\beta}, \Sigma)q(y^*_2|y^*_1, \mathbf{X_1\beta}, \Sigma)\dots q(y^*_J|y^*_1,\dots,y^*_{J-1},\mathbf{X_1\beta}, \Sigma) $$ Where $$ q(\cdot) $$ is the multivariate normal distribution.

Because $$ y^*_j $$ conditional on $$ y_k, \ k<j $$ is restricted to the set $$ A $$ by the setup using the Cholesky factorization then we know that $$ q(\cdot) $$ is a truncated multivariate normal. The distribution function of a truncated normal is,

\frac{ \phi(\frac{x-\mu}{\sigma })} {\sigma(\Phi(\frac{b-\mu}{\sigma}) - \Phi(\frac{a-\mu}{\sigma})) } $$

Therefore, $$ y^*_j $$ has distribution,

\begin{align} q(\mathbf{y^*_i} | \mathbf{X_i\beta}, \Sigma) & = \frac{ \frac{1}{c_{11}} \phi_1\Big( \frac{y^*_{j} - x_1\beta }{c_{11}}\Big)}{\Big( \Phi_1\Big( \frac{b- x_1\beta}{c_{11}} \Big) -\Phi_1\Big(  \frac{a- x_1\beta}{c_{11}} \Big) \Big)}\times

\dots \times

\frac{\frac{1}{c_{JJ}}\phi_J\Big(\frac{y^*_J - (x_J\beta + c_{J1}\eta_1 + c_{J2}\eta_2 + \dots + c_{JJ-1} \eta_{J-1})}{c_{JJ}}\Big)  }{\Big(\Phi_J \Big(  \frac{b- (x_J\beta + c_{J1}\eta_1 + c_{J2}\eta_2 + \dots + c_{JJ-1} \eta_{J-1})}{c_{JJ}} \Big) - \Phi_J \Big(  \frac{a- (x_J\beta + c_{J1}\eta_1 + c_{J2}\eta_2 + \dots + c_{JJ-1} \eta_{J-1}}{c_{JJ}}\Big) \Big)}\\

& = \frac{\prod_{j=1}^{J} \frac{1}{c_{jj}} \phi_j\Big( \frac{y^*_j - \sum_{k=1}^{k<j} c_{jk}\eta_k }{c_{jj}}\Big)}{ \prod_{j=1}^J \Big(\Phi_j \Big( \frac{b - \sum_{k=1}^{k<j} c_{jk}\eta_k}{c_{jj}} \Big) - \Phi\Big( \frac{a - \sum_{k=1}^{k<j} c_{jk}\eta_k}{c_{jj}}\Big)\Big)} \end{align} $$

where $$ \phi_j $$ is the standard normal pdf for choice $$ j $$.

Because $$ y^*_{j | \{y^*_{k<j} \}} \sim N(\mathbf{X_i\beta} + \sum_{k=1}^{k<j} c_{jk}\eta_k, c_{jj}^2) $$ the above standardization makes each term mean 0 variance 1.

Let the denominator $$ \prod_{j=1}^J \Phi_j \Big(  \frac{b - \sum_{k=1}^{k<j} c_{jk}\eta_k}{c_{jj}} \Big) - \Phi\Big( \frac{a - \sum_{k=1}^{k<j} c_{jk}\eta_k}{c_{jj}}\Big) = \prod_{j=1}^J  l_{jj} $$ and the numerator $$\prod_{j=1}^{J}\frac{1}{c_{jj}} \phi_j\Big( \frac{y^*_j - \sum_{k=1}^{k<j} c_{jk}\eta_k }{c_{jj}}\Big) = f_{N}(\mathbf{y_i^*} | \mathbf{X_i\beta}, \Sigma) $$ where $$ f_N(\cdot) $$ is the multivariate normal PDF.

Going back to the original goal, to evaluate the

\begin{align} \Pr(\mathbf{y_i}|\mathbf{X_i\beta}, \Sigma) = & \int_{A_j}f_N(\mathbf{y}^*_i|\mathbf{X_i\beta}, \Sigma) dy^*_j \\ \end{align} $$

Using importance sampling we can evaluate this integral,

\begin{align} \Pr(\mathbf{y_i}|\mathbf{X_i\beta}, \Sigma) = & \int_{A_j}f_N(\mathbf{y}^*_i|\mathbf{X_i\beta}, \Sigma) dy^*_j \\ = &\int_{A_j} \frac{f_N(\mathbf{y}^*_i|\mathbf{X_i\beta}, \Sigma)}{ q(\mathbf{y^*_i} | \mathbf{X_i\beta}, \Sigma) } q(\mathbf{y^*_i} | \mathbf{X_i\beta}, \Sigma) dy^*_j \\ = & \int_{A_j} \frac{f_N(\mathbf{y}^*_i|\mathbf{X_i\beta}, \Sigma)}{ \frac{f_N(\mathbf{y}^*_i|\mathbf{X_i\beta}, \Sigma)}{\prod_{j=1}^J l_{jj}} } q(\mathbf{y^*_i} | \mathbf{X_i\beta}, \Sigma) dy^*_j \\ = & \mathbb{E}_{\mathbf{q}} \Big( \prod_{j=1}^J  l_{jj}  \Big) \\ \end{align}

$$

This is well approximated by $$ \frac{1}{S} \sum_{s=1}^S \prod_{j=1}^J l_{jj} $$.