Learn R Programming

algebraic.dist (version 0.9.1)

sup: Generic method for retrieving the support of a (dist) object x.

Description

The returned value should have the following operations:

  • min: a vector, the minimum value of the support for each component.

  • max: a vector, the maximum value of the support for each component.

  • call: a predicate function, which returns TRUE if the value is in the support, and FALSE otherwise.

  • sample: a function, which returns a sample from the support. Note that the returned value is not guaranteed to be in the support of x. You may need to call call to check.

Usage

sup(x)

Value

A support object for x.

Arguments

x

The object to obtain the support of.

Examples

Run this code
x <- normal(0, 1)
S <- sup(x)
infimum(S)   # -Inf
supremum(S)  # Inf

y <- exponential(1)
S2 <- sup(y)
infimum(S2)  # 0

Run the code above in your browser using DataLab