EXPERIMENTAL! This function computes the nonexceedance probability of a given quantile from a linear weighted combination of two quantile functions---a mixed distribution---when the data have been processed through the x2xlo
function setting up left-hand thresholding and conditional probability compuation. The par2qua2lo
function is a partial generalization of the par2qua2
function (see there for the basic mathematics). The Examples section has an exhaustive demonstration. 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.
par2qua2lo(f, para1, para2, xlo1, xlo2,
wfunc=NULL, weight=NULL, addouts=FALSE,
inf.as.na=TRUE, ...)
The mixed quantile values for likely a subset of the provided f
from the two distributions depending on the internals of xlo1
and xlo2
require the quantiles to actually start. This requires this function to return an R
data.frame
that was only optional for par2qua2
:
Nonexceedance probabilities.
The mixed quantiles.
The computation quamix
minus curve for para1
.
The computation quamix
minus curve for para2
.
Alternatively, the returned value could be a weighting function for subsequent calls as wfunc
to par2qua2lo
(see Examples). This alternative operation is triggered by setting wfunc
to an arbitrary character string, and internally the contents of xlo1
and xlo2
, which themselves have to be called as named arguments, are recombined. This means that the xin
and xout
are recombined, into their respective samples. Each data point is then categorized with probability zero for the xlo1
values and probability unity for the xlo2
values. A logistic regression is fit using logit-link function for a binomial family using a generalized linear model. The binomial (0 or 1) is regressed as a function of the plotting positions of a sample composed of xlo1
and xlo2
. The coefficients of the regression are extracted, and a function created to predict the probability of event “xlo2
”. The attributes
of the computed value inside the function store the coefficients, the regression model, and potentially useful for graphical review, a data.frame
of the data used for the regression. This sounds more complicated than it really is (see source code and Examples).
Nonexceedance probability (\(0 \le F \le 1\)).
The first distribution parameters from lmom2par
or vec2par
.
The second distribution parameters from x2xlo
.
The first distribution parameters from x2xlo
.
The second distribution parameters from lmom2par
or similar.
A function taking the argument f
and computing a weight for the para2
curve for which the complement of the computed weight is used for the weight on para1
.
An optional weighting argument to use in lieu of F
. If NULL
then weights are a function of length(xlo1$xin)
and length(xlo2$xin)
for the first and second distribution respectively, if weight
has length 1, then weight on first distribution is the complement of the weight, and the weight on second distribution is weight[1]
, and if weight
had length 2, then weight[1]
is the weight on the first distribution, and weight[2]
is the weight on the second distribution.
In the computation of weight factors when the xlo1$xin
and xlo2$xin
are used by other argument settings, the addouts
arguments triggers the inclusion of the lengths of the xlo1$xout
and xlo2$xout
(see source code).
A logical controlling whether quantiles for each distribution that are non-finite are to be converted to NA
s. If they are converter to NA
s, then when the application of the weight or weights are made then that those indices of NA
quantiles become a zero and the weight for the other quantile will become unity. It is suggested to review the source code.
Additional arguments to pass if needed.
W.H. Asquith
par2qua
, par2cdf2
, par2qua2
, x2xlo