Learn R Programming

lmomco (version 2.4.14)

par2qua2lo: Equivalent Quantile Function of Two Distributions Stemming from Left-Hand Threshold to Setup Conditional Probability Computations

Description

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.

Usage

par2qua2lo(f, para1, para2, xlo1, xlo2,
              wfunc=NULL, weight=NULL, addouts=FALSE,
              inf.as.na=TRUE, ...)

Value

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:

f

Nonexceedance probabilities.

quamix

The mixed quantiles.

delta_curve1

The computation quamix minus curve for para1.

delta_curve2

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).

Arguments

f

Nonexceedance probability (\(0 \le F \le 1\)).

para1

The first distribution parameters from lmom2par or vec2par.

para2

The second distribution parameters from x2xlo.

xlo1

The first distribution parameters from x2xlo.

xlo2

The second distribution parameters from lmom2par or similar.

wfunc

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.

weight

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.

addouts

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).

inf.as.na

A logical controlling whether quantiles for each distribution that are non-finite are to be converted to NAs. If they are converter to NAs, 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.

Author

W.H. Asquith

See Also

par2qua, par2cdf2, par2qua2, x2xlo