hd_add            package:hyperdirichlet            R Documentation

_A_d_d _t_w_o _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

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

     Given two hyperdirichlet distributions, add them, in the sense
     of concatenating their information, assumed to be independent.

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

     hd_add(e1, e2, assume_validated = FALSE)

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

   e1,e2: Hyperdirichlet distributions of the same dimension

assume_validated: Boolean, with default 'FALSE' meaning that the
          returned sum cannot be assumed to be proper; so the returned
          hyperdirichlet object is tested with 'is.proper()' (which is
          time-consuming).  Set to 'TRUE' only when you _know_ that the
          sum is proper

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

     Think of this function as a computerized embodiment of Bayes's
     theorem with 'e1' representing the prior and 'e2' representing one
     or more informative trials.

     The basic guts of the function is 'hyperdirichlet(powers(e1) +
     params(e2))'.  Note that this is equivalent to
     'hyperdirichlet(params(e1) + powers(e2))'.

     The functional form is not really intended for the end user; use
     'e1 + e2' instead (but observe that the sum will be validated
     using 'is.proper()', which may take a long time).

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

     Returns a hyperdirichlet distribution

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

     Robin K. S. Hankin

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

     'hyperdirichlet','is.proper','Arith'

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

     dirichlet(1:4) + gd(c(0.1 , 0.3 , 0.5), c(0.2 , 0.4 , 0.9))

     uniform(4) + single_bernoulli_obs(4,1,2)

     data(chess)
     ch <- as.hyperdirichlet(chess)
     stopifnot(all(params(ch+ch+ch) == params(ch*3)))

