dminimax: Minimax distribution family

View source: R/minimax.R

minimaxR Documentation

Minimax distribution family

Description

Four short functions to provide density, cumulative probability, quantile and random generation computational facilities for the minimax family of distributions.

Usage

dminimax(x, a = 1, b = 1, log = FALSE)
pminimax(x, a = 1, b = 1)
qminimax(y, a = 1, b = 1)
rminimax(n, a = 1, b = 1)

Arguments

x

Numeric vector giving the values at which the densities or cumulative probabilities are to be calculated.

y

Numeric vector giving the values at which the quantiles are to be calculated. Values must be between 0 and 1.

n

The number of pseudo-random values to be generated. If length(n) = 1, it must be a non-negative number; if length(n) > 1, the value for n is taken to be length(n).

a, b

Numeric vectors giving the parameters of the distribution. Values must be positive.

log

Logical scalar. Should the log-density be returned rather than the density itself?

Details

The minimax family distributions is a two-parameter with support [0,1]. It has properties very like the beta family, though is computationally much more tractible. Both beta and minimax families have the uniform(0,1) distribution as a special case. For the minimax family, this is the default case.

This package provides the standard four functions for handling the distribution in R using the standard prefix naming convention.

The functions are vectorized with respect to the arguments x, y, a, and b, with short arguments recycled to match the length of any longer ones.

Value

A vector of density, probability, quantile or pseudo-random values, respectively. Shape and name attributes of the first argument are preserved in the result.

Note

The functions are all written in pure R code.

Author(s)

Bill Venables

References

See this document for a detailed discussion.

See Also

punif, pbeta.

Examples

p <- pminimax(0:10/10, 1:5, 2)
q <- qminimax(p, 1:5, 2)
(d <- dminimax(matrix(0.5, 2, 2), 1:4, 2:3))

set.seed(123)
(r <- rminimax(letters, 2, 3))

minimax documentation built on Aug. 20, 2023, 9:06 a.m.