Learn R Programming

mistr (version 0.0.6)

qlim.compdist: 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 compdist
qlim(O, p, lower.tail = TRUE, log.p = FALSE)

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

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

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

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

Value

Vector of computed results.

Arguments

O

distribution object.

p

vector of probabilities.

lower.tail

logical; if TRUE, probabilities are \(P[X \le 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\le 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.

Examples

Run this code
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)))

Run the code above in your browser using DataLab