Frechet function

Frechet distribution

Frechet distribution

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

dfrechet(x, lambda = 1, mu = 0, sigma = 1, log = FALSE) pfrechet(q, lambda = 1, mu = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE) qfrechet(p, lambda = 1, mu = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE) rfrechet(n, lambda = 1, mu = 0, sigma = 1)

Arguments

  • x, q: vector of quantiles.

  • lambda, sigma, mu: shape, scale, and location parameters. Scale and shape must be positive.

  • log, log.p: logical; if TRUE, probabilities p are given as log(p).

  • lower.tail: logical; if TRUE (default), probabilities are P[Xx]P[X \le x]

    otherwise, P[X>x]P[X > x].

  • p: vector of probabilities.

  • n: number of observations. If length(n) > 1, the length is taken to be the number required.

Details

Probability density function

f(x)=λσ(xμσ)1λexp((xμσ)λ)f(x)=λ/σ((xμ)/σ)(1λ)exp(((xμ)/σ)λ) f(x) = \frac{\lambda}{\sigma} \left(\frac{x-\mu}{\sigma}\right)^{-1-\lambda} \exp\left(-\left(\frac{x-\mu}{\sigma}\right)^{-\lambda}\right)f(x) = \lambda/\sigma * ((x-\mu)/\sigma)^(-1-\lambda) * exp(-((x-\mu)/\sigma)^-\lambda)

Cumulative distribution function

F(x)=exp((xμσ)λ)F(x)=exp(((xμ)/σ)λ) F(x) = \exp\left(-\left(\frac{x-\mu}{\sigma}\right)^{-\lambda}\right)F(x) = exp(-((x-\mu)/\sigma)^-\lambda)

Quantile function

F1(p)=μ+σlog(p)1/λF1(p)=μ+σlog(p)1/λ F^{-1}(p) = \mu + \sigma -\log(p)^{-1/\lambda}F^-1(p) = \mu + \sigma * -log(p)^{-1/\lambda}

Examples

x <- rfrechet(1e5, 5, 2, 1.5) xx <- seq(0, 1000, by = 0.1) hist(x, 200, freq = FALSE) lines(xx, dfrechet(xx, 5, 2, 1.5), col = "red") hist(pfrechet(x, 5, 2, 1.5)) plot(ecdf(x)) lines(xx, pfrechet(xx, 5, 2, 1.5), col = "red", lwd = 2)

References

Bury, K. (1999). Statistical Distributions in Engineering. Cambridge University Press.

  • Maintainer: Tymoteusz Wolodzko
  • License: GPL-2
  • Last published: 2023-11-30