Pospois                 package:VGAM                 R Documentation

_P_o_s_i_t_i_v_e-_P_o_i_s_s_o_n _D_i_s_t_r_i_b_u_t_i_o_n

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

     Density, distribution function, quantile function and random
     generation for the positive-Poisson distribution.

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

     dpospois(x, lambda)
     ppospois(q, lambda)
     qpospois(p, lambda)
     rpospois(n, lambda)

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

    x, q: vector of quantiles.

       p: vector of probabilities.

       n: number of observations. Must be a single positive integer. 

  lambda: vector of positive means (of an ordinary Poisson
          distribution).  Short vectors are recycled. 

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

     The positive-Poisson distribution is a Poisson distribution but
     with the probability of a zero being zero. The other probabilities
     are scaled to add to unity. The mean therefore is

                      lambda / (1-exp(-lambda)).

     As lambda increases, the positive-Poisson and Poisson
     distributions become more similar. Unlike similar functions for
     the Poisson distribution, a zero value of 'lambda' is not
     permitted here.

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

     'dpospois' gives the density, 'ppospois' gives the distribution
     function, 'qpospois' gives the quantile function, and 'rpospois'
     generates random deviates.

_N_o_t_e:

     For 'rpospois', the arguments of the function are fed into 'rpois'
     until n positive values are obtained.  This may take a long time
     if 'lambda' has values close to 0.

     The family function 'pospoisson' estimates lambda by maximum
     likelihood estimation.

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

     T. W. Yee

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

     'pospoisson', 'zapoisson', 'rpois'.

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

     lambda = 2
     y = rpospois(n=1000, lambda)
     table(y)
     mean(y)  # Sample mean
     lambda / (1-exp(-lambda)) # Population mean

     (i = dpospois(0:7, lambda))
     cumsum(i) - ppospois(0:7, lambda)  # Should be 0s
     table(rpospois(100, lambda))

     table(qpospois(runif(1000), lambda))
     round(dpospois(1:10, lambda) * 1000) # Should be similar

     ## Not run: 
     x = 0:7
     plot(x, dpospois(x, lambda), type="h", ylab="Probability",
          main=paste("Positive Poisson(", lambda, ") (blue) vs",
          " Poisson(", lambda, ") (red & shifted slightly)", sep=""),
          lwd=2, col="blue", las=1)
     lines(x+0.05, dpois(x, lambda), type="h", lwd=2, col="red")
     ## End(Not run)

