1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/frechet-distribution.R
\name{Frechet}
\alias{Frechet}
\alias{dfrechet}
\alias{pfrechet}
\alias{qfrechet}
\alias{rfrechet}
\title{Frechet distribution}
\usage{
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{
\item{x, q}{vector of quantiles.}
\item{lambda, sigma, mu}{shape, scale, and location parameters.
Scale and shape must be positive.}
\item{log, log.p}{logical; if TRUE, probabilities p are given as log(p).}
\item{lower.tail}{logical; if TRUE (default), probabilities are \eqn{P[X \le x]}
otherwise, \eqn{P[X > x]}.}
\item{p}{vector of probabilities.}
\item{n}{number of observations. If \code{length(n) > 1},
the length is taken to be the number required.}
}
\description{
Density, distribution function, quantile function and random generation
for the Frechet distribution.
}
\details{
Probability density function
\deqn{
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
\deqn{
F(x) = \exp\left(-\left(\frac{x-\mu}{\sigma}\right)^{-\lambda}\right)
}{
F(x) = exp(-((x-\mu)/\sigma)^-\lambda)
}
Quantile function
\deqn{
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.
}
\concept{Continuous}
\concept{Univariate}
\keyword{distribution}
|