Learn R Programming

VGAM (version 0.9-3)

Hzeta: Haight's Zeta Distribution

Description

Density, distribution function, quantile function and random generation for Haight's zeta distribution with parameter alpha.

Usage

dhzeta(x, alpha, log = FALSE)
phzeta(q, alpha)
qhzeta(p, alpha)
rhzeta(n, alpha)

Arguments

x, q
Vector of quantiles. For the density, it should be a vector with positive integer values in order for the probabilities to be positive.
p
vector of probabilities.
n
number of observations. Same as runif.
alpha
The parameter value. Must contain positive values and is recycled to the length of x or p or q if necessary.
log
Logical. If log = TRUE then the logarithm of the density is returned.

Value

  • dhzeta gives the density, phzeta gives the distribution function, qhzeta gives the quantile function, and rhzeta generates random deviates.

Details

The probability function is $$f(x) = (2x-1)^{(-\alpha)} - (2x+1)^{(-\alpha)},$$ where $\alpha>0$ and $x=1,2,\ldots$.

References

Page 533 of Johnson N. L., Kemp, A. W. and Kotz S. (2005) Univariate Discrete Distributions, 3rd edition, Hoboken, New Jersey: Wiley.

See Also

hzeta, zeta, zetaff.

Examples

Run this code
dhzeta(1:20, 2.1)
rhzeta(20, 2.1)

round(1000 * dhzeta(1:8, 2))
table(rhzeta(1000, 2))

alpha <- 1.1; x <- 1:10
plot(x, dhzeta(x, alpha = alpha), type = "h", ylim = 0:1, lwd = 2,
     sub = paste("alpha =", alpha), las = 1, col = "blue", ylab = "Probability",
     main = "Haight's zeta: blue = density; orange = distribution function")
lines(x+0.1, phzeta(x, alpha = alpha), col = "orange", lty = 3, lwd = 2, type = "h")

Run the code above in your browser using DataLab