Skip to contents

Density, distribution function, quantile function and random generation for the Yule-Simon distribution.

Usage

dyules(x, shape, log = FALSE)
pyules(q, shape, lower.tail = TRUE, log.p = FALSE)
qyules(p, shape)
ryules(n, shape)

Arguments

x, q, p, n

Same meaning as in Normal.

shape

See yulesimon.

log, lower.tail, log.p

Same meaning as in pnorm or qnorm.

Details

See yulesimon, the VGAM family function for estimating the parameter, for the formula of the probability density function and other details.

Value

dyules gives the density, pyules gives the distribution function, qyules gives the quantile function, and ryules generates random deviates.

Author

T. W. Yee

Note

Numerical problems may occur with qyules() when p is very close to 1.

See also

Examples

dyules(1:20, 2.1)
#>  [1] 0.6774193548 0.1652242329 0.0647938168 0.0318658116 0.0179525699
#>  [6] 0.0110818333 0.0073067033 0.0050640518 0.0036497670 0.0027147028
#> [11] 0.0020722922 0.0016166818 0.0012847803 0.0010374002 0.0008493335
#> [16] 0.0007038676 0.0005896273 0.0004986897 0.0004254225 0.0003657479
ryules(20, 2.1)
#>  [1] 3 3 1 1 1 1 1 1 2 1 2 6 3 3 1 2 1 1 1 1

round(1000 * dyules(1:8, 2))
#> [1] 667 167  67  33  19  12   8   6
table(ryules(1000, 2))
#> 
#>   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  23  25  32 
#> 659 174  62  32  24  14   6   2   3   3   3   2   1   1   3   1   2   2   1   1 
#>  37  49  54  57 
#>   1   1   1   1 

if (FALSE)  x <- 0:6
plot(x, dyules(x, shape = 2.2), type = "h", las = 1, col = "blue")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': object 'x' not found
 # \dontrun{}