Learn R Programming

lmom (version 1.1)

lmrd: L-moment ratio diagram

Description

Draws an $L$-moment ratio diagram.

Usage

lmrd(x, y, distributions = "GLO GEV GPA GNO PE3", twopar,
     xlim, ylim, pch=3, col, lty, lwd=1,
     legend.lmrd = TRUE, xlegend, ylegend,
     xlab = expression(italic(L) * "-skewness"),
     ylab = expression(italic(L) * "-kurtosis"), ...)

Arguments

x
Numeric vector of $L$-skewness values. Alternatively, if the y argument is omitted, x can be a vector of $L$-moment ratios, as returned for example by function samlmu. In this case the third and fourth elements
y
Numeric vector of $L$-kurtosis values.
distributions
Indicates the three-parameter distributions whose $L$-skewness--$L$-kurtosis relations are to be plotted as lines on the diagram. The following distributions are recognized: ll{ GLO generalized logistic GEV
twopar
Two-parameter distributions whose ($L$-skewness, $L$-kurtosis) values are to be plotted as points on the diagram. The following distributions are recognized: ll{ E or EXP exponential G or
xlim
x axis limits. Default: c(0, 0.6), expanded if necessary to cover the range of the data.
ylim
y axis limits. Default: c(0, 0.4), expanded if necessary to cover the range of the data.
pch
Plotting character to be used for the plotted ($L$-skewness, $L$-kurtosis) points.
col
Vector specifying the colors to be used for the lines on the plot. For the default values, see the description of the lty argument below.
lty
Vector specifying the line types to be used for the lines on the plot. By default, colors and line types are matched to the distributions given in the distributions parameter, as follows: ll{GLO color
lwd
Vector specifying the line widths to be used for the lines on the plot.
legend.lmrd
Controls whether a legend, identifying the $L$-skewness--$L$-kurtosis relations of the three-parameter distributions, is plotted. Not used if distributions=FALSE.
xlegend
x coordinate of the upper left corner of the legend. Default: the minimum x value. Not used if distributions=FALSE or legend.lmrd=FALSE.
ylegend
y coordinate of the upper left corner of the legend. Default: the maximum y value. Not used if distributions=FALSE or legend.lmrd=FALSE.
xlab
X axis label.
ylab
Y axis label.
...
Additional arguments are passed to the matplot function that draws the axis box and the lines for three-parameter distributions.

Details

lmrd calls a sequence of graphics functions: matplot for the axis box and the curves for three-parameter distributions; points for the points for two-parameter distributions and text for their labels; legend for the legend; and points for the $(x,y)$ data points. Note that additional parameters (...) are passed only to matplot, and cannot be used to change the color of plotted points. To do so, follow lmrd by an additional call to the points function, e.g. follow lmrd(t3, t4) by points(t3, t4, col="red").

Examples

Run this code
data(airquality)
lmrd(samlmu(airquality$Ozone))
# Tweaking a few graphics parameters makes the graph look better
# (in the author's opinion)
lmrd(samlmu(airquality$Ozone), xaxs="i", yaxs="i", las=1)

# An example that illustrates the sampling variability of L-moments
#
# Generate 50 random samples of size 30 from the Gumbel distribution
# - stored in the rows of matrix mm
mm <- matrix(quagum(runif(1500)), nrow=50)
#
# Compute the first four sample L-moments of each sample
# - stored in the rows of matrix aa
aa <- apply(mm, 1, samlmu)
#
# Plot the L-skewness and L-kurtosis values on an L-moment ratio
# diagram that also shows (only) the population L-moment ratios
# of the Gumbel distribution
lmrd(aa[3,], aa[4,], dist="", twopar="G")

Run the code above in your browser using DataLab