Quantile Function of a Mixture Model
q.mixdist
is a method that evaluates the quantile function of a mixture distribution object at given values.
## S3 method for class 'mixdist' q(O, p, lower.tail = TRUE, log.p = FALSE, ...)
O |
mixture 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. |
... |
further arguments to be passed. |
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
.
Vector of computed results.
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.