hyperdirichlet-package    package:hyperdirichlet    R Documentation

_T_h_e _H_y_p_e_r_d_i_r_i_c_h_l_e_t _p_a_c_k_a_g_e

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

     A generalization of the Dirichlet distribution

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


       Package:  hyperdirichlet
       Type:     Package
       Version:  1.1-8
       Date:     2008-03-26
       License:  GPL

     This package provides a generalization of the Dirichlet
     distribution that is useful for analyzing multinomial trials with
     _a priori_ restrictions.

     As an example, consider six people (players), numbered 1 to 6.
     These players are members of a running club and regularly race one
     another.

     Each player has an associated number p_1 to p_6, with 0 <= p_i <=
     1 for 1,...,6 and p_1 + ... + p_6=1.  If all six take part in a
     race, then the probability that player i wins is simply p_i.

     We wish to make inferences about the p_i from their performances.

     If all six race and p_i wins n_i, then the likelihood function is
     just


            p1^n1 * p2^n2 * p3^n3 * p4^n4 * p5^n5 * p6^n6.


     With a uniform prior, the posterior is Dirichlet.

     The players now have a race but only p_1, p_2 and p_3 take place,
     winning r_1, r_2 and r_3 respectively. The likelihood function is
     then


 p1^n1 * p2^n2 * p3^n3 * p4^n4 * p5^n5 * p6^n6 / (p1+p2+p3)^(r1+r2+r3)


     This distribution is not a Dirichlet distribution but is
     representable in this package; the R idiom would be

     ' jj <- dirichlet(powers = c(5,4,3,5,3,2)) ' ' jj <- jj +
     mult_restricted_obs(6, 1:3, c(4,5,2)) '

     where the first line specifies a Dirichlet distribution for the
     all-play data and the second line augments the likelihood with the
     observations from the restricted race.

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

     Robin K. S. Hankin

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

       jj <- dirichlet(powers = c(5,4,3,5,3,2))
       jj <- jj + mult_restricted_obs(6, 1:3, c(4,5,2))

     data(icons)
     maximum_likelihood(as.hyperdirichlet(icons))

