Learn R Programming

lmomco (version 2.4.14)

z.par2qua: Blipping Quantile Functions

Description

This function acts as a front end or dispatcher to the distribution-specific quantile functions but also provides for blipping for zero (or other) threshold according to $$x(F) = 0$$ for \(0 \le F \le p\) and $$x_G\left(\frac{F-p}{1-p}\right)$$ for \(F > p\). This function is generalized for \(z \ne 0\). The \(z\) is not tracked as part of the parameter object. This might arguably be a design flaw, but the function will do its best to test whether the \(z\) given is compatable (but not necessarily equal to \(\hat{x} = x(0)\)) with the quantile function \(x(F)\).

A recommended practice when working with this function when \(F\) values are generated for various purposes, such as for graphics, then the value of \(p\) should be inserted into the vector, and the vector obviously sorted (see the line using the nonexceeds function). This should be considered as well when z.par2cdf is used but with the insertion of the \(x\) value at \(F=p\).

Usage

z.par2qua(f, p, para, z=0, ...)

Value

Quantile value for \(f\).

Arguments

f

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

p

Nonexceedance probability of z value.

para

The parameters from lmom2par or vec2par.

z

Threshold value.

...

The additional arguments are passed to the quantile function such as
paracheck = FALSE for the Generalized Lambda distribution (quagld).

Author

W.H. Asquith

References

Asquith, W.H., 2011, Distributional analysis with L-moment statistics using the R environment for statistical computing: Createspace Independent Publishing Platform, ISBN 978--146350841--8.

See Also

z.par2cdf, par2qua

Examples

Run this code
# define the real parent (or close)
the.gpa   <- vec2par(c(100,1000,0.1),type='gpa')
fake.data <- rlmomco(30,the.gpa) # simulate some data
fake.data <- sort(c(fake.data, rep(0,10))) # add some zero observations

par(mgp=c(3,0.5,0)) # going to tick to the inside, change some parameters
# next compute the parameters for the positive data
gpa.all <- pargpa(lmoms(fake.data))
gpa.nzo <- pargpa(lmoms(fake.data[fake.data > 0]))
n   <- length(fake.data) # sample size
p   <- length(fake.data[fake.data == 0])/n # est. prob of zero value
F   <- nonexceeds(sig6=TRUE); F <- sort(c(F,p)); qF <- qnorm(F)
PP  <- pp(fake.data) # compute plotting positions of sim. sample
plot(qnorm(PP), fake.data, ylim=c(0,4000), xaxt="n", xlab="") # plot the sample
add.lmomco.axis(las=2, tcl=0.5, twoside=TRUE, side.type="SNV", otherside.type="NA")
lines(qF,quagpa(F,gpa.all)) # the parent (without zeros)
lines(qF,z.par2qua(F,p,gpa.nzo),lwd=3) # fitted model with zero conditional
par(mgp=c(3,1,0)) # restore defaults

Run the code above in your browser using DataLab