rmunorm                 package:mcsm                 R Documentation

_R_a_n_d_o_m _g_e_n_e_r_a_t_o_r _f_o_r _t_h_e _m_u_l_t_i_v_a_r_i_a_t_e _n_o_r_m_a_l _d_i_s_t_r_i_b_u_t_i_o_n

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

     This function produces one random vector distributed from the
     multivariate normal distribution N(mu,sig).

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

     rmunorm(mu, sig)

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

      mu: Mean mu of the normal distribution

     sig: Covariance matrix sig of the normal distribution

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

     This function returns a real vector of the same dimension as mu.

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

     Similar to 'dmunorm', this function is fragile in that it does not
     test for

        1.  the fact that 'sig' is a square matrix,

        2.  the compatibility of the dimensions of 'x', 'mu', 'sig'

        3.  the symmetry nor the invertibility of the matrix 'sig'

     It is therefore prone to fail if those conditions are not
     satified! If the package 'bayesm' can be installed, 'rmvnorm' is
     to be prefered to 'rmunorm'.

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

     Christian P. Robert and George Casella

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

     Chapter 8 of *EnteR Monte Carlo Statistical Methods*

_S_e_e _A_l_s_o:

     rnorm,dmunorm,rmvnorm(bayesm)

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

     test=NULL
     for (t in 1:10^4) test=rbind(test,rmunorm(rep(1,2),matrix(c(1,-2,-2,10),ncol=2)))
     cor(test[,1],test[,2])*sqrt(10)  # should be close to -2

