Learn R Programming

evd (version 1.2-3)

ext: Distributions of Maxima and Minima

Description

Density, distribution function, quantile function and random generation for the maximum/minimum of a given number of independent variables from a specified distribution.

Usage

dext(x, densfun, distnfun, ..., distn, mlen = 1, largest = TRUE,
     log = FALSE)
pext(q, distnfun, ..., distn, mlen = 1, largest = TRUE, lower.tail = TRUE) 
qext(p, quantfun, ..., distn, mlen = 1, largest = TRUE, lower.tail = TRUE) 
rext(n, quantfun, ..., distn, mlen = 1, largest = TRUE)

Arguments

x, q
Vector of quantiles.
p
Vector of probabilities.
n
Number of observations.
densfun, distnfun, quantfun
Density, distribution and quantile function of the distribution.
...
Parameters of the distribution.
distn
A character string, optionally specified as an alternative to densfun, distnfun and quantfun such that the density, distribution and quantile functions are formed upon the addition of the prefixes d
mlen
The number of independent variables over which the maximum/minimum is taken.
log
Logical; if TRUE, the log density is returned.
largest
Logical; if TRUE (default) use maxima, otherwise minima.
lower.tail
Logical; if TRUE (default) probabilities are P[X <= x],="" otherwise="" p[x=""> x].

Value

  • dext gives the density, pext gives the distribution function and qext gives the quantile function of the maximum/minimum of mlen independent variables from a specified distibution. rext generates random deviates.

Details

The density function must have a log argument (a simple wrapper can always be constructed to achieve this). If any parameter arguments are missing the default values (where they exist) in the density, distribution and quantile functions are used.

See Also

rgev,rorder

Examples

Run this code
dext(2:4, dnorm, pnorm, mean = 0.5, sd = 1.2, mlen = 5)
dext(2:4, distn = "norm", mean = 0.5, sd = 1.2, mlen = 5)
dext(2:4, distn = "exp", mlen = 2)
pext(2:4, distn = "exp", rate = 1.2, mlen = 2)
qext(seq(0.9, 0.6, -0.1), distn = "exp", rate = 1.2, mlen = 2)
rext(5, qgamma, shape = 1, mlen = 10)
p <- (1:9)/10
pexp(qext(p, distn = "exp", rate = 1.2, mlen = 1), rate = 1.2)
## [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

Run the code above in your browser using DataLab