Learn R Programming

VGAM (version 0.7-1)

Hzeta: Haight's Zeta Function

Description

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

Usage

dhzeta(x, alpha)
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. A single positive integer.
alpha
The parameter value. Must contain positive values and is recycled to the length of x or p or q if necessary.

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 470 of Johnson N. L., Kotz S. and Kemp, A. W. (1993) Univariate Discrete Distributions, 2nd edition, Volume 2, New York: Wiley.

See Also

hzeta, zeta, zetaff.

Examples

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

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

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

Run the code above in your browser using DataLab