Polono                 package:VGAM                 R Documentation

_T_h_e _P_o_i_s_s_o_n _L_o_g_n_o_r_m_a_l _D_i_s_t_r_i_b_u_t_i_o_n

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

     Density, and random generation for the Poisson lognormal
     distribution.

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

     dpolono(x, meanlog=0, sdlog=1, bigx=Inf, ...)
     rpolono(n, meanlog=0, sdlog=1)

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

       x: vector of quantiles.

       n: number of observations. If 'length(n) > 1' then the length is
          taken to be the number required. 

meanlog, sdlog : the mean and standard deviation of the normal
          distribution (on the log scale). They match the arguments in 
          'Lognormal'.

    bigx: Numeric. This argument is for handling large values of 'x'
          and/or when 'integrate' fails. A first order Taylor series
          approximation [Equation (7) of Bulmer (1974)] is used at
          values of 'x' that are greater or equal to this argument. For
          'bigx=10', he showed that the approximation has a relative
          error less than 0.001 for values of 'meanlog' and 'sdlog'
          ``likely to be encountered in practice''.  The default value
          means that this approximation is not used.  Setting something
          like 'bigx=100' may be a good idea.

     ...: Arguments passed into  'integrate'.

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

     The Poisson lognormal distribution is similar to the negative
     binomial in that it can be motivated by a Poisson distribution
     whose mean parameter comes from a right skewed distribution (gamma
     for the negative binomial and lognormal for the Poisson lognormal
     distribution).

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

     'dpolono' gives the density, and 'rpolono' generates random
     deviates.

_N_o_t_e:

     By default, 'dpolono' involves numerical integration that is
     performed using 'integrate'. Consequently, computations are very
     slow and numerical problems may occur (if so then the use of '...'
     may be needed). Alternatively, for extreme values of 'x',
     'meanlog', 'sdlog', etc., the use of 'bigx' avoids the call to
     'integrate'; however the answer may be a little inaccurate.

     For the maximum likelihood estimation of the 2 parameters a 'VGAM'
     family function called 'polono', say, has not been written yet.

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

     T. W. Yee

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

     Bulmer, M. G. (1974) On fitting the Poisson lognormal distribution
     to species-abundance data. _Biometrics_, *30*, 101-110.

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

     'lognormal', 'poissonff', 'negbinomial'.

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

     meanlog = 0.5; sdlog = 0.5
     y = 0:19
     proby = dpolono(y, m=meanlog, sd=sdlog)
     sum(proby)  # Should be 1
     ## Not run: 
     opar = par(no.readonly = TRUE)
     par(mfrow=c(2,2))
     plot(y, proby, type="h", col="blue", ylab="P[Y=y]", log="",
          main=paste("Poisson lognormal(meanlog=",meanlog,", sdlog=",sdlog,")",
                     sep=""))

     # More extreme values; use the approximation and plot on a log scale
     # Notice the kink at bigx.
     y = 0:190
     proby = dpolono(y, m=meanlog, sd=sdlog, bigx=100)
     sum(proby)  # Should be 1
     plot(y, proby, type="h", col="blue", ylab="P[Y=y]", log="y",
          main=paste("Poisson lognormal(meanlog=",meanlog,", sdlog=",sdlog,")"))

     # Random number generation
     table(y <- rpolono(n=1000, m=meanlog, sd=sdlog))
     hist(y, breaks=((-1):max(y))+0.5, prob=TRUE, border="blue")
     par(opar)
     ## End(Not run)

