# quaaep4kapmix: Quantile Function Mixture Between the 4-Parameter Asymmetric... In lmomco: L-Moments, Censored L-Moments, Trimmed L-Moments, L-Comoments, and Many Distributions

## Description

This function computes the quantiles of a mixture as needed between the 4-parameter Asymmetric Exponential Power (AEP4) and Kappa distributions given L-moments (lmoms). The quantile function of a two-distribution mixture is supported by par2qua2 and is

x(F) = (1-w) \times A(F) + w \times K(F)\mbox{,}

where x(F) is the mixture for nonexceedance probability F, A(F) is the AEP4 quantile function (quaaep4), K(F) is the Kappa quantile function (quakap), and w is a weight factor.

Now, the above mixture is only applied if the τ_4 for the given τ_3 is within the overlapping region of the AEP4 and Kappa distributions. For this condition, the w is computed by proration between the upper Kappa distribution bound (same as the τ_3 and τ_4 of the Generalized Logistic distribution, see lmrdia) and the lower bounds of the AEP4. For τ_4 above the Kappa, then the AEP4 is exclusive and conversely, for τ_4 below the AEP4, then the Kappa is exclusive.

The w therefore is the proration

w = [τ^{K}_4(\hatτ_3) - \hatτ_4] / [τ^{K}_4(\hatτ_3) - τ^{A}_4(\hatτ_3)]\mbox{,}

where \hatτ_4 is the sample L-kurtosis, τ^{K}_4 is the upper bounds of the Kappa and τ^{A}_4 is the lower bounds of the AEP4 for the sample L-skew (\hatτ_3).

The parameter estimation for the AEP4 by paraep4 can fall back to pure Kappa if argument kapapproved=TRUE is set. Such a fall back is unrelated to the mixture described here.

## Usage

 1 quaaep4kapmix(f, lmom, checklmom=TRUE) 

## Arguments

 f Nonexceedance probability (0 ≤ F ≤ 1). lmom A L-moment object created by lmoms or similar. checklmom Should the lmom be checked for validity using the are.lmom.valid function. Normally this should be left as the default and it is very unlikely that the L-moments will not be viable (particularly in the τ_4 and τ_3 inequality). However, for some circumstances or large simulation exercises then one might want to bypass this check.

## Value

Quantile value for nonexceedance probability F.

W.H. Asquith

## References

Asquith, W.H., 2014, Parameter estimation for the 4-parameter asymmetric exponential power distribution by the method of L-moments using R: Computational Statistics and Data Analysis, v. 71, pp. 955–970.

par2qua2, quaaep4, quakap, paraep4, parkap
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 ## Not run: FF <- c(0.0001, 0.0005, 0.001, seq(0.01,0.99, by=0.01), 0.999, 0.9995, 0.9999); Z <- qnorm(FF) t3s <- seq(0, 0.5, by=0.1); T4step <- 0.02 pdf("mixture_test.pdf") for(t3 in t3s) { T4low <- (5*t3^2 - 1)/4; T4kapup <- (5*t3^2 + 1)/6 t4s <- seq(T4low+T4step, T4kapup+2*T4step, by=T4step) for(t4 in t4s) { lmr <- vec2lmom(c(0,1,t3,t4)) # make L-moments for lmomco if(! are.lmom.valid(lmr)) next # for general protection kap <- parkap(lmr) if(kap$ifail == 5) next # avoid further work if numeric problems aep4 <- paraep4(lmr, method="A") X <- quaaep4kapmix(FF, lmr) if(is.null(X)) next # one last protection plot(Z, X, type="l", lwd=5, col=1, ylim=c(-15,15), xlab="STANDARD NORMAL VARIATE", ylab="VARIABLE VALUE") mtext(paste("L-skew =",lmr$ratios[3], " L-kurtosis = ",lmr$ratios[4])) # Now add two more quantile functions for reference and review # of the mixture. These of course would not be done in practice # only quaaep4kapmix() would suffice. if(! as.logical(aep4$ifail)) { lines(Z, qlmomco(F,aep4), lwd=2, col=2) } if(! as.logical(kap\$ifail)) { lines(Z, qlmomco(F,kap), lwd=2, col=3) } message("t3=",t3," t4=",t4) # stout for a log file } } dev.off() ## End(Not run)