frechet {distributionsrd} | R Documentation |

Density, distribution function, quantile function, raw moments and random generation for the Fréchet distribution.

dfrechet(x, shape = 1.5, scale = 0.5, log = FALSE) pfrechet(q, shape = 1.5, scale = 0.5, log.p = FALSE, lower.tail = TRUE) qfrechet(p, shape = 1.5, scale = 0.5, log.p = FALSE, lower.tail = TRUE) mfrechet(r = 0, truncation = 0, shape = 1.5, scale = 0.5, lower.tail = TRUE) rfrechet(n, shape = 1.5, scale = 0.5)

`x, q` |
vector of quantiles |

`shape, scale` |
Shape and scale of the Fréchet distribution, defaults to 1.5 and 0.5 respectively. |

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

`lower.tail` |
logical; if TRUE (default), probabilities (moments) are |

`p` |
vector of probabilities |

`r` |
rth raw moment of the distribution |

`truncation` |
lower truncation parameter |

`n` |
number of observations |

Probability and Cumulative Distribution Function:

*f(x) =\frac{shape}{scale}≤ft(\frac{ω}{scale}\right)^{-1-shape} e^{-≤ft(\frac{ω}{scale}\right)^{-shape}}, \qquad F_X(x) = e^{-≤ft(\frac{ω}{scale}\right)^{-shape}}*

The y-bounded r-th raw moment of the Fréchet distribution equals:

* μ^{r}_{y} = scale^{σ_s - 1} ≤ft[1-Γ≤ft(1-\frac{σ_s - 1}{shape}, ≤ft(\frac{y}{scale}\right)^{-shape} \right)\right], \qquad shape>r*

dfrechet returns the density, pfrechet the distribution function, qfrechet the quantile function, mfrechet the rth moment of the distribution and rfrechet generates random deviates.

The length of the result is determined by n for rfrechet, and is the maximum of the lengths of the numerical arguments for the other functions.

## Frechet density plot(x = seq(0, 5, length.out = 100), y = dfrechet(x = seq(0, 5, length.out = 100), shape = 1, scale = 1)) plot(x = seq(0, 5, length.out = 100), y = dfrechet(x = seq(0, 5, length.out = 100), shape = 2, scale = 1)) plot(x = seq(0, 5, length.out = 100), y = dfrechet(x = seq(0, 5, length.out = 100), shape = 3, scale = 1)) plot(x = seq(0, 5, length.out = 100), y = dfrechet(x = seq(0, 5, length.out = 100), shape = 3, scale = 2)) ## frechet is also called the inverse weibull distribution, which is available in the stats package pfrechet(q = 5, shape = 2, scale = 1.5) 1 - pweibull(q = 1 / 5, shape = 2, scale = 1 / 1.5) ## Demonstration of log functionality for probability and quantile function qfrechet(pfrechet(2, log.p = TRUE), log.p = TRUE) ## The zeroth truncated moment is equivalent to the probability function pfrechet(2) mfrechet(truncation = 2) ## The (truncated) first moment is equivalent to the mean of a (truncated) random sample, #for large enough samples. x <- rfrechet(1e5, scale = 1) mean(x) mfrechet(r = 1, lower.tail = FALSE, scale = 1) sum(x[x > quantile(x, 0.1)]) / length(x) mfrechet(r = 1, truncation = quantile(x, 0.1), lower.tail = FALSE, scale = 1)

[Package *distributionsrd* version 0.0.6 Index]