matrix_to_HD         package:hyperdirichlet         R Documentation

_C_o_e_r_c_e _m_a_t_r_i_c_e_s _t_o _h_y_p_e_r_d_i_r_i_c_h_l_e_t _o_b_j_e_c_t_s

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

     Coerce matrices to hyperdirichlet objects.  These functions are
     not intended for the user (use 'as.hyperdirichlet()' instead).

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

     matrix_to_HD(x, calculate_NC = FALSE, bernoulli = NULL, ...)
     bernoulli_matrix_to_HD(x, calculate_NC = FALSE, ...)
     multinomial_matrix_to_HD(x, calculate_NC = FALSE, ...)

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

       x: Matrix to be coerced

bernoulli: In function 'matrix_to_HD()', Boolean with 'TRUE' meaning
          that the matrix rows are to be interpreted as repeated
          Bernoulli trials and  'FALSE' meaning that they are
          interpreted as multinomial trials.  Default 'NULL' means to
          use a simple heuristic to infer the desired behaviour

calculate_NC: Boolean, with default 'FALSE' meaning that the
          normalization constant is not to be calculated

     ...: Further arguments passed to 'as.hyperdirichlet()' (thence to
          'adapt()')

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

     These functions are not intended for the user; use
     'as.hyperdirichlet()' directly if at all possible.

     Function 'bernoulli_matrix_to_HD()' operates on rows.  Each row
     has entries corresponding to the columns (the players).  Each is
     a Bernoulli trial with three types of entry: 'NA' for not playing,
     '1' for on the winning side and '0' for on the losing side. 
     Thus the Bernoulli trial is between 'which(x==0)' and
     'which(x==1)', with the latter winning.  A warning is given unless
     there is at least one '1' and at least one '0' on each row.

     Function 'multinomial_matrix_to_HD()' also operates on rows. Each
     row corresponds to a series of restricted multinomial observations
     with likelihood given by 'mult_restricted_obs()' (qv).

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

     Returns a hyperdirichlet object

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

     Robin K. S. Hankin

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

     'mult_restricted_obs'

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

     data(icons)
     matrix_to_HD(icons, bern=FALSE)

