nmat                 package:bayesm                 R Documentation

_C_o_n_v_e_r_t _C_o_v_a_r_i_a_n_c_e _M_a_t_r_i_x _t_o _a _C_o_r_r_e_l_a_t_i_o_n _M_a_t_r_i_x

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

     'nmat' converts a covariance matrix (stored as a vector, col by
     col) to a correlation matrix (also stored as a vector).

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

     nmat(vec)

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

     vec: k x k Cov matrix stored as a k*k x 1 vector (col by col) 

_D_e_t_a_i_l_s:

     This routine is often used with apply to convert an R x (k*k)
     array of covariance MCMC draws to correlations. As in  
     'corrdraws=apply(vardraws,1,nmat)'

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

     k*k x 1 vector with correlation matrix

_W_a_r_n_i_n_g:

     This routine is a utility routine that does *not* check the input
     arguments for proper dimensions and type.

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

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

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

     ##
     set.seed(66)
     X=matrix(rnorm(200,4),ncol=2)
     Varmat=var(X)
     nmat(as.vector(Varmat))

