rdirichlet               package:mcsm               R Documentation

_D_i_r_i_c_h_l_e_t _g_e_n_e_r_a_t_o_r

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

     This is a random generator for Dirichlet D(a1,...,ad)
     distributions, based on the normalisation of Gamma gamma(ai)
     random variables.

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

     rdirichlet(n, shape)

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

       n: Number of generations requested

   shape: Vector of ai's

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

     A (n,length(shape)) matrix, with one simulated vector per row.

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

     Christian P. Robert and George Casella

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

     Used in Chapter 7 *EnteR Monte Carlo Statistical Methods*

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

     rgamma

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

     A=rdirichlet(10^3,rep(.5,5))
     hist(A[,1],fre=FALSE,col="grey",nclass=123,xlim=c(0,1),
     main="",xlab=expression(p[1]))
     curve(dbeta(x,.5,4*.5),add=TRUE,col="sienna",lwd=2)

