bernoulli           package:hyperdirichlet           R Documentation

_H_y_p_e_r_d_i_r_i_c_h_l_e_t _d_i_s_t_r_i_b_u_t_i_o_n_s _f_o_r _v_a_r_i_o_u_s _t_y_p_e_s _o_f _i_n_f_o_r_m_a_t_i_v_e _t_r_i_a_l_s

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

     Hyperdirichlet distributions for various types of informative
     trials including Bernoulli and multinomial

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

     single_obs(d,n)
     obs(x)
     single_multi_restricted_obs(d,n,x)
     mult_restricted_obs(d, a, nobs)
     mult_bernoulli_obs(d,team1,team2,wins1,wins2)
     single_bernoulli_obs(d,win,lose)
     bernoulli_obs(d, winners, losers)

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

       d: Dimension of the distribution

       n: Number of the winner

       x: Summary statistic

a,win,lose,winners,losers,nobs,team1,team2,wins1,wins2: Arguments as
          detailed below

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

     These functions give likelihood functions for various
     observations. In the following, the paradigm is 'd' players and
     the object of inference is p=(p_1...p_d) (the skills) with
     sum(p_i)=1.  Different types of observation are possible.

     The most informative is the unrestricted, uncensored case in which
     all 'd' players play and the winner is identified unambiguously
     ('single_obs()').  However, other observations are possible, as
     detailed below:


        *  'single_obs(d,n)'.  Single multinomial trial: 'd' players,
           and player 'n' wins.

        *  'obs(x)'.  Repeated multinomial trials: 'sum(x)' trials,
           each amongst 'length(x)' players, with  player 'i' winning
           'x[i]' games (which might be zero)

        *  'single_multi_restricted_obs(d,n,x)'.  Single restricted
           multinomial trial: 'd' players, player 'n' wins, conditional
           on the winner being one of 'x[1]', 'x[2]', etc

        *  'mult_restricted_obs(d,a,nobs)'.  Multiple restricted
           multinomial trials: 'd' players, conditional on winners
           being  'a[1]', 'a[2]', etc.  Player 'a[i]' wins 'nobs[i]'
           times for 1 <= i <= d

        *  'mult_bernoulli_obs(d,team1,team2,wins1,wins2)'. Multiple
           Bernoulli trials between 'team1' and 'team2' with 'team1'
           winning 'wins1' and 'team2' winning 'wins2'

        *  'single_bernoulli_obs(d,win,lose)'.  Single Bernoulli trial:
           'd' players, with two teams ('win' and 'lose').  The winning
           team comprises 'win[1]', 'win[2]', etc and the losing team
           comprises 'lose[1]', 'lose[2]', etc.

        *  'bernoulli_obs(d, winners, losers)' Repeated Bernoulli
           trials: 'd' players.  Here 'winners' and 'losers' are lists
           of the same length; the elements are a team as in
           'single_bernoulli_obs()' above.   Thus game 'i' was between
           'winners[[i]]' and 'losers[[i]]' and, of course,
           'winners[[i]]' won.

     See examples section.

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

     All functions documented here return a hyperdirichlet object.

_N_o_t_e:

     The hyperdirichlet distributions returned by the functions
     documented here may be added (using '+') to concatenate
     independent observations.

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

     Robin K. S. Hankin

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

     # Five players, some results:

     jj1 <- obs(1:5)                             # five players, player 'i' wins 'i' games.
     jj2 <- single_obs(5,2)                      # open game, p2 wins
     jj3 <- single_multi_restricted_obs(5,2,1:3) # match: 1,2,3; p2 wins
     jj4 <- mult_restricted_obs(5,1:2,c(0,4))    # match: 1,2, p1 wins 2 games, p2 wins 3
     jj5 <- single_bernoulli_obs(5,1:2,3:5)      # match: 1&2 vs 3&4&5; 1&2 win
     jj6 <- mult_bernoulli_obs(6, 1:2,c(3,5), 7,8) # match: 1&2 vs 3&5; 1&2 win 7, 3&5 win 8
     jj6 <- bernoulli_obs(5,list(1:2,1:2), list(3,3:5)) # 1&2 beat 3; 1&2 beat 3&4&5

     # Now imagine that jj1-jj6 are independent observations:

     ans <- jj1 + jj2 + jj3 + jj4 + jj5 + jj6  #posterior PDF with uniform prior likelihood

