triplot            package:hyperdirichlet            R Documentation

_P_l_o_t _d_e_n_s_i_t_y _o_f _a _3_D _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:

     Plot (log) density of a 3D hyperdirichlet distribution

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

     triplot(HD, l = 100, do_image=TRUE, do_contour=TRUE, discard = 0.05, ...)

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

      HD: Either a function of a three-element vector, or a
          hyperdirichlet object

       l: Size of plot; larger values look much better but take longer

do_image,do_contour: Boolean, indicating whether to plot the image and
          contour respectively

 discard: Numeric; default 0.05 means to disregard densities less than
          the fifth percentile (_i.e._ quantile 0.05).  This makes the
          contour plot intervals prettier

     ...: Further arguments passed to 'image()' _and_ 'contour()'

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

     If argument 'HD' is not a function it is interpreted as a
     hyperdirichlet object.  If 'HD' is a function, 'triplot()' will
     pass it a three-element vector.

     If argument 'HD' is a hyperdirichlet object, then 'triplot()'
     plots contours of the log of the density (ie support).  If you
     want likelihood instead, see examples section for how to do this.

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

     The function returns (invisibly) an 'l'-by-'l' matrix holding the
     support as a function of the two independent variables, with 'NA'
     outside the domain.

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

     Robin K. S. Hankin

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

     a <- dirichlet(1:3)
     triplot(a,l=20)

     f <- function(p){1-p[1]+p[2]+8*p[2]^2*p[3]}
     triplot(f)

     g <- function(p){dhyperdirichlet(p, a, log=FALSE)}
     triplot(g,l=20)

