Learn R Programming

lmom (version 1.5)

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, cex, 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 argument y is omitted, x can be an object that contains both $L$-skewness and $L$-kurtosis values. It can be a vector with elements named
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 distribution identifiers are recognized, in upper or lower case: ll
twopar
Two-parameter distributions whose ($L$-skewness, $L$-kurtosis) values are to be plotted as points on the diagram. The following distribution identifiers are recognized, in upper or lower case: ll{ E
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.
cex
Symbol size for plotted points, like graphics parameter cex.
col
Vector specifying the colors. If it is of length 1 and x is present, it will be used for the plotted points. Otherwise it will be used for the lines on the plot. For the default colors for the lines, see the description
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{
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 the only graphics parameters passed to points are col (if of length 1), cex, and pch. If more complex features are required, such as different colors for different points, follow lmrd by an additional call to points, e.g. follow lmrd(t3, t4) by points(t3, t4, col=c("red", "green")).

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(t(aa), dist="", twopar="G", col="red")

Run the code above in your browser using DataLab