maximum_likelihood      package:hyperdirichlet      R Documentation

_M_a_x_i_m_u_m _l_i_k_e_l_i_h_o_o_d _p_o_i_n_t _f_o_r _t_h_e _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

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

     Maximum likelihood point for the hyperdirichlet distribution as
     estimated using numerical maximization.

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

     maximum_likelihood(HD, start_p = NULL, give = FALSE, disallowed = NULL, zero=NULL, ...)
                    mle(HD, start_p = NULL, give = FALSE, disallowed = NULL,            ...)
         mle_restricted(HD, start_p = NULL, give = FALSE, disallowed = NULL, zero=NULL, ...)

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

      HD: Object of class hyperdirichlet

 start_p: Start value for the 'p's.  See details section

    give: Boolean with default 'FALSE' meaning to return just the point
          estimate and 'TRUE' meaning to return all the output from
          'optim()'

disallowed: A function of 'p' returning a Boolean to restrict the
          search for the MLE.  See examples

    zero: In function 'maxlike_restricted()', a Boolean vector with
          'TRUE' elements corresponding to components that are
          constrained to be zero.  See details section

     ...: Further arguments sent to 'optim()'

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

     The user should use function 'maximum_likelihood()', which is a
     user-friendly wrapper for one of the two functions ('mle()' or
     'mle_rst()') depending on whether argument 'zero' is or is not
     'NULL'.

     Argument 'start_p' specifies the start point for the optimization;
     default 'NULL' is interpreted as 'rep(1/n,n)' where 'n' is
     'dim(HD)' (ie neutral position).

     It is not necessary to normalize 'start_p': this is done by
     'dhyperdirichlet()'. 

     Non-default values for this argument are interpreted by
     'dhyperdirichlet()'.

     Argument 'zero', if not default 'NULL', is Boolean in the standard
     case; but if it is not Boolean, it is interpreted as a numeric
     vector of integers indicating which components of the distribution
     are restricted to zero.  An example is given below.

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

     Returns a k-tuple.

_N_o_t_e:

     The functions minimize '-dhyperdirichlet(...,log=TRUE)'; so there
     is no need to set 'fnscale'.

     Be aware that the 'aylmer' package includes a function
     'maxlike()', which does something different.

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

     Robin K. S. Hankin

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

     'dhyperdirichlet_p','optim'

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

     maximum_likelihood(dirichlet(1:4))      # Should be 0:3

     jj.numerical <- maximum_likelihood(dirichlet(3:8), zero=2:3)$MLE

     jj <- c(2,0,0,5,6,7)
     jj.analytical <- jj/sum(jj)

     jj.numerical - jj.analytical  # should be small

