Learn R Programming

RTDE (version 0.2-2)

Frechet: The Frechet Distribution

Description

Density function, distribution function, quantile function, random generation.

Usage

dfrechet(x, shape, xmin, log = FALSE)
pfrechet(q, shape, xmin, lower.tail=TRUE, log.p = FALSE)
qfrechet(p, shape, xmin, lower.tail=TRUE, log.p = FALSE)
rfrechet(n, shape, xmin)

dufrechet(x, log = FALSE) pufrechet(q, lower.tail=TRUE, log.p = FALSE) qufrechet(p, lower.tail=TRUE, log.p = FALSE) rufrechet(n)

Value

dfrechet, dufrechet give the density,

pfrechet, pufrechet give the distribution function,

qfrechet, qufrechet give the quantile function, and

rfrechet, rufrechet generate random deviates.

The length of the result is determined by n for

rfrechet, rufrechet, and is the maximum of the lengths of the numerical parameters for the other functions.

The numerical parameters other than n are recycled to the length of the result. Only the first elements of the logical parameters are used.

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

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

shape

shape parameter.

xmin

lower bound parameter.

log, log.p

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

lower.tail

logical; if TRUE (default), probabilities are \(P[X \le x]\), otherwise, \(P[X > x]\).

Author

Christophe Dutang

Details

The Frechet distribution is defined by the following density $$ f(x) = shape * (x - xmin)^{(-shape-1)} * exp(-(x - xmin)^{(-shape)}) $$ for all \(x>xmin\). The unit Frechet distribution corresponds to xmin=0 and shape=1.

References

Kotz, S. and Nadarajah, S. (2000), Extreme Value Distributions: Theory and Applications, Imperial College Press.

Beirlant, J., Goegebeur, Y., Teugels, J., Segers (2004), Statistics of Extremes: Theory and Applications, John Wiley and Sons.

Examples

Run this code

#####
# (1) density function
x <- seq(0, 5, length=24)

cbind(x, dfrechet(x, 1/2, 1/4))

#####
# (2) distribution function

cbind(x, pfrechet(x, 1/2, 1/4))




		

Run the code above in your browser using DataLab