qlim.discrmixdist {mistr} | R Documentation |
Right-Hand Limit of Mixture Quantile Function
Description
qlim.mixdist
is a method that evaluates the right-hand limit of quantile function for a mixture distribution object at given values.
Usage
## S3 method for class 'discrmixdist'
qlim(O, p, lower.tail = TRUE, log.p = FALSE)
## S3 method for class 'contdiscrmixdist'
qlim(O, p, lower.tail = TRUE, log.p = FALSE)
## S3 method for class 'contmixdist'
qlim(O, p, lower.tail = TRUE, log.p = FALSE)
Arguments
O |
mixture distribution object. |
p |
vector of probabilities. |
lower.tail |
logical; if TRUE, probabilities are |
log.p |
logical; if TRUE, probabilities |
Details
Methods of qlim
function evaluates the right-hand limit of a quantile function for 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 will be added,
these functions must be reachable through the search path.
The values are numerically found using the uniroot
function, while the starting intervals are found
automatically. The option parameter tol
specifies the tolerance for the uniroot
.
Options parameter sub
is used to test whether the CDF at computed value minus sub
is not the same and thus the given value is not an
infimum. In such case, the root is found one more time for the value p - sub
.
Other methods qlim
have its own help page.
Value
Vector of computed results.
See Also
Examples
# q() of a negative transformed random variable uses qlim()
DM <- mixdist(3*binomdist(12,0.4), -2*poisdist(2)+12, weights=c(0.5, 0.5))
y <- c(0.05, 0.4, p(-DM, c(-5, -10, -15, -18)), 0.95)
x <- q(-DM, y)
plot(-DM, which = "cdf", only_mix=TRUE, xlim1 = c(-37, 0))
points(x, y)