qlim: Right-Hand Limit of Quantile Function

View source: R/standist.R

qlim.compdistR Documentation

Right-Hand Limit of Quantile Function

Description

qlim is a generic function that evaluates the right-hand limit of quantile function for a distribution object at given values.

Usage

## S3 method for class 'compdist'
qlim(O, p, lower.tail = TRUE, log.p = FALSE)

qlim(O, p, lower.tail = TRUE, log.p = FALSE)

## S3 method for class 'discrdist'
qlim(O, p, lower.tail = TRUE, log.p = FALSE)

## S3 method for class 'contdist'
qlim(O, p, lower.tail = TRUE, log.p = FALSE)

## S3 method for class 'trans_univdist'
qlim(O, p, lower.tail = TRUE, log.p = FALSE)

Arguments

O

distribution object.

p

vector of probabilities.

lower.tail

logical; if TRUE, probabilities are P[X ≤ x] otherwise, P[X > x], default: TRUE.

log.p

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

Details

Methods of qlim function evaluates the right-hand limit of any offered distribution object from the package mistr. The right-hand limit of a quantile function is defined as

Q(x+)=inf{x: p<P(X≤ x)}.

The function makes use of the p[sufix] and q[sufix] functions as pnorm, pbeta, qnorm, qbeta, and thus, if a new distribution is added, these functions must be reachable through the search path.

Methods for mixtures have its own help page.

Value

Vector of computed results.

Examples

B <- binomdist(10, 0.3)
qlim(B, plim(B, c(NA, 1, 3, 5)))

P <- poisdist()
M <- mixdist(B, P, weights = c(0.5, 0.5))
qlim(M, plim(M, c(NA, 1, 3, 5)))

CC <- compdist(B, P, weights = c(0.5, 0.5), breakpoints = 1)
CCC <- 2*CC+5
qlim(CCC, plim(CCC, c(NA, 1, 3, 5)))

mistr documentation built on March 7, 2023, 7:42 p.m.