Zipf {VGAM} | R Documentation

## The Zipf Distribution

### Description

Density, and cumulative distribution function for the Zipf distribution.

### Usage

    dzipf(x, N, s, log = FALSE)
    pzipf(q, N, s, log.p = FALSE)

### Arguments

`x, q` | vector of quantiles.

`N, s` | the number of elements, and the exponent characterizing the distribution. See `zipf` for more details.
`log` | Logical. If `log = TRUE` then the logarithm of the density is returned.
`log.p` | Same meaning as in `pnorm` or `qnorm`.

### Details

This is a finite version of the zeta distribution. See `zipf` for more details.

### Value

`dzipf` gives the density, and `pzipf` gives the cumulative distribution function.

### Author(s)

T. W. Yee

### See Also

`zipf`.

### Examples

    N <- 10; s <- 0.5; y <- 1:N
    proby <- dzipf(y, N = N, s = s)
    ## Not run:  plot(proby ~ y, type = "h", col = "blue", ylab = "Probability",
         ylim = c(0, 0.2), main = paste("Zipf(N = ",N,", s = ",s,")", sep = ""),
         lwd = 2, las = 1)
    ## End(Not run)
    sum(proby)  # Should be 1
    max(abs(cumsum(proby) - pzipf(y, N = N, s = s)))  # Should be 0

[Package VGAM version 1.0-2 Index]