ghkvec                package:bayesm                R Documentation

_C_o_m_p_u_t_e _G_H_K _a_p_p_r_o_x_i_m_a_t_i_o_n _t_o _M_u_l_t_i_v_a_r_i_a_t_e _N_o_r_m_a_l _I_n_t_e_g_r_a_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     'ghkvec' computes the GHK approximation to the integral of a
     multivariate normal density over a half plane defined by a set of
     truncation points.

_U_s_a_g_e:

     ghkvec(L, trunpt, above, r)

_A_r_g_u_m_e_n_t_s:

       L: lower triangular Cholesky root of Covariance matrix 

  trunpt: vector of truncation points

   above: vector of indicators for truncation above(1) or below(0) 

       r: number of draws to use in GHK 

_V_a_l_u_e:

     approximation to integral

_N_o_t_e:

     'ghkvec' can accept a vector of truncations and compute more than
     one integral.  That is, length(trunpt)/length(above) number of
     different integrals, each with the same Sigma and mean 0 but
     different truncation points. See  example below for an example
     with two integrals at different truncation points.

_A_u_t_h_o_r(_s):

     Peter Rossi, Graduate School of Business, University of Chicago,
     Peter.Rossi@ChicagoGsb.edu.

_R_e_f_e_r_e_n_c_e_s:

     For further discussion, see _Bayesian Statistics and Marketing_ by
     Rossi,Allenby and McCulloch,  Chapter 2. 
      <URL:
     http://gsbwww.uchicago.edu/fac/peter.rossi/research/bsm.html>

_E_x_a_m_p_l_e_s:

     ##

     Sigma=matrix(c(1,.5,.5,1),ncol=2)
     L=t(chol(Sigma))
     trunpt=c(0,0,1,1)
     above=c(1,1)
     ghkvec(L,trunpt,above,100)

