

ninvwish(norm)                               R Documentation

_R_a_n_d_o_m _n_o_r_m_a_l_-_i_n_v_e_r_t_e_d _W_i_s_h_a_r_t _v_a_r_i_a_t_e

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

     Simulates a value from a normal-inverted Wishart dis-
     tribution. This function may be useful for obtaining
     starting values of the parameters of a  multivariate
     normal distribution for multiple chains of data augmen-
     tation.

_U_s_a_g_e_:

     ninvwish(s, params)

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

       s: summary list of an incomplete normal data matrix
          produced by the function `prelim.norm'.

  params: list of parameters of a normal-inverted Wishart
          distribution. In order, the elements of the list
          are: tau (a scalar), m (a scalar), mu0 (a vector
          of length ncol(x)), and lambdainv (a matrix of
          dimension c(ncol(x),ncol(x))). When using this
          function to create starting values for data aug-
          mentation, mu0 and lambdainv should be chosen in
          relation to the data matrix after the columns have
          been centered and scaled to have mean zero and
          variance one.

_V_a_l_u_e_:

     a vector in packed storage representing the simulated
     normal-inverted Wishart variate. This vector has the
     same form as parameter vectors produced by functions
     such as `em.norm' and `da.norm', and may be used
     directly as a starting value for these functions. This
     vector can also be put into a more understandable for-
     mat by `getparam.norm'.

_W_A_R_N_I_N_G_:

     Before this function may be used, the random number
     generator seed must be initialized with `rngseed' at
     least once in the current S session.

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

     See Section 5.4.2 of Schafer (1996).

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

     `rngseed', `getparam.norm', `em.norm' and `da.norm'.

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

     data(mdata)
     s_prelim.norm(mdata)   #do preliminary manipulations
     params_list(1,.5,rep(0,ncol(mdata)), .5*diag(rep(1,ncol(mdata)))) # gives widely dispersed values
     rngseed(1234567)
     start_ninvwish(s,params)  # draw a variate
     thetahat_em.norm(s,start=start) # run EM from this starting value

