| q.mixdist {mistr} | R Documentation |
Quantile Function of a Mixture Model
Description
q.mixdist is a method that evaluates the quantile function of a mixture distribution object at given values.
Usage
## S3 method for class 'mixdist'
q(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 |
... |
further arguments to be passed. |
Details
Methods of q function evaluates any offered
distribution from the package mistr. The function makes use of the p[sufix] and q[sufix] functions
as pnorm or qbeta and thus, if a new distribution is 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 values 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 q and the default
method q.default have its own help page.
Value
Vector of computed results.
See Also
Examples
DM <- mixdist(3*binomdist(12, 0.4), -2*poisdist(2)+12, weights=c(0.5, 0.5))
y <- c(0.4, p(DM, c(5, 10, 15, 18)), 0.95)
x <- q(DM, y)
plot(DM, which = "cdf", only_mix=TRUE, xlim1 = c(0, 37))
points(x, y)