dgood {good} | R Documentation |
Probability mass function for the Good distribution
Description
Probability mass function for the Good distribution with parameters z and s.
Usage
dgood ( x , z , s )
Arguments
x |
vector of non-negative integer quantiles. |
z |
vector of first parameter for the Good distribution. |
s |
vector of second parameter for the Good distribution. |
Details
The Good distribution has the probability mass function (pmf):
P(X=x)=(1/F(z,s)) \cdot (z^{(x+1)}/(x+1)^s),
where x = 0, 1, 2 \ldots
. Parameter z should be within the interval (0,1)
, and parameter s in the reals.
F(z,s)
is the polylogarithm function:
F(z,s)=\sum_{i=1}^{\infty} z^n/n^s,
and acts in the pmf as the normalizing constant.
If F(z,s)
does not converge (e.g., for large negative values of the parameter s), the following
approximation is used instead:
F(z,s)\approx \Gamma(1-s) \cdot (-\log(z))^{(s-1)},
and dgood
returns approximated probabilities:
P(X=x) \approx \exp((x+1) \cdot \log(z) - s \cdot \log(x+1)-\log(\Gamma(1-s))-(s-1) \cdot \log(-\log(z))).
Value
dgood
gives the probability mass function for the Good distribution with
parameters z and s. x should be a vector of non-negative integer quantiles. If x is
non-integer and/or negative, dgood
returns 0
with a warning. z and s can be vectors with values
within the interval (0,1)
and the reals respectively. If vector z has negative values and/or outside
the interval (0,1)
, dgood
returns NaN with a warning.
If function polylog
from package copula returns Inf
(e.g., for large negative values of parameter s), dgood
uses the approximation
described above for probabilities, and additionally returns an informative warning.
Author(s)
Jordi Tur, David Moriña, Pere Puig, Alejandra Cabaña, Argimiro Arratia, Amanda Fernández-Fontelo
References
Good, J. (1953). The population frequencies of species and the estimation of population parameters. Biometrika, 40: 237–264.
Zörnig, P. and Altmann, G. (1995). Unified representation of zipf distributions. Computational Statistics & Data Analysis, 19: 461–473.
Kulasekera, K.B. and Tonkyn, D. (1992). A new distribution with applications to survival dispersal anddispersion. Communication in Statistics - Simulation and Computation, 21: 499–518.
Doray, L.G. and Luong, A. (1997). Efficient estimators for the good family. Communications in Statistics - Simulation and Computation, 26: 1075–1088.
Johnson, N.L., Kemp, A.W. and Kotz, S. Univariate Discrete Distributions. Wiley, Hoboken, 2005.
Kemp. A.W. (2010). Families of power series distributions, with particular reference to the lerch family. Journal of Statistical Planning and Inference, 140:2255–2259.
Wood, D.C. (1992). The Computation of Polylogarithms. Technical report. UKC, University of Kent, Canterbury, UK (KAR id:21052).
See Also
See also polylog
from copula, pgood
,
and qgood
and rgood
from good.
Examples
# if x is not a non-negative integer, dgood returns 0 with a warning
dgood ( x = -3 , z = c ( 0.6 , 0.5 ) , s = -3 )
dgood ( x = 4.5 , z = c ( 0.6 , 0.5 ) , s = -3 )
# if z is not within 0 and 1, dgood returns NaN with a warning
dgood ( x = 4 , z = c ( 0.6 , 0.5 , -0.9 ) , s = -3 )
# if the approximation is used, dgood returns a warning
dgood ( x = 330 : 331 , z = c ( 0.6 , 0.5 ) , s = -170 )
dgood ( x = 4 , z = 0.6 , s = -3 )
dgood ( x = 4 , z = c ( 0.6 , 0.5 ) , s = -3 )
dgood ( x = 4 : 5 , z = c ( 0.6 , 0.5 ) , s = c ( -3 , -10 ) )
dgood ( x = 4 : 6 , z = c ( 0.6 , 0.5 ) , s = c ( -3 , -10 ) )
dgood ( x = 3 : 5 , z = c ( 0.6 , 0.5 , 0.9 , 0.4 ) , s = c ( -3 , -10 ) )