pars2x: Estimate Quantiles from an Ensemble of Parameters

pars2xR Documentation

Estimate Quantiles from an Ensemble of Parameters

Description

This function acts as a frontend to estimate quantiles from an ensemble of parameters from the methods of L-moments (lmr2par), maximum likelihood (MLE, mle2par), and maximum product of spacings (MPS, mps2par) for nonexceedance probabilities. The mean, standard deviation, and number of unique quantiles for each nonexceedance probability are computed too. The unique quantiles are used because the MLE and MPS methods could fall back to L-moments or other and thus it should be considered that one of the methods might have failed.

Usage

pars2x(f, paras, na.rm=FALSE, ...)

Arguments

f

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

paras

An ensemble of parameters from x2pars.

na.rm

A logical to pass to the mean and standard deviation computations.

...

The additional arguments, if ever used.

Value

A data.frame having, if at least one of the parameter estimation methods is not NULL, the following columns in addition to attributes that are demonstrated in the Examples section:

lmr

Quantiles based on parameters from method of L-moments.

mle

Quantiles based on parameters from MLE.

mps

Quantiles based on parameters from MPS.

f

The nonexceedance probabilities.

mean

The mean of the unique quantiles (usually three) seen for each probability. Results can be affected by na.rm.

sd

The standard deviation of the unique quantiles (usually three) seen for each probability. Results can be affected by na.rm.

n

The number of unique quantiles (usually three) seen for each probability and quantiles computed as NA are not counted.

Author(s)

W.H. Asquith

See Also

x2pars

Examples

## Not run: 
# Simulate from GLO and refit it. Occasionally, the simulated data
# will result in MLE or MPS failing to converge, just a note to users.
# This example also shows the use of the attributes of the Results.
set.seed(3237)
x <- rlmomco(32, vec2par(c(2.5, 0.7, -0.39), type="glo"))
three.para.est <- x2pars(x, type="glo")
FF <- nonexceeds() # a range in nonexceedance probabilities
# In the event of MLE or MPS failure, one will see NA's in the Results.
Results <- pars2x(FF, three.para.est, na.rm=FALSE)
sum <- attr(Results, "all.summary")
plot(pp(x), sort(x), type="n", ylim=range(sum), log="y")
polygon(attr(Results, "f.poly"), attr(Results, "x.poly"), col=8, lty=0)
points(pp(x), sort(x), col=3)
lines(Results$f, Results$lmr,  col=1) # black line
lines(Results$f, Results$mle,  col=2) # red   line
lines(Results$f, Results$mps,  col=4) # blue  line
lines(Results$f, Results$mean, col=6, lty=2, lwd=2) # purple mean # 
## End(Not run)

wasquith/lmomco documentation built on Nov. 13, 2024, 4:53 p.m.