rdiric                 package:VGAM                 R Documentation

_T_h_e _D_i_r_i_c_h_l_e_t _d_i_s_t_r_i_b_u_t_i_o_n

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

     Generates Dirichlet random variates.

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

     rdiric(n, shape, dimension = NULL)

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

       n: number of observations. 

   shape: the shape parameters. These must be positive. If 'dimension'
          is specifed, values are recycled if necessary to length
          'dimension'.

dimension: the dimension of the distribution.  If 'dimension' is not
          numeric then it is taken to be 'length(shape)'.

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

     This function is based on a relationship between the gamma and
     Dirichlet distribution. Random gamma variates are generated, and
     then Dirichlet random variates are formed from these.

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

     A 'n' by 'dimension' matrix of Dirichlet random variates. Each
     element is positive, and each row will sum to unity.

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

     Thomas W. Yee

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

     Lange, K. (2002) _Mathematical and Statistical Methods for Genetic
     Analysis_, 2nd ed. New York: Springer-Verlag.

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

     'dirichlet' is a 'VGAM' family function for fitting a Dirichlet
     distribution to data.

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

     y = rdiric(n=1000, shape=c(3, 1, 4))
     fit = vglm(y ~ 1, dirichlet, trace = TRUE, crit="c")
     Coef(fit)
     coef(fit, matrix=TRUE)

