rgood {good}R Documentation

Random generation for the Good distribution

Description

Random generation for the Good distribution with parameters z and s.

Usage

rgood ( n , z , s , th = 10^-6 )

Arguments

n

vector of number of observations to be generated, accounting for all possible combinations of parameters

z

vector of first parameter for the Good distribution

s

vector of second parameter for the Good distribution

th

defines the lower (q_1) and upper (q_2) quantiles such that P(X \le q_1)=th and P(X \le q_2)=1-th respectively.

Value

A vector containing n random deviates from a Good distribution with parameters z and s. Parameter z should be within the interval (0,1), and parameter s in the reals. rgood returns NaN if either arguments n or th are negative. rgood calls qgood and pgood from package good.

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, dgood, and pgood and qgood from good.

Examples

# if n is not a non-negative interger, function returns NaN with a warning
rgood ( n = -100 , z = 0.5 , s = -3 )

# if th is not positive, th is replaced by 1e-06 and a warning is provided
rgood ( n = 1 , z = 0.5 , s = -3 , th = -9 )

# if z is not within 0 and 1, NaN is returned with a warning
rgood ( n = 2 , z = c( -0.5, 0.5 ) , s = -3 )

rgood ( n = 10 , z = 0.6 , s = -3 )
rgood ( n = 1000 , z = 0.6 , s = -3 )
rgood ( n = c ( 3 , 10 ) , z = 0.6  , s = -3 )
rgood ( n = c ( 3 , 10 ) , z = c ( 0.2 , 0.8 ) , s = - 3 )
rgood ( n = c ( 3 , 10 , 6 ) , z = c ( 0.2 , 0.8 ) , s = c ( - 3 , -2 ) )
rgood ( n = 1000 , z = 0.3 , s = - 170 )


[Package good version 1.0.2 Index]