| par2qua2 | R Documentation |
This function computes the nonexceedance probability of a given quantile from a linear weighted combination of two quantile functions—a mixed distribution:
Q_\mathrm{mixed}(F; \Theta_1, \Theta_2, \omega) = (1-\omega)Q_1(F, \Theta_1) + \omega Q_2(F, \Theta2)\mbox{,}
where Q is a quantile function for nonexceedance probability F, the distributions have parameters \Theta_1 and \Theta_2, and \omega is a weight factor.
The distributions are specified by the two parameter object arguments in usual lmomco style. When proration by the nonexceedance probability is desired (weight=NULL, default), the left-tail parameter object (para1) is the distribution obviously governing the left tail; the right-tail parameter object (para2) is of course governs the right tail. The quantile function algebra is
Q(F) = (1-F^\star) \times {\triangleleft}Q(F) + F^\star \times Q(F){\triangleright}\mbox{,}
where Q(F) is the mixed quantile for nonexceedance probability F. {\triangleleft}Q(F) is the first or left-tail quantile function; Q(F){\triangleright} is the second or right-tail quantile function. In otherwords, if weight = NULL, then F^\star = F = f and the weight between the two quantile functions thus continuously varies from left to right. This is a probability proration from one to the other. A word of caution in this regard. The resulting weighted- or mixed-quantile function is not rigorously checked for monotonic increase with F, which is a required property of quantile functions. However, a first-order difference on the mixed quantiles with the probabilities is computed and a warning issued if not monotonic increasing.
If the optional weight argument is provided with length 1, then \omega equals that weight. If weight = 0, then only the quantiles for Q_1(F) are returned, and if weight = 1, then only the quantiles for the left tail Q_2(F) are returned.
If the optional weight argument is provided with length 2, then (1 - \omega) is replaced by the first weight and \omega is replaced by the second weight. These are internally rescaled to sum to unity before use and a warning is issued that this was done. Finally, the par2cdf2 function inverses the above equation for F.
par2qua2(f, para1, para2, wfunc=NULL, weight=NULL, as.list=FALSE, ...)
f |
Nonexceedance probability ( |
para1 |
The first or left-tail parameters from |
para2 |
The second or right-tail parameters from |
wfunc |
A function taking the argument |
weight |
An optional weighting argument to use in lieu of |
as.list |
A logical to control whether an R |
... |
The additional arguments are passed to the quantile function. |
The weighted quantile value for F from the two distributions.
W.H. Asquith
par2qua, par2cdf2, par2qua2lo
lmr <- lmoms(rnorm(20)); left <- parnor(lmr); right <- pargev(lmr)
mixed.median <- par2qua2(0.5, left, right)
# Bigger example--using Kappa fit to whole sample for the right tail and
# Normal fit to whole sample for the left tail
D <- c(123, 523, 345, 356, 2134, 345, 2365, 235, 12, 235, 61, 432, 843)
lmr <- lmoms(D); KAP <- parkap(lmr); NOR <- parnor(lmr); PP <- pp(D)
plot( PP, sort(D), ylim=c(-500, 2300))
lines(PP, par2qua( PP, KAP), col=2)
lines(PP, par2qua( PP, NOR), col=3)
lines(PP, par2qua2(PP, NOR, KAP), col=4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.