Learn R Programming

VGAM (version 1.0-3)

Zeta: The Zeta Distribution

Description

Density, distribution function, quantile function and random generation for the zeta distribution.

Usage

dzeta(x, shape, log = FALSE)
pzeta(q, shape, lower.tail = TRUE)
qzeta(p, shape)
rzeta(n, shape)

Arguments

x, q, p, n

Same as Poisson.

shape

The positive shape parameter \(p\).

lower.tail, log

Same meaning as in Normal.

Value

dzeta gives the density, pzeta gives the distribution function, qzeta gives the quantile function, and rzeta generates random deviates.

Details

The density function of the zeta distribution is given by $$y^{-s-1} / \zeta(s+1)$$ where \(s>0\), \(y=1,2,\ldots\), and \(\zeta\) is Riemann's zeta function.

References

Johnson N. L., Kotz S., and Balakrishnan N. (1993) Univariate Discrete Distributions, 2nd ed. New York: Wiley.

See Also

zeta, zetaff, Oazeta, Oizeta, Otzeta.

Examples

Run this code
# NOT RUN {
dzeta(1:20, shape = 2)
myshape <- 0.5
max(abs(pzeta(1:200, myshape) -
    cumsum(1/(1:200)^(1+myshape)) / zeta(myshape+1)))  # Should be 0

# }
# NOT RUN {
 plot(1:6, dzeta(1:6, 2), type = "h", las = 1,
               col = "orange", ylab = "Probability",
     main = "zeta probability function; orange: shape = 2; blue: shape = 1")
points(0.10 + 1:6, dzeta(1:6, 1), type = "h", col = "blue") 
# }

Run the code above in your browser using DataLab