pollen            package:hyperdirichlet            R Documentation

_S_e_r_u_m _d_a_t_a _f_r_o_m _M_o_s_i_m_a_n_n _1_9_6_2

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

     Data from Mosimann 1962 detailing forest pollen counts

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

     data(pollen)

_F_o_r_m_a_t:

     A matrix with four columns and 76 rows.

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

     The rows each sum to 100; the values are counts of four different
     types of pollen.  Each row corresponds to a different level in the
     core; the levels are in sequence with the first row being most
     recent and the last row being the oldest.

_R_e_f_e_r_e_n_c_e_s:

     J. E. Mosimann 1962.  On the compound multinomial distribution,
     the multivariate beta-distribution, and correlations among
     proportions.  _Biometrika_, volume 49, numbers 1 and 2, pp65-82.

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

     'serum'

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

     data(pollen)

     func <- function(x,l){
     ifelse(any(l<0),Inf,
      lfactorial(sum(x)) -sum(lfactorial(x))
         +lgamma(sum(l)) +sum(lgamma  (x+l))
         -sum(lgamma(l)) -lgamma(sum  (x+l))
     )
     }

     start_vec <- c(51.6, 1, 5.3 , 2)

     optim(start_vec , function(l){ -sum(apply(pollen , 1, FUN=func,l=l))})

