dhyperdirichlet        package:hyperdirichlet        R Documentation

_P_r_o_b_a_b_i_l_i_t_y _d_e_n_s_i_t_y _f_u_n_c_t_i_o_n _f_o_r, _a_n_d _r_a_n_d_o_m _s_a_m_p_l_i_n_g _f_r_o_m, _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:

     Probability density function for the hyperdirichlet distribution
     in terms of either p or e; and random sampling using
     Metropolis-Hastings

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

     dhyperdirichlet_e(e, HD, include.Jacobian = TRUE)
     dhyperdirichlet(p, HD, include.NC = FALSE, TINY = 1e-10, log = FALSE)
     rhyperdirichlet(n, HD, start=NULL, sigma=NULL)

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

      HD: Object of class 'hyperdirichlet', or coerced thereto

       p: Vector of length 'dim(HD)', notionally summing to one

       e: Vector of length 'dim(HD)' giving the point in 'e'-space

include.Jacobian: In function 'dhyperdiriclet_e()', Boolean with
          default 'TRUE' meaning to include the Jabobian of the
          transform from 'e' to 'p'

include.NC: In function 'dhyperdirichlet_e()', Boolean with 'TRUE'
          meaning to include the normalization factor and default
          'FALSE' meaning not to include it (it is expensive to
          calculate).  Note that if the normalizing factor is not
          known, the function will return 'NA'

    TINY: In function 'dhyperdirichlet_p()', numeric, specifying
          minimum size for elements of 'p' via 'p <- pmax(p , TINY)'

     log: In function 'dhyperdirichlet_p()', Boolean with  default
          'FALSE' meaning to return the probability density and 'TRUE'
          meaning to return its logarithm

n,start,sigma: In function 'rhyperdirichlet()', 'n' is the number of
          observations to take, 'start' is the start-point for the
          random walk (with default 'NULL' meaning to use the neutral
          point), and 'sigma'is the standard deviation for the
          (Gaussian) kernel, with default 'NULL' meaning to use 1/d

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

     Function 'dhyperdirichlet()' gives the density as a function of
     the p_1, ..., p_d.

     Function 'dhyperdirichlet_e()' gives the density as a function of
     the e_i.  This is useful when integrating as the simplex (in
     p-space) transforms to a hypercube in e-space.

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

     Functions 'dhyperdirichlet()' and 'dhyperdirichlet_e()' return a
     scalar; function 'rhyperdirichlet()' returns a matrix whose rows
     are k-tuples

_N_o_t_e:

     Function 'dhyperdirichlet()' silently normalizes 'p' by 'p <-
     p/sum(p)'.

     The relationship between e and p is given in 'e_to_p.Rd'.

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

     Robin K. S. Hankin

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

     'maximum.likelihood','e_to_p'

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

     dhyperdirichlet(c(1,4,3,2)/10, dirichlet(1:4))

     rhyperdirichlet(20, dirichlet(1:3))

     diff(c(0,sort(runif(9)),1))  # random sample drawn from dirichlet(rep(1,10))

