Hzeta {VGAM}R Documentation

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, log.p = FALSE)
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.

log.p

Same meaning as in pnorm or qnorm.

Details

The probability function is

f(x) = (2x-1)^(-alpha) - (2x+1)^(-alpha),

where alpha>0 and x=1,2,....

Value

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

Note

Given some response data, the VGAM family function hzeta estimates the parameter alpha.

Author(s)

T. W. Yee and Kai Huang

See Also

hzeta, zeta, zetaff, simulate.vlm.

Examples

dhzeta(1:20, 2.1)
rhzeta(20, 2.1)

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

## Not run:  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")

## End(Not run)

[Package VGAM version 1.0-1 Index]