This function estimates the lower and upper limits of a specified confidence interval for aribitrary quantile values for a sample \(x\) and a specified distribution form. The estimation is based on the sample variance-covariance structure of the L-moments (lmoms.cov
) through a Monte Carlo approach. The quantile values, actually the nonexceedance probabilities (\(F\) for \(0 \le F \le 1\)), are specified by the user. The user provides type of parent distribution distribution and this form which will be fitted internal to the function.
qua2ci.cov(x,f, type=NULL, nsim=1000,
interval=c("confidence", "none"), level=0.90, tol=1E-6,
asnorm=FALSE, altlmoms=NULL, flip=NULL, dimless=TRUE,
usefastlcov=TRUE, nmom=5, getsimlmom=FALSE, verbose=FALSE, ...)
An R
data.frame
is returned.
The lower value of the confidence interval having nonexceedance probability equal to \((1-\)level
\()/2\).
The fit of the quantile based on the L-moments of x
and possibly by reflection controlled by flip
or based on the alternative L-moments in altlmoms
and again by the reflection controlled by flip
.
The upper value of the confidence interval having nonexceedance probability equal to \(1-(1-\)level
\()/2\).
The median of the simulated quantiles.
The mean of the simulated quantiles for which the median and mean should be very close if the simulation size is large enough and the quantile distribution is symmetrical.
The variance (\(\sigma^2(F)\)) of the simulated quantiles.
The L-scale (\(\lambda_2(F)\)) of the simulated quantiles for which \(\sigma^2(F) \approx \pi\times\lambda^2_2(F)\).
A real value vector.
Nonexceedance probabilities (\(0 \le F \le 1\)) of the quantiles for which the confidence interval is needed.
Three character distribution type (for example, type='gev').
The number of simulations to perform. Large numbers produce more refined confidence limit estimates at the cost of CPU time. The default is anticipated to be large enough to semi-quantitatively interpret results without too much computational delay. Larger simulation numbers are recommended.
The type of interval to compute. If "none"
, then the simulated quantiles are returned at which point only the first value in \(f\) or f[1]
will be considered but a warning will be issued to remind the user. This option is nice for making boxplots of the quantile distribution.
The confidence interval (\(0 \le \) level
\( < 1\)). The interval is specified as the size of the interval for which the default is 0.90 or the 90th percentile. The function will return the 5th [\((1-0.90)/2\)] and 95th [\((1-(1-0.90)/2)\)] percentile cumulative probability of the simulated quantile distribution as specified by the nonexceedance probability argument.
The tolerance argument of same name and default to feed to MASS::mvrnorm()
and try increasing this tolerance if the error “'Sigma' is not positive definite” occurs (see Note for more discussion).
Use the mean and standard deviation of the simulated quantiles as parameters of the Normal distribution to estimate the confidence interval. Otherwise, a Bernstein polynomial approximation (dat2bernqua
) to the empirical distribution of the simulated quantile distribution is used.
Alternative L-moments to rescale the simulated L-moments from the variance-covariance structure of the sample L-moments in x
. These L-moments need to be an lmomco package L-moment object (e.g. lmoms
). The presence of alternative L-moments will result in dimless=TRUE
.
A flipping or reflection value denoted as \(\eta\). The values in x
are flipped by this value (\(y = \eta - x\)) and analysis proceeds with flipped information, and then results are flipped back just prior to returning values with the exception that if getsimlmom=TRUE
then the simultated L-moments are in “flipped space.”
Perform the simulations in dimensionless space meaning that values in x
are converted by \(y = (x-\lambda_1)/\lambda_2\) and simulation based on \(y\) and scale is returned on output according to the L-moments of x
or the alternative L-moments in altlmoms
. Scale is returned to the simulated L-moments, if returned by getsimlmom=TRUE
, which is not fully parallel with the returned behavior when flipping is involved.
A logical to use the function Lmomcov()
from the Lmoments package to compute the sample variance-covariance matrices and not the much slower function lmoms.cov
in the lmomco package.
The number of L-moments involved. This argument needs to be high enough to permit parameterization of the distribution in type
but computational effort increases as nmom
gets large. This option is provided in conjunction with getsimlmom=TRUE
to be able to get a “wider set” of simulated L-moments returned than precisely required by the distribution. Also, some distributions might as part of their specific fitting algorithms, require inspection of higher L-moments than seemingly required than their numer of parameters suggests.
A logical controlling whether the simulated L-moment matrix having nsim
rows and nmom
columns is returned instead of confidence limits.
The verbosity of the operation of the function.
Additional arguments to pass such as to lmom2par
.
W.H. Asquith
lmoms
, lmoms.cov
, qua2ci.simple