Asquith Dissertation
Asquith Dissertation
Asquith Dissertation
by
William H. Asquith, B.S., M.S., Ph.D., P.G.
A Dissertation
In
Civil Engineering
Department of Civil and Environmental Engineering
Submitted to the Graduate Faculty
of Texas Tech University in
Partial Fulfillment of
the Requirements for
the Degree of
Doctor of Philosophy
Approved
May, 2011
Acknowledgments
I am especially grateful to my second Ph.D. (civil engineering) advisor, Theodore Cleveland, for yearsthat is, many yearsof collaboration and friendship. I am especially
grateful to George R. Herrmann, Meghan Roussel, David Thompson, and Ken Rainwater. These individuals and friends collectively encouraged and guided my post-2003
Ph.D. (geosciences) research efforts into L-moment applications and also were early users
and collective beneficiaries of an originally little L-moment package in R. I also am grateful to Stacey Archfield for being an early user of lmomco and for lively discussions about
the Kappa distribution, streamflow-duration curves, and all things as a linear moment.
I am grateful for my U.S. Geological Survey colleagues or supervisors (former, retired, or
current) for career opportunities and many adventures: Jim Bartolino, Peter Bush, David
Dunn, Franklin Heitmuller, Sonya Jones, Robert Joseph, George Ozuna, Meghan Roussel, Raymond Slade, and Lloyd Woosley. I am especially grateful to Thomas Burley for
performing a comprehensive review and becoming an R aficionado in the process.
I am grateful to Cal Barnes and Melanie Barnes for many years of support and for
providing a departmental home at Texas Tech University.
I am grateful to John Sharp, my 2003 Ph.D. (geosciences) advisor and his long support of
my statistical interests. To this day asks in jest: What exactly is an L-moment? My reply,
absent the math, is something like, An average of intra-differences of ordered samples.
(He then chuckles . . . )
I am especially grateful to Jonathan Hosking for his considerable breadth of theoretical
and applied research that led to the founding of L-moments, he is justifiably labeled as
the father of L-moments to quote Robert Serfling at the JSM 2008 conference in Denver,
Colorado. I must acknowledge Jonathans generosity in the development of the FORTRAN
library and many years of correspondence. The library and many of his publications are
ii
the canonical references on which much of the central or core code of the lmomco package
is based. I am grateful for early encouragement with R from Juha Karvanen. I am grateful
to the community of other researchers of L-moment and related topics whose work I hope
is adequately cited throughout this dissertation. Thanks.
I must give a sweeping thanks to the global open-source software community. A myriad
of powerful tools for research and communication, of which R is an obvious example, are
freely available for multiple computer platforms. Other open-source tools or organizations,
which are indispensable to me and my associates, deserving of special recognition are the
GNU project, TEX, LATEX, Perl, Linux, the MacOSX development communities, and the
contributers and users that support these efforts.
Finally, I am grateful to the loss of words for the unending support of my wife D'Anne,
our children Nathaniel and Caroline, and my parents George, Ann, Tom, and Linda. I am
proud and relieved to bring years of nights and weekends of reading, coding, writing,
reading, coding, writing, and editing to completion.
iii
Table of Contents
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1
Distributional Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2
1.3
1.3.1 L-moments in R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.2 Internet Resources for L-moments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4
1.5
1.6
Types of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.7
Distributional Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.1
2.2
2.3
3
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Order Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.1.1 Expectations and Distributions of Order Statistics . . . . . . . . . . . . . . . . 63
3.1.2 Distributions of Order Statistic Extrema . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.2
3.3
4
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Product Moments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
4.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
4.1.1 Sampling Bias and Sampling Variance . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4.2
4.3
4.4
4.5
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Probability-Weighted Moments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.2
5.3
5.4
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
L-moments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.2
6.3
6.4
6.5
6.6
6.7
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
7.1.1 Chapter Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7.1.2 Distributions of the lmomco Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
7.2
7.3
8
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
8.2
8.4
9
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
9.2
9.3
9.4
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Epilogue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Index of R Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
List of Tables
1.1
2.1
5.1
6.1
6.2
6.3
6.4
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
8.1
8.2
8.3
xii
List of Figures
1.1
Histograms of ozone and temperature for data in the airquality data frame
from example 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.2
Box plots of ozone, solar radiation, temperature, and wind speed data for
data in the airquality data frame from example 16 . . . . . . . . . . . . . . . . . . . . . . 21
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
4.2
4.3
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
Comparison two Rayleigh distributions fit as one- or twoparameter versions to L-moments of 1 = 0.964 and 2 = 0.581
for unknown and known ( = 0) lower bounds from example 730 . . . . . . . 202
7.9
7.10 Example PDF and two computations of CDF of a RICE(20, 40) distribution
from example 735 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
7.11 Comparison of CDF for signal = 17 for a range of signal-to-noise (SNR)
ratios for Rice distribution from example 737 . . . . . . . . . . . . . . . . . . . . . . . . . . 211
7.12 L-moment ratio diagram showing 500 simulations of n = 200 samples
for a Rice having = 5 and = 3 from example 738. The large open
circle reprsents the pair-wise means of L-skew and L-kurtosis and large
solid circle represents the population values. . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
xv
8.1
8.2
8.3
8.4
8.5
8.6
8.7
8.8
8.9
Time series by day of daily mean streamflow for U.S. Geological Survey
streamflow-gaging station 06766000 Platte River at Brady, Nebraska from
example 819 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
8.10 Flow-duration curve of daily mean streamflow for U.S. Geological Survey
streamflow-gaging station 06766000 Platte River at Brady, Nebraska from
example 820 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
8.11 Comparison of probability density functions for Weibull and Generalized
Extreme Value distributions fit to same L-moments of number of Internal
Revenue Service refunds by state from example 821 . . . . . . . . . . . . . . . . . . . . 250
xvi
9.2
9.3
9.4
9.5
9.6
9.7
9.8
9.9
11.1 Box plots of the distributions of 7-day annual maxima rainfall for seven
communities in the north-central Texas Panhandle from example 113 . . . . 317
11.2 Bean and violin plots of the distributions of 7-day annual maxima
rainfall for seven communities in the north-central Texas Panhandle from
example 114 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
11.3 L-moment ratio diagram showing 3 and 4 of 7-day annual maximum
rainfall for seven communities in Texas Panhandle (open circles) and
weighted mean value (filled circle) from example 118 . . . . . . . . . . . . . . . . . . 322
11.4 Empirical distribution of 7-day annual maxima rainfall for seven
communities in the Texas Panhandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
11.5 Box plots of empirical distribution of annual peak streamflow for five
selected river basins in the United States from example 1112 . . . . . . . . . . . . 326
11.6 L-moment ratio diagram showing 3 and 4 of annual peak streamflow
for five selected river basins in the United States from example 1115 . . . . . 328
11.7 Plots of QDF of fitted Wakeby distribution of annual peak streamflow
and empirical distribution for five selected river basins in the United
States from example 1118 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
11.8 Plots of PDF of fitted Wakeby distribution of annual peak streamflow for
five selected river basins in the United States from example 1119 . . . . . . . . 332
11.9 Empirical distribution of annual peak streamflow data for U.S. Geological
Survey streamflow-gagin station 02366500 Choctawhatchee River near
Bruce, Florida and Wakeby and four Generalized Lambda distributions
fit by method of L-moments from example 1122 . . . . . . . . . . . . . . . . . . . . . . . 335
12.1 Comparison of Right-Censored Generalized Pareto distribution fit
to right-tail censored probability-weighted moments (thick line) and
Generalized Pareto fit to whole sample probability-weighted moments
(thin line) from example 122 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
12.2 Comparison of three Kappa distribution fits to right-tail censored survival
data (dotted lines extended from reported limit) from example 125 . . . . . . 352
12.3 Empirical survival function (thin line and dashed 95-percent confidence
bands) by Kaplan-Meier method from the NADA package to left-tail
censored arsenic concentration in Oahu dataset compared to fit
of Generalized Normal distribution (thick line) by flipped and
right-censored L-moments by indicator variable from example 129 . . . . . . 356
xix
xxi
Preface
This dissertation concerns distributional analysis of univariate and continuous data with
L-moment statistics using the R environment for statistical computing. The primary audience are practitioners (engineers and scientists) involved in magnitude and frequency
analyses. These practitioners might not necessarily consider themselves as statisticians or
be extensively educated as such, yet they possess a basic or working knowledge of statistics and have a need to conduct distributional analysis in a computational context that
involves the development of empirical fits of probability distributions. It is anticipated
that these practitioners are responsible for, or have an interest in, the analysis of data having large range, variation, skewness, or large or small outliers. These data otherwise have
long or heavy tailsthat is, these data are considerably non-Normal.
As shown herein, L-moment statistics are useful tools for addressing practical problems
involving such data. Intended readers are expected to have some statistical education or
post-graduate training, but the topic of L-moment statistics very likely is new. Therefore,
this dissertation fills a gap in the applied literature and bridges a general gap between
statistics and the applied disciplines of science, engineering, finance, and medicine.
Hundreds of examples of R code and ancillary discussion are provided herein and are
intended to provide basic functional details of distributional analysis such as computation
of statistics, selection of distributions, and distribution fit. The examples also show general
use of L-moment-related functions and procedures available in R.
Through the code examples, demonstrations of L-moment statistics in the context
of applied circumstances are made, but background statistics, such as the well-known
product moments and lesser known probability-weighted moments, also are presented.
Demonstrations of the various properties of L-moments also are made along with comparisons to the product moments.
xxii
xxiii
marvelous richness relative to FORTRAN, my thoughts during this time were to write an
L-moment package (module) for the Perl programming language.
In spring 2004, while delaying before a trip to the airport for a return to Austin from
a visit to Texas Tech University in Lubbock, I stopped by the University Bookstore and
stumbled onto Peter Dalgaards Introductory Statistics with R. On a whim, I purchased
the book. I do not remember whether I had even heard of R at that time. (Although by that
time, I had received training in the graphical-user interface of S-Plus.) I am a supporter of
the world of multi-platform, open-source computingI am a fan of the Linux operating
system and the Perl programming language. It was immediately apparent that R filled a
substantial void in my tool chest because R would run on Linux, and at the time I currently
lacked an integrated, non-spreadsheet environment for statistical analysis, which would
run on that platform.
In the subsequent year or so, I used R extensively for regression analysis and other
statistical inquiries. I had written my own high-quality typesetting, data-visualization
system in Perl named TKG2, which interfaces with METAPOST and adheres to the refined
graphic style of the U.S. Geological Survey, so I had only limited need in production
situations for the graphical capabilities of R. (This dissertation significantly follows the
style of Hansen (1991) with various adaptions to styles seen in books on R.) During the
ensuing years, I continued to acquire other books on R, and often these books described
add-on packages. These packages were easily found on the Internet, generally worked as
advertised, and represent an impressive feature of Rperhaps the feature. Further, books
about R had a profound influence on my thoughts about statistical analysis in a practical
(workflow, productivity) sense as well as R as a tool for statistical education. From my
perspective as an applied researcher, mentor, and occasional educator, the R environment
is a fantastic system. In time, I became dependent on several packages, and I began to
think about L-moments in R and easing away from FORTRAN-based L-moment analysis.
In June 2005, I began, in my free time, a long process of R-package design and porting of
a large portion of the Hosking FORTRAN library to native R. I named the package lmomco
a play on lmoments and company or lmoments and comoments. During and after the
initial porting, which often was more or less a syntax re-expression exercise, I refined
numerous functions with increasingly more R-like syntax. I make no claim to writing
idiomatic R in general. For this dissertation, in particular, I have only used more idiomatic
constructs where I believe the context is clear. Several false starts in function nomenclature (dialect) for lmomco were made before settling on a style that is seen herein. Further,
xxiv
I continued to use free time to fill the nascent package with additional developments in
L-moment theory such as trimmed L-moments, censored L-moments , L-comoments, and
many other computation or convenience functions well beyond the Hosking FORTRAN
library.
Near the end of January 2006, I posted the lmomco package to the Comprehensive R
Archive Network for colleague review by the broader statistical community. This review
continues to the present. About that time, Juha Karvanen (the author of the Lmoments
package) and I had a several month discussion about L-moments, R, and the Generalized
Lambda distribution. The results of these discussions then governed further refinements
to the lmomco package. Following the initial release of lmomco, development continued
as numerous users from the global R community provided feedback. I am grateful for
their support of the lmomco packagethe bug reports and suggested enhancements and
features are welcome and most appreciated. In conclusion, several bugs and many needed
enhancements were identified and added during the writing of this dissertation.
William H. Asquith
Lubbock, Texas
April 18, 2011
xxv
Chapter 1
Introduction
Perhaps the one universal feature of data is that data are distributedthat is, all data
have a sample distribution. This distribution is produced by random samples from a
typically unknown parent distribution. The parent distribution often is a hypothetical
model of the population from which the data were drawn. The parent distribution can
range from the simple to the complex. Numerous probability distributions are described
by Ross (1994), Evans and others (2000), and similar texts cited later and R-oriented texts
such as Venables and others (2008) and others cited later. Many of the distributions considered by those authors are described in this dissertation. Although several are complex, the
univariate, smoothly-varying, limited-parameter distributions used herein never-the-less
represent idealized models of distribution geometry of the population.
It is possible that distributional analysis more often than not represents one of the first
forays towards interpretation and understanding of the information represented by the
data. Further, this foray likely is made before hypothesis tests, analysis of variance, linear
modeling (regression), or other analyses are performed. Distributional analysis also can
contribute to exploratory data analysis. Distributional analysis might be used for data
screening (such as for the detection of anomalous or erroneous data), or perhaps used for
the detection of changes in industrial processes (quality assurance and control purposes),
or the analysis might provide a means to an end, such as for the specification of design
heights for flood-control levees.
The context surrounding, and the community involved in, distributional analysis can
result in specific statistical approaches to become embedded by the colored lens of tradition. Perhaps the community involved with a particular data type deems that preference
should be given to a branch of statistics such as nonparametrics, or preference should be
given to a log-Normal distribution fit by the method of maximum likelihood, or preference
should be given to the method of moments for fitting a Weibull distribution.
Newcomers to a fieldbe they freshly minted statisticians, mathematicians, scientists,
computer scientists, engineers, interdisciplinary specialists, or temporary consultants
can be major contributors when given freedom of expression and freedom to explore
by administrators, managers, and mentors. Sometimes ignorance of the newcomer to
community-accepted nuances or a priori interpretations of data along with a lack of knowledge of traditional techniques for distributional analysis can be a positive source of change.
Newcomers often bring new insights, approaches, and tools to statistical problems. Oldtimers can become newcomers when experienced practitioners invest in new approaches
and tools and can assimilate these into the acquired wisdom of their careers.
2
tions GNU General Public License in source code form. It compiles and runs on
a wide variety of UNIX platforms and similar systems (including FreeBSD and
Linux), Windows, and MacOSX.
...
R is an integrated suite of software facilities for data manipulation, calculation
and graphical display. It includes an effective data handling and storage facility, a suite of operators for calculations on arrays, in particular matrices, a large,
coherent, integrated collection of intermediate tools for data analysis, graphical facilities for data analysis and display either on-screen or on hardcopy, and
a well-developed, simple and effective programming language which includes
conditionals, loops, user-defined recursive functions and input and output facilities.
...
Many users think of R as a statistics system. [The R Development Core Team]
prefer[s] to think of it of an environment within which statistical techniques are
3
implemented. R can be extended (easily) via packages. There are about eight
packages supplied with the R distribution and many more are available through
the [Comprehensive R Archive Network (CRAN)] family of Internet sites covering a very wide range of modern statistics.
This dissertation is oriented around statistical computing using R. The choice of R is
made in part because of the open and generous global community involved in the R
project, and this dissertation is a way of paying alms to the community. The power of the
community and the freedom available to members through use of R is made manifest by
the vast armada of packages available through the Comprehensive R Archive Network
(CRAN), which is accesssible through the R web site or directly at http://www.cran.
r-project.org. The core development team of R has made custom extensions to the
numerous examples and associated discussion, figures, and tables thus are intimately tied
to R. As context or layout requirements (or constraints) facilitated, Using R identifiersan
example is shown beloware placed throughout this dissertation. These identifiers are
intended to demark or signify a transition from the general statistical and mathematical
narrative to a computational context using R.
Using R
Using R
Assuming that R has been downloaded, installed, and can be successfully started, one
is presented with a textural interface (command line) similar to that shown in example 11 . For the example, the help() function is used to display the documentation
for the mean() function. The mean() function is used to compute the arithmetic mean.
The example ends with a termination of the R process by the q() function (quit). The
use of the q() function in the example also demonstrates the use of named arguments and
how such arguments are passed to R functions. For example 11 , the named argument
save="no" tells the exiting sequence to not save the current workspace and to bypass a
The example and the associated discussion illustrate that source code herein is typeset
in a monospaced font and that matched () characters preceded by an alphabetic string are
used to signify the name of a function. Code comments, characters not interpreted by R,
are preceded by the # character and are typeset herein with an # obligue type face. Multiple commands on a line are separated by the ; (semicolon) as done for the two print()
commands in the example. Spaces in strings are indicated by the " " character, but this
character is not typed by the userthe space bar suffices. Assignments to variables, scalars
in the case of the example, are made by the <- operator and generally not by the = sign.
The example also shows that the > character is the (default) command prompt. To facilitate cut-and-paste operations from portable document format (PDF) versions and the
monolithic LATEX source files of this dissertation, the prompts are suppressed in all other
examples. An additional note concerning the contents in the examples is needed.
Many of the examples have the code #pdf() and #dev.off() as pairs with graphical
plotting functions between the pair. The pdf() function is used to generate portable document format (PDF) files and shows the name of the portable document format (PDF) file
used in the typesetting of this dissertation; the dev.off() function closes the file. These
two functions are commented out by the # character. These functions are not intended for
end users but are specifically retained to remain available for errata correction in derivatives of this dissertation.
The large number of R examples and their typical length results in formidable challenges in page breaking and therefore layout. As a result, the examples in this dissertation
have been permitted to internally break like paragraphs across pages. It is anticipated that
this style will not be of major inconvenience to most readers. Virtually all of the figures
are generated by the examples, and for layout purposes, the figures for the most part have
been permitted to float to their present locations by the algorithms of the LATEX typesetting system. Finally, breaks between topically distinct examples or demonstrations, which
typically follow the Using R identifiers, are separated by a right-justified, black triangle.
The intent of the triangles is to help alert the reader to interruptions between narratives
describing one or more listings of example code and the example-specific discussion.
age (Asquith, 2011), which is a major component of this dissertation, can be accessed by
http://www.cran.r-project.org/package=lmomco. Finally, a particularly useful
aged to review this web page for a sweeping review of distributional packages using R;
many other details also are provided.
tor (2008). Readers interested in multivariate analysis might consider Everitt (2005). Two
outstanding books as references related to linear model building with R are Faraway (2005,
2006). A comprehensive reference on use of R for graphical display is provided by Murrell
(2006), and extensive discussion of R graphics in thoroughly documented applications
is provided by Keen (2010). Jurekov and Picek (2006) provide a reference on robust
statistics with R. A comprehensive quick reference to R and many auxiliary packages is
provided by Adler (2010).
Additional references that encompass the use of R in statistics education and applied
probability are Rizzo (2008), Verzani (2005), and Ugarte and others (2008). Finally,
Baclawski (2008) provides a detailed review of R programming techniques used in practical circumstances. Reimann and others (2008) provide extensive presentation of R in an
environmental statistics context; these authors have a different approach relative to the
other books in that they do not present line-by-line R programming examples. Qian (2010)
provides an outstanding case-study oriented review of basic to advanced statistical inference and modeling techniques associated with environmental, hydrologic, and ecological
data. Collectively, the cited books and others therein show that R has earned tremendous
popularity across a wide spectrum of disciplines.
Beyond a reasonable sampling of the relevant journal literature cited herein, there are
several books containing information about L-moments includeing Stedinger and others
(1993), Hosking and Wallis (1997), Hosking (1998) (article), Gilchrist (2000), Dingman
(2002), and Kottegoda and Rosso (2008). In particular, Stedinger and others (1993) and
Hosking and Wallis (1997) are canonical L-moment references as well as the monograph
of Hosking (1986) on probability-weighted moments.
What are L-moments? To answer succinctly, although not expected to be clear to most
readers at this point, L-moments (Hosking, 1990) are defined through linear combinations of the expected values of order statistics. The study of order statistics is a branch
of statistics concerned with the statistics of ordered random variables and samples. The
familiar minimum, maximum, and median are likely the most familiar order statistics.
L-moments are direct analogsbut not numerically equivalentto well-known product moments, such as standard deviation or skew. The first L-moment is the arithmetic
mean, which should be particularly comforting to readers who are not previously familiar
with L-moments. As analogs, L-moments have similar, that is, familiar, interpretations
and hence applications as the product moments. L-moments, therefore, are useful and
are intellectually accessible to most of the general scientific and engineering community.
Accessibility into L-moment theory is greatly enhanced in practical application by the
L-moment support available in R as described and demonstrated in this dissertation.
L-moments have many advantages over the product moments including natural unbiasedness, robustness, and often smaller sampling variances than provided by other estimators. These advantages are particularly important with data having large range or variation, large skewness, and heavy tails. The sampling properties of L-moments are central
to their attractiveness for distributional analysis of Normal to non-Normal, symmetrical to
asymmetrical, and thin to heavy-tailed distributions. The attractive sampling properties
in the context of using R are shown by example. In short, L-moments provide comprehensive drop in replacements for product moments in many practical situations or at the
very least are complementary to the product moments.
L-moments have an exciting extension to multivariate data. These L-moments are
known as L-comoments (Serfling and Xiao, 2007). L-comoments can measure asymmetrical relations between variables in multivariate data. Multivariate distributional analysis
is generally outside the univariate scope of this dissertation. However, in a circumstance
(the terminal section of this dissertation) where it makes sense, L-comoments are included
along with copulas, which are convenient mathematical constructs for multivariate work.
9
1.3.1 L-moments in R
At the time of this writing (2011), three R packages in particular provide generalized support L-moment-based approaches for distributional analysis. The packages are
Lmoments (L-moments and Quantile Mixtures) by Karvanen (2009), lmomco (L-moments,
Trimmed L-moments, L-comoments, Censored L-moments, and Many Distributions) by the
author (Asquith, 2011), and lmom (L-moments) by Hosking (2009a). There also is the morediscipline-specific lmomRFA (Regional Frequency Analysis using L-moments) package by
Hosking (2009b).
Collectively, these packages answer a call by Royston (1992) who states in the abstract
that Indices of distributional shape based on linear combinations of order statistics have
recently [1990] been described by [Hosking (1990)]. [The] usefulness [of L-moments] as
tools for practical data analysis is examined. [L-moments] are found to have several advantages over the conventional [product moment] indices of [skew] and kurtosis [with] no
serious drawbacks. Royston (1992) continues It is proposed, therefore, that [L-moments]
should replace [skew] and [kurtosis] in routine data analysis, [and] to implement this suggestion, action by the developers of standard statistical software is needed. (The bold
typeface is this authors.)
Other packages, such as the POT package (Generalized Pareto and Peaks over Threshold)
by (Ribatet, 2009) and the RFA package (Regional Frequency Analysis) by (Ribatet, 2010),
provide for computation of L-moments and discipline-specific features. Collectively, the
six cited packages appear to currently (2011) cover, albeit with some redundancy, the
general gambit of L-moment theory and support from the CRAN. A listing of packages that
provide L-moment support,1 in the order of initial release, is provided in table 1.1. There
remains much room for growth in R for packages related to L-moments, and additional
discussion is provided in the Epilogue of this dissertation.
Gilleland and others (2010) provide the extRemes package related to extreme value analysis
that uses some L-moment functions from the Lmoments package by Karvanen (2009). Also, Su
(2010) provides the GLDEX that is focused on the Generalized Lambda distribution (see page 272
for more discussion). The package provides for parameter estimation using Sus own L-moment
functions. These functions are credited to Karvanen and thus seem to derive from the Lmoments
package. The GLDEX package also provides many appropriate citations to Asquith (2007).
10
Table 1.1. Summary of L-moment related R packages available on the CRAN in order of initial
release
Package
POT
RFA
Lmoments
lmomco
lmom
lmomRFA
Citation
Ribatet (2009)
Ribatet (2010)
Karvanen (2009)
Asquith (2011)
Hosking (2009a)
Hosking (2009b)
Initial release
September 6, 2005
September 14, 2005
October 12, 2005
January 31, 2006
July 3, 2008
March 3, 2009
Current release
October 16, 2009
January 14, 2010
January 19, 2011
April 15, 2011
November 29, 2009
August 22, 2010
at http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.
do?objectType=author&objectId=1094208 and a Stata module by Nicholas
11
Another purpose of this dissertation is to serve as a supplemental text in courses involving analysis of univariate distributions and samples. Dingman (2002, Appendix C) and
also Kottegoda and Rosso (2008) are textbooks oriented towards civil and environmental
engineering, and both books provide treatment, albeit brief, of L-moments.2 To enhance
the textbook purpose, vocabulary words at their primary introduction or definition are
typeset in bold typeface as are the page numbers in the index.
The purposes of this dissertation are achieved by a balance of mathematical discussion
(about 515 numbered equations) and use of L-moments along with related statistics in
both theoretical (simulation) and practical (real-world data) circumstances. To achieve this
purpose, numerous examples of R code are provided, and the lmomco, lmom, and Lmoments
packages are used. The focus here however is near universal on the lmomco package, and
the authors unique contributions to the field. A major purpose of this dissertation is to
further enhance the documentation of the authors lmomco package far beyond the scope
of the users manual (Asquith, 2011).
This dissertation generally is organized as follows. This introductory chapter provides
(1) background discussion prior to delving into distributional analysis and (2) a small
section of basic visualization of sample distributions using R.
Chapter 2 provides an introduction to the concepts of distributional analysis, probability distributions, and discussion of basic summary statistics. Also in Chapter 2, the
properties of probability distributions, the technique of fitting a distribution by moments
(a generic or conceptual meaning at this and that point in the narrative), and alternative
methods for visualization of distributions are described. Ending Chapter 2 is a simple
demonstration of distributional analysis for both simulated and real-world data in order
to cast appropriate themes for the remainder of this dissertation. To complete the background and setup, Chapter 3 provides an introduction to the order statistics and demonstrates some connections to L-moment theory.
In order to provide a complete narrative and provide for juxtaposition with L-moments,
Chapter 4 defines and demonstrates the use of product moments. Some basic sampling
properties of product moments are expressed in that chapter through many examples.
Chapter 5 defines and demonstrates use of the probability-weighted moments, which
were historic predecessors to L-moments. The probability-weighted moments are very
2
It should be noted that Dingman provides more detailed treatment. The author took a civil engineering course in 1994 in which a handbook containing Stedinger and others (1993) was used
as a supplemental text. Stedinger and others (1993) provides much detail concerning L-moments.
12
The topic of goodness-of-fit is enormous and the single book and paper cited here are but a trifle
of the literature on the subject. Internet searches are suggested: L-moments goodness-of-fit will
provide hits of particular relevance to this dissertation. Finally, because plotting positions are so
common in the hydrologic sciences and this dissertation, the citation to Vogel (1986) is justified.
13
which are more advanced and naturally are more dependent on material presented in previous chaptersthe elementary portions of the examples are less thoroughly described.
It also is assumed that readers are capable of installing external R packages and have
already installed the lmomco, lmom, and Lmoments packages. For virtually all of the examples herein, it is assumed that at least the lmomco package has been loaded into the work
session to gain access to package functionality.
Example 12 demonstrates the package loading mechanism or library() function
of R. The majority of the examples, however, use (require) the lmomco package only. When
the lmom, Lmoments, or other packages are used, it will be made clear to the reader and
often made explicitly clear by library() calls. The narrative is purposefully written so
as to generally not identify the source of the function such as: the library() function of
R or the cdfgum() function of lmomco. Such a practice would considerably lengthen
the text. The Index of R Functions distinguishes between the source of each function presented herein, and readers are explicitly directed there when confusion arises concerning
the source package of a function.
12
Finally, the installation methods for R packages vary slightly by computer platform and
security credentials available to the user. Readers requiring initial instruction or assistance
should consult the R website at http://www.r-project.org and follow the links such
as Manuals or FAQS. Even brief searches on the Internet with terms such as installation
of R should find helpful guides and documents on installing R for most computer platforms.
towards, heavy tails (left, right, or both), asymmetry, and the regular presence of outliers are examples for which the properties L-moments are attractive. Examples of such
data types are earthquake (geophysical), floods and droughts (hydrological), and rainfall
(meteorological). Hydrological and meteorological data often will be used herein as these
data are the most familiar to the author.
Throughout this dissertation, numerous, and generally self-contained, examples are
provided. Often these examples use simulation (see Ross, 1994, chap. 10) to generate synthetic data by random drawings from a specified parent distribution. An R-oriented discussion of simulation is found in Rizzo (2008, chap. 3), Verzani (2005, chap. 6), and Qian
(2010).
Simulations and simulated data are used herein for at least two purposes. First, generation of simulated data in the examples facilitates the construction of self-contained code
and minimizes the presentation overhead related to accessing and reading in external
data. Second, by explicitly specifying the parent distribution or truth in a statistical
context, the characteristics or properties of various statistics or distributional form can be
explored here and independently by self-study-minded readers. Simulated data removes
the constraints of sample size and permits exploration of the effects of sample size on
statistical procedures. As will be seen, the R environment is outstanding for statistical
experimentation by simulation.
It is assumed that most readers who originate from nonstatistical backgrounds might
have limited or perhaps no prior experience with simulation and exploration of sampling
properties of statistical estimators. This assumption is made based on the authors experiences with curricula outside of degrees in statistics, and particularly experiences with
geoscience and engineering programs, that lack a core statistical component. As a result,
many of the examples are intended to provide a sufficient structure to aid adventurous
readers in self study. By incorporating simulated data, readers implementing the examples
will produce numerical or graphical output that should differ in value or appearancebut
the general nature of the results should remain the same. An appropriate balance between
real-world data and simulated data hopefully has been achieved.
Using R
Using R
Input of external data and output of results to external files is an important feature
of R. For some examples, the loading of external data files is needed. Five functions in
16
particular are useful and are listed at the R prompt by ?read.table. Those functions
are listed in example 13 .
13
Following Rizzo (2008, p. 367), the creation and use of a comma separated file or a
*.csv file is informative. In example 14 , a data frame is created for some fabricated
streamflow data, and these data are written using the write.table() function to a file
titled temp.csv. In turn, the data are reloaded using the read.csv() function. A type
of input-output process in R is shown.
14
17
1
2
3
4
5
6
7
8
9
10
0
10
40
50
100
400
300
200
75
50
60
120
180
240
300
360
420
480
540
600
For the examples in this dissertation however, the majority of external data have been
formatted into the *.RData format (see ?save) and are available from the lmomco package. These data are accessed by the data() function, which is formally introduced in the
next section.
1.7.1 Histograms
To summarize, histograms are ad hoc depictions of the frequency or number of occurrences
of data points within specified intervals of the data understudy. Using R and the built-in
data frame titled airquality, two histograms are readily generated in example 15 . The
airquality data frame is loaded by the data() function as shown in the following example (see ?data.frame). The ls() function lists the contents of the current workspace.
The names() function has no core use in the example, but is shown to illustrate a feature of R for querying the named contents of a data frame (and other data structures).
18
First, the layout() function is used to specify the plotting layout, which is defined by
the matrix() function, of future graphic calls. In the example, two vertically stacked
plots are setup by the layout() function. Subsequent calls to the hist() function actually produce the corresponding histograms that are shown in figure 1.1. There are many
options available to the user of the hist() function but are not explored here.
15
J
Although easy to use and common in graphical display of distributions in popular
culture, histograms are easily and unfortunately distorted by the size of the bins (intervals
on the horizontal axis), and in the authors opinion, histograms generally are of limited
usefulness for quantitative distributional analysis. Somewhat more sophisticated graphics
and tools are described in later examples. Histograms however do represent real features
of the data. The histograms of the previous example show that the ozone data have positive
skewness or in other words, skewed to the right (long right tail), and the air temperature
data are more symmetrical with a mean value in the upper 70s.
30
0 10
Frequency
Histogram of airquality$Ozone
50
100
150
airquality$Ozone
25
10
0
Frequency
Histogram of airquality$Temp
60
70
80
90
100
airquality$Temp
Figure 1.1. Histograms of ozone and temperature for data in the airquality data frame from example 15
16
data(airquality); attach(airquality)
#pdf("boxplot.pdf")
boxplot(Ozone/mean(Ozone,
na.rm=TRUE),
Solar.R/mean(Solar.R, na.rm=TRUE),
Temp/mean(Temp), Wind/mean(Wind),
names=c("Ozone", "Solar Rad", "Temp", "Wind"),
ylab="VALUE DIVIDED BY MEAN", range=0)
#dev.off()
This example differs from example 15 in that the method to access the data of the
airquality data frame is distinctly different. This example attach()es the names into the
workspace so that ozone data are accessible as a simple name Ozone instead of the longer
syntax airquality$Ozone, which was shown in the previous example. (The function
detach() detaches the named contents of a data frame from the current workspace.)
For the ensemble of four box plots in figure 1.2, dimension in the data is removed
through division by the respective mean values. The na.rm=TRUE is needed for ozone and
20
3
2
1
0
Ozone
Solar Rad
Temp
Wind
Figure 1.2. Box plots of ozone, solar radiation, temperature, and wind speed data for data in the
airquality data frame from example 16
solar radiation data because missing values are present in each. The range=0 argument
causes the whiskers of the boxes to extend to the minimum and maximum of the data.
The bottom and top of the boxes represent the 25th and 75th percentiles, respectively. The
heights of the boxes, therefore, represent the interquartile range IQR. The thick horizontal
line represents the median or 50th percentile. In general, box plots provide compact and
unique visualization of the distribution for a given style of plotting parameters in contrast
somewhat to histograms.
Several interpretations of the box plots can be made. For the box plots, ozone has the
largest relative variation and appears positively (right) skewed towards large values. Temperature has the smallest relative variation and is nearly symmetricalperhaps the symmetry is caused in part by the diurnal (daily) heating and subsequent cooling of the land
surface.
Because box plots provide a more succinct graphical depiction of the distribution of
the data relative to histograms, box plots are highly recommended and are preferable to
histograms. Conventional box plots, such as those in figure 1.2, are preferable because:
21
1. Arbitrary bins are not usedthe visual impact is affected by the width of the bins,
2. The plots locate the distribution on the real number line (like a histogram),
3. The plots quantitatively depict the statistics such as the median, mean, and quartiles,
4. The plots often depict the relative lengths of the left and right tails of the distribution
with greater visual precision than histograms,
5. The plots can specifically depict minimum and maximum of the sample, and
6. The plots can be configured to represent individual outliers (a feature not used in
figure 1.2).
The utility of graphical depiction of distributionsboth parent or theoretical and
samplecannot be stressed enough. The R environment provides powerful graphical
features and visualization of data to aid in interpretation of phenomena under study.
Many plot styles of distributions are illustrated in the figures of this dissertation.
22
Chapter 2
Distributional Analysis
random process is the sample distribution of air temperature depicted in the box plot in
figure 1.2 of the previous chapter. The hour-to-hour, day-to-day changes in air temperature
would not be expected to originate from a purely random process. For these data, the
air temperature data likely have considerable serial correlation in time. The box plot,
however, still provides quantitative information about the distribution of air temperature
during the monitored time period.
Particular phenomena, such as earthquake magnitude, reside in a strictly positive
domain. This fact does not pose an especially complex situation for distributional modeling, but unique problems to such bounded data do arise. For now, it is sufficient to
understand that awareness of the physical meaning of data can be useful as part of distributional analysis. Some distributions described herein are bounded and can be specified
to honor specific numerical bounds such as the Generalized Pareto. Whereas boundedness might seem an appropriate piece of information to bring to problems within the
context of distributional analysis, the specific nature of the analysis might advise against
the practice of honoring theoretical or physical bounds.
Other phenomena can acquire exactly zero values, such as streamflow for a generally
dry wash in the American southwest. Sometimes, special accommodation is needed for
zero magnitude values using conditional probability techniques.
Three types of expressions for the distribution of a random variable are common. These
are the probability density function, cumulative distribution function, and quantile function (Ross, 1994; Evans and others, 2000; Gilchrist, 2000). These functions are described
in sections that follow. A comprehensive summary of built-in R support for probability
distributions is found in Venables and others (2008, chap. 8).
f (x)) is defined by
f (x) dx = Pr[x X x + dx]
24
(2.1)
Other than depicting qualitative information about the structure of the probability
density, PDFs sometimes have more restricted usefulness compared to the two other types
of functions described in sections that follow. The usefulness is restricted because the
numerical values of cumulative probability or nonexceedance probability are not available
(only probability density is), and in practice numerical values of probability often are
needed.
Using R
Using R
An example PDF for illustration is shown in figure 2.1 for a Weibull distribution with
a specified shape parameter. The Weibull PDF in the figure was created by example 21 .
21
#pdf("pdf1.pdf")
x <- seq(0,3, by=0.01)
f <- dweibull(x, shape=1.5) # prepended "d" to "weibull" dist.
plot(x,f, type="l")
#dev.off()
built-in to R.
F (x) = Pr[X x]
(2.2)
x. The CDF is a nondecreasing function that defines the relation between F and x. The
25
0.0
0.2
0.4
0.6
0.0
0.5
1.0
1.5
2.0
2.5
3.0
Figure 2.1. Probability density function for a Weibull distribution from example 21
derivative of the CDF or f (x) = dF/dx is the probability density so the CDF in terms of
the PDF is the integral
Z
F (x) =
f (t) dt
(2.3)
CDFs are common in fields for which values for the random variable X are thought
of as independent, and thus graphical depictions of CDFs often have x on the horizontal axis and F on the vertical axis. Practioners frequently enter problems from the
perspective that measurement of a phenomena has been made and a mapping to the
cumulative probability or percentile is needed. For example, a baby boy weighs 20 lbs
(9 kg) at four months, is this a large or small baby? The CDF of the weights of baby boys
with ages of approximately four months would hold the answer. Partly for convenience,
therefore, CDFs are common in some disciplinesmeaning in graphical contexts that x
conventionally is depicted on the horizontal axis and F is on the vertical axis.
Also, in some disciplines the CDF is replaced by a function known as the survival function (other names are: complementary CDF, reliability function, and survivor function)
26
(2.4)
where S denotes exceedance probability. The relation between the F (x) and S(x) is
straightforward: S(x) = 1 F (x). In this dissertation, however, S(x) do not have a
central role and purposeful preference to F (x) usually is made.
Using R
Using R
An example CDF for illustration is shown in figure 2.2 for standard Normal distribution,
which is a Normal distribution that has a mean of zero and a standard deviation of 1. The
figure was created by example 22 . The pnorm() function is the CDF of the Normal
distribution, which defaults to the standard Normal if no other arguments are provided.
22
#pdf("cdf1.pdf")
x <- seq(-3,3, by=0.01)
F <- pnorm(x)
plot(x,F, type="l")
#dev.off()
J
A followup to example 22 is 23 that shows how the mean and standard deviation
are set with the pnorm() function using the named arguments mean and sd. The mean
is set to 600 and the standard deviation is set to 400. The F value for x = 300 is about
Readers are asked to note in examples 22 and 23 the use of the p (probability or
percentile) in the name of the pnorm() function to call the respective CDF. The letter p
is prepended to the name or an abbreviation of the distribution for at least the distributions
built-in to R.
27
0.0
0.2
0.4
0.6
0.8
1.0
Figure 2.2. Cumulative distribution function for standard Normal distribution from example 22
2.1.3 Hazard Functions
A special function related to distributions is the hazard function, which is potentially
less commonly referred to as the failure rate function. Hazard functions are particularly
useful in distributional analysis involving life time data, such as the distribution of the
life span of a person or a part. The hazard function h(x) can be expressed in terms of the
PDF and CDF for random variable X (usually time). The function is defined by
h(x) =
f (x)
1 F (x)
(2.5)
where f (x) is a PDF and F (x) is the CDF. It is important to stress that h(x) is not an
expression of probability.
To help with intuitive understanding of what h(x) means (Ugarte and others, 2008,
p. 143), let dx represent a small unit of measurement. The quantity h(x)dx then can be
conceptualized as the approximate probability that random variable X takes on a value
in the interval [x, x+dx] or the approximate probability Pr[ ]
28
h(x)dx =
f (x)dx
Pr[X (x, x+dx) | X > x]
1 F (x)
(2.6)
Ugarte and others (2008, p. 144) continue by stating that h(x) represents the instantaneous rate of death or failure at time x, given that survival to time x has occurred (| X > x).
Emphasis is repeated that h(x) is a rate of probability change and not a probability itself.
Using R
Using R
The lmomco package provides the hlmomco() function, which computes eq. (2.5) using
the dlmomco() (PDF) and plmomco() (CDF) functions. Mimicking the example by
Ugarte and others (2008, p. 144), the failure rate for an Exponential distribution is a constant as example 24 shows. A vector of repeated failure rates equal to 0.01 is shown and
when inverted by 1/0.01, the scale parameter of 100 in my.lambda is recovered.
24
(2.7)
where xF could be referred to as the F -quantile of the distribution. The notation x(F ) or
Q(F ) typically will be used to refer a QDF as a whole. Generally, the xF notation refers to
specific quantiles such as x(0.50) or x0.50 . This quantile is the median or 50th percentile.
The CDF and QDF are inverses of each other, and in fact within some disciplines, the term
29
inverse distribution function is the term used when referring to the QDF. This term is
not used herein. Notationally the following holds
(2.8)
for a nonexceedance probability g , the CDF F (x), and the QDF x(F ). The superscripted
(1)
notation of a QDF (inverse of the CDF) is seen in some publications and only rarely
used here.
QDFs are common in fields, such as hydrology, for which values for the random variable X are unknown, but concepts such as risk are thought of as independent. Thus,
graphical depictions of QDFs often have F on the horizontal axis and x on the vertical
axis. Practioners frequently enter their problems from the perspective that a cumulative
percentile or nonexceedance probability is a known quantity. For example, suppose that a
government requires levees to be built for the 99.9th-percentile storm. The QDF of storms
for the geographic region under consideration would hold the answer.
In terms of the exploration of distributional properties and broader distributional analysis, working with QDFs generally provides for easier programming because values of F
are defined on a precisely constrained interval as 0 F 1, whereas the range of x is
distribution specific and exists in arbitrary portions of (or even the entire, < x < )
real-number line R. Emphasis is made, however, that the functionality of R makes working with either PDF, CDF, and QDF operations not particularly burdensome. The analyst,
when using R, has freedom to choose the syntax that is most natural for the problem at
hand.
) can be defined as
The sample quantile function X(F
) = xbnF c:n
X(F
(2.9)
where F is nonexceedance probability, bac is the floor function and xi:n is the ith sample
order statistic (see Chapter 3). The floor function is implemented in R by the floor()
function.
Using R
Using R
An example QDF for illustration is shown in figure 2.3 for a scaled (2*qexp) and shifted
(+10 ) distribution that is Exponential (note the use of q for quantile, qexp()). The
letter q is prepended to the name or an abbreviation of the distribution for at least
30
the distributions built-in to R. The figure is created in example 25 in which the seq()
function is used to generate a sequence of F values on a dF = 0.01 interval.
25
10
12
14
16
18
#pdf("qdf1.pdf")
F <- seq(0.01,0.99, by=0.01) # nonexceedance probability
x <- 2*qexp(F) + 10 # exponential distribution quantiles
plot(F,x, type="l")
#dev.off()
0.0
0.2
0.4
0.6
0.8
1.0
31
[1] 15.55525
g.B <- pgamma(x,4, scale=3) # invert the quantile function
print(g.B) # the result, which is a nonexceedance prob.
[1] 0.76
J
To complete this section concerning QDFs, consider again the definition of probability
density
f (x) =
F (xn+1 ) F (xn )
dF
=
|xn+1 xn |0
xn+1 xn
dx
lim
(2.10)
or in other words, the change in probability per unit change in x. This differencing equation will be used in example 27 , and the utility of using R for statistical computing is
further shown.
Equation (2.10) provides a recurrence relation to solve for the QDF, which is a useful
construct when the QDF does not have an analytical solution. The recurrence relation is
xn+1 = xn +
F (xn+1 ) F (xn )
f (xn )
(2.11)
where the quantile for a nonexceedance probability F can be computed using the CDF
F (x) and PDF f (x), and this is done in example 27 for F = 0.2 for a Pearson Type III
distribution (see page 243).
27
32
[1] 240.6772
# QDF of PE3 distribution, uses qnorm() function
qlmomco(0.2, para)
[1] 240.6772
In the example, the vec2par() function sets the first three product moments of the
Pearson Type III as = 1000, = 900, and = 1.2, respectively. A first guess of
the solution is made, the guess is 1,000, which is the mean. The output shows that
PE3(F =0.2, 1000, 900, 1.2) = 240.7 from both functions, although the internal algorithms differ. The ... is a separate argument and represents additional and arbitrary
arguments that are to be passed to other functions, which in this case are called inside
the qua.by.recursion() function. The internally called functions are plmomco() and
dlmomco().
Q(F ) = Q1 (F ) + Q2 (F ).
The author argues that modularity that enhances development of reusable code units has a
higher level of importance for maintaining code, but further discussion is beyond the scope here.
33
The Addition Rule is easily demonstrated. The Q(F ) for the addition of an Exponential
and a Normal distribution is produced by example 28 .
28
F
Q1
Q2
Q
<<<<-
The cbind() function binds a list of vectors into columns and the round() function
rounds each element of a vector to one digit to the right of the decimal in the example.
The example shows the x(F ) values as a matrix. The 50th percentile or median of Q(F )
or Q(0.50) can be written as Q0.50 = 30.8.
The Multiplication Rule for strictly positive variables
If each is strictly positive, the distributions Q1 (F ) and Q2 (F ) can
be multiplied: Q(F ) = Q1 (F ) Q2 (F ).
The Multiplication Rule also is readily demonstrated and is shown in example 29 .
The product Q(F ) of the same two distributions (Q1 and Q2 ) from example 28 is
29
where the third row is the product Q(F ). The rbind() function is used and binds a list
of vectors into rows. To clarify the effects of cbind() and rbind(), readers are asked to
compare the orientation of the matrices in examples 28 and 29 .
34
F
w
Q1
Q2
Q
<<<<<-
seq(0.001,0.999, by=0.001)
0.35 # weighting
qweibull(F, shape=3, scale=100) # Weibull dist. quantiles
25*qexp(F) # exponential distribution quantiles
w*Q1 + (1-w)*Q2 # Intermediate Rule
In the example, a high-resolution sequence of F values is first produced, and the weight
w is set to 0.35. Second, Q1 and Q2 are created as numerical curves of the two quite different
35
100
Q1
Q2
Q
50
QUANTILE
150
0.0
0.2
0.4
0.6
0.8
1.0
NONEXCEEDANCE PROBABILITY
Figure 2.4. Blending two quantile functions to form a third by the Intermediate Rule from example 210
36
0
600
400
200
200
400
600
0.0
0.2
0.4
0.6
0.8
1.0
Figure 2.5. Reflection (bottom) of an Exponential distribution (top) about x = 0 and F = 0.5
using the Reflection Rule from example 211
37
H 0 (F ) H 0 (0)
H(F ) = 0
H (1) H 0 (0)
or
H(F ) =
F 2 + 2F
F 2 + 2F + 1 1
=
41
3
Some functions for generalized application of the F-transformation Rule are now created. Example 213 is used to define a transformation function HF() that is structurally
similar to H(F ) just described.
213
Next in example 214 , a function is created titled Ftrans() for actual implementation
of the F-transformation Rule. The function receives a vector of F values and the transformation function as a named argument (transfunc=NULL). The Ftrans() function uses
the check.fs() function to verify that the F values are 0 F 1 and return FALSE
if they are not. A test is made on the argument transfunc by the is.null() function
and return FALSE if the argument is not provided. The standardization of the transform
function is set into the variable nf. Finally, a check whether any() of the nf values are less
than 0 or greater than 1 is made as a precaution against a poorly specified transformation
function.
38
The demonstration of the F-transformation function Ftrans() is provided in example 215 , and the results are graphically depicted in figure 2.6.
215
F values are transformed beforehand by the Ftrans() function. Both distributions are
plotted in figure 2.7.
216
#pdf("FtransD.pdf")
PARgpa <- vec2par(c(-400,100,-0.2), type="gpa")
plot(F,qlmomco(F,PARgpa), type="l")
nf <- Ftrans(F,trans=HF)
lines(F,qlmomco(nf,PARgpa), lty=2)
#dev.off()
39
0.6
0.4
0.0
0.2
0.8
1.0
0.0
0.2
0.4
0.6
0.8
1.0
Median
142.70
40
Max.
433.70
400
200
0
400
200
qlmomco(F, PARgpa)
600
800
0.0
0.2
0.4
0.6
0.8
1.0
Figure 2.7. Comparison of original Generalized Pareto distribution (solid line) and F-transformed
Generalized Pareto distribution (dashed line) from example 216
summary(Q2)
Min. 1st Qu.
789.7 1077.0
Median
2280.0
drawn and set into RF. Conversion of RF to QF is made, and the mean and standard
deviation statistics are computed and shown.
41
T = 1/(1 F )
(2.12)
F = 1 1/T
(2.13)
The discussion of recurrence interval explicitly is made because many examples here
involve annually sampled data. These data are derived on an annual basis, that is, data
that are measured on annual intervals. Such data might represent the coldest daily temperature for each year or represent the number of frost-free days per year. A T -year recurrence interval is valid as an expression of probability for such dataalthough confusion
42
T -year event will occur in an interval of T years. Further, large T -year events, such as
the 100-year event, often are misunderstood as some sort of physical upper limitthe
phenomena cannot be greater than the 100-year event. Unfortunately, the F = 0.99 event
is seldom near or otherwise should be interpreted as representing an approximate upper
bounds for many natural phenomena such as flood magnitude.
There are two correct interpretations (Stedinger and others, 1993, p. 18.3) of recurrence interval if events are independent from year to year. First, the expected number
of exceedances of xT (the T -year event) in a fixed T -year period is equal to 1 or alternatively an event greater than the xT event will occur once every T years. Second, the
distribution of success or failures of exceedance above the xT threshold is Geometric with
mean = 1/(1 F ). The CDF of the Geometric distribution is
(2.14)
Thus, another interpretation of recurrence interval is that the interval is the average time
until xT is exceeded.
Using R
Using R
of annual data is the 4-year recurrence interval and visa versa. The "\n" value (newline
character) is a universal symbol used to create a newline in many programming languages
including R.
219
J
43
The Geometric distribution is a built-in distribution of R. For example, the CDF of the
Geometric is provided by the pgeom() function. Example 220 shows that the probability
of experiencing or witnessing at least one 100-year event (F = 0.99 and S = 1 0.99 =
0.01) in 100 years (an exceptionally long life time) is about 63.8 percent according to the
assumptions leading to use of the Geometric distribution and not 100 percent as, by the
authors professional experience, the general populace often appears to assume.
220
x0.25 and x0.75 , respectively; and the minimum xmin and maximum and xmax , respectively.
Another basic summary statistic is the standard deviation . Each of these statistics are
readily computed using R by the summary() and sd() functions.
44
The summary statistics in the example show that 25 percent of the data are less than
about 0.64, whereas about 50 percent of the data are less than about 0.05, and 75
percent are less than about 0.52. The minimum and maximum are self explanatory, but
each can be separately computed by the min() and max() functions, which are shown
in the example. The and statistics are said to be measures of location (place on the
real-number line) and scale (alternatively, dispersion, or spread) of the data. The x0.50
(median), like the , also is a measure of location.
Several concepts require further discussion. The use of statistical simulation, which
is shown repeatedly herein, is a powerful technique for exploration of the properties of
various sample statistics. For the example, simulation is used to generate data for the
previous example. In simulation, n pseudo-random numbers of F :0 F 1 are mapped
through the QDF of the chosen distribution or its numerical equivalent should the QDF
of the distribution have no explicit form.
For example, instead of using the rnorm() function to generate random values from
the standard Normal distribution, the same statistical result for n = 100 also could be produced by example 222 . In the example, the qnorm() computes the x(F ) or quantiles of
the standard Normal. The runif() function, by default, provides uniformly-distributed,
pseudo-random numbers between 0 and 1.
222
Because simulation is used, examples 221 or 222 , if rerun, will produce different
numerical values for the outputted results. Thus, the basic summary statistics are to be
understood as estimators for which the numerical values are dependent on values from a
finite sample. The standard Normal distribution by definition has = 0 and = 1 (the
population values). However, the sample estimates are
= 0.108 and
= 0.918. The
45
sample statistics are not equal to the population statistics (or values), but in this case
they clearly are close. It is desirable for a given statistic that as n that the sample
statistic approaches or becomes equal to the population value. Unfortunately, in the real
world, analysts must contend or be content (often forced) with sample sizes less than ideal
or desired. The performance of a statistic as a function of sample size is a common theme
in this dissertation.
An important property of any sample statistic is that over repeated samplings for reasonable values of n (reasonably meaningsample sizes seen in real-world circumstances)
that the statistic on average attains the population value and that variability of the statistic (sampling variance) is not too large. These and other sampling properties of statistics,
primarily product moment and L-moment statistics, will be demonstrated through short
simulation examples throughout this dissertation. Formal definitions of some of the more
informative sample properties of sampling bias and sampling variability are deferred to
Section 4.1.1.
From the perspective of the programming needs for large applications, the access of the
summary statistics (and similar data structures in R) is important. These can be accessed
by collecting the summary statistics into a variable. Although the function IQR() that is
built-in to R computes the interquartile range, for purposes of illustration, example 223
computes the interquartile range of a standard Normal distribution using eq. (2.15) by
expression of the difference between the upper and lower quartiles from the results of the
summary() function.
(2.15)
223
The printed value of IQR is improperly labeled, through inheritance, with an attribute
3rd Qu.see the documentation for the attributes() and names() functions. The
attribute of the variable IQR is changed by the names() function, which changes the name
46
of the first item of the variable IQR to "IQR". This is demonstrated in example 224 . The
attributes() function can be used to remove the label as shown.
224
This use of labels for variables through the attributes() function is a powerful
method for enhancing the maintainability of software or enhancing the comprehension
of end users. Such attributes provide a means for self documentation of code when used
effectively.
The range is the difference between the maximum and minimum of a distribution and
is defined as
W = Xn:n X1:n
(2.16)
Using the fake.dat generated in example 223 , the range is computed in example 225
where the W is understandably larger than the IQR.
225
W <- diff(range(fake.dat))
print(W)
[1] 4.855895
(Rizzo, 2008, p. 38). The method of moments term typically is reserved for the context
of fitting a distribution by the product moments. However, distributions can be fit using
other method-of-moment-like algorithms. Mays (2005, chap. 10) reports By fitting a distribution to a set of data, a great deal of the probabilistic information in the sample can
be compactly summarized in the function and its associated parameters.
Some of the reasons that probability distributions are fit to samples include:
1. A continuous and portable model of the distribution of the data is needed so that either
F values can be converted to F x using the CDF or x F using the QDF. For
example, a manager or regulator of water quality for a river needs an estimate of the
streamflow at the 10th percentile (a drought) because water quality can be of concern
during periods lacking abundant rainfall;
2. A parametric model is needed for extrapolation to quantiles not represented by the
data. For example, the estimation of the 99.9th percentile from a small sample n = 20
is needed. This extrapolation is of critical interest in the design and management
of infrastructure, such as dams or earthquake hazards, in which design against the
deleterious effects of large events is paramount; and
3. A simulation model is needed to drive further investigation. For example, studies of
sample variability or studies involving the consequences of the failure of a part in a
larger system are to be made.
The method of moments using the Normal distribution is now demonstrated. Recalling
from elementary statistics courses, the PDF of the Normal is
f (x) =
2
(2.17)
where and are parameters and also the first two product moments (mean and standard
deviation) of the distribution. Because the product moments are parameters and visa versa,
the steps for fitting the Normal distribution are straightforward. To state succinctly, to use
the method of moments, first, the sample
and
are computed, and second, these sample
values are substituted into eq. (2.17) as values for and , respectively. The method of
moments is thus applied.
From the authors experience, as a periodic educator of both graduate and undergraduate geoscientists and civil or environmental engineers, many of these students have only
one or two statistics courses. These students might recognize the symbols and , their
48
respective meanings, and be familiar with the meaning of each. However, often these
students do not recognize that and in the case of the Normal distribution also represent model parameters and not just abstract statistics. When and are presented or
cast as model parametersa concept familiar to the students from the language of other
coursesthen greater insight into the Normal distribution and distributions in general is
acquired by course participants.
Using R
Using R
The method of moments for the Normal distribution is readily shown in example 226
through simulation of a sample of size n = 20 from a Normal distribution with parameters
set to = 500 and = 200. The population statistics are set into variables pop.mu and
pop.sd. The rnorm() function returns 20 sample (random) NOR(500, 200) values into
#pdf("pdf2.pdf")
pop.mu <- 500; pop.sig <- 200; n <- 20
fake.dat <- rnorm(n, mean=pop.mu, sd=pop.sig)
x.bar <- mean(fake.dat); x.sig <- sd(fake.dat)
F <- seq(0.01,0.99, by=0.01)
x <- qnorm(F, mean=pop.mu, sd=pop.sig)
pop.PDF <- dnorm(x, mean=pop.mu, sd=pop.sig) # PDF of population
sam.PDF <- dnorm(x, mean=x.bar, sd=x.sig)
# PDF of sample
myup <- max(pop.PDF, sam.PDF) # need a global max for plotting
plot(x,pop.PDF, type="l", ylim=c(0, myup),
ylab="PROBABILITY DENSITY") # thin line
lines(x,sam.PDF, lwd=3) # thick line
#dev.off()
The results of the example are shown in figure 2.8. In the figure, it is seen that the
location and scale of the parent distribution and the sample are similar, but the two curves
obviously do not have a one-to-one correspondance. The lack of correspondence exists
because the sample
and
values (x.bar and x.sig) are (expectedly) not numerically
equal to the parent and values. Therefore, the sample PDF (thick line) represents
a fit to the parent PDF (thin line). The differences in this case are substantial because
of the relatively small sample size of n = 20. If the sample size were increased to say
49
2,000, then the resulting thick line will likely mask or hide the thin line of the parent
distribution. Because a parametric distribution is used and the distribution is Normal,
it must be stressed, that in both cases, the general shapes (curvatures) of the two fitted
0.0015
0.0010
0.0005
0.0000
PROBABILITY DENSITY
0.0020
200
400
600
800
1000
Figure 2.8. Comparison of a parent Normal distribution (thin line) and sample Normal distribution
(thick line) for a sample of size 20 from example 226
50
butions. The second application (visualization) is common in many of the examples and
resulting figures in this dissertation.
To construct an empirical distribution, plotting positions, which are well described by
Helsel and Hirsch (1992, p. 23) and Stedinger and others (1993, chap. 18, pp. 2226), are
used to define the F or cumulative percentages of individual data points within a sample.
Plotting positions can provide complementary components for alternative graphics to
box plots. Plotting positions also can be used to construct probability graph paper or be
used to compare two or more distributions. Plotting positions often are used for graphical
display, and this is their primary use within this dissertation. The general formula for
computing plotting positions or plotting-position formula is
F (x) =
ia
n + 1 2a
(2.18)
a = 0 or Weibull plotting positions will see near universal use in this dissertation. For
general quantile estimation, the Cunnane plotting positions are recommended (Cunnane,
1989; Helsel and Hirsch, 1992, 2002).
There exists use of i/n as a plotting position estimator, which is called the California
plotting position. This form is not recommended and not further considered here.
51
a
0.
.3175
.35
.375
.40
.44
.50
Motivation
Unbiased exceedance probabilities for all distributions
Median exceedance probabilities for all distributions
Useful with probability-weighted moments
Nearly unbiased quantiles for Normal distribution
Approximately quantile unbiased
Optimized for Gumbel distribution
A traditional choice
Using R
Using R
(2.19)
F (k) =
kA
nAB+1
(2.20)
F (1 A B), and = g .
52
Two example applications of the quantile() function are shown in example 227 in
which 999 standard Normal random samples are drawn by the rnorm() function.
227
x <- rnorm(999)
quantile(x) # Extremes and quartiles by default
0%
25%
50%
75%
-4.75557859 -0.62393911 0.09476024 0.73220817
100%
3.24781578
quantile(x, probs=c(0.1,5,10,50,NA)/100)
0.1%
5%
10%
50%
-3.40851783 -1.58113414 -1.26403948 0.09476024
NA
J
The lmomco package provides specific support for computation of plotting positions by
the pp() function. Uses of the pp() function as well as the Weibull, Cunnane, and Hazen
plotting positions are now demonstrated.
In example 228 , some porosity (fraction of void space) data from an oil well in Texas
are available in the file clearforkporosity.csv, which is located along the lmomco
path lmomco/data/clearforkporosity.csv. The data from this file can be loaded
by the read.csv() function or, for purposes of this dissertation, by the data() function because the data is distributed with lmomco and resides in the data subdirectory
(R Development Core Team, 2009). In the example, the data are loaded, the respective
plotting positions computed, and set into PPw, PPc, and PPh.
228
data(clearforkporosity)
The pp() function demonstration continues in example 229 by plotting the data,
and the effects of the choice of plotting-position formula on the tails of the empirical
distribution are seen in the resulting figure 228.
53
#pdf("clearforkPP.pdf")
plot(qnorm(PPw),PHI, cex=3, pch=16, col=8, xlim=c(-2.5,2.5),
xlab="STANDARD NORMAL DEVIATE",
ylab="POROSITY")
points(qnorm(PPc),PHI, cex=2)
points(qnorm(PPh),PHI, cex=0.5, pch=16)
#dev.off()
0.15
0.10
POROSITY
0.05
Figure 2.9. Empirical distribution by plotting position of porosity (fraction of void space) from
neutron-density, well log for 5,3505,400 feet below land surface for Permian Age Clear Fork
formation, Ector County, Texas from example 229. The grey circles are Weibull positions, the
open circles are Cunnane positions, and the black dots are Hazen positions.
J
A comparison between the pp() and quantile() functions is made in example 230 .
For the example, the porosity data in variable PHI from example 228 are used.
230
54
In the example, the first three smallest values: 0.0449, 0.0480, and 0.0520 are printed.
Second, using appropriate rounding, the Hazen plotting-position formula is used through
the type=5 argument for the Hazen plotting positions in variable PPh from example 228
and extract the quantiles. Third, the Weibull plotting-position formula is used by setting
the type=6 argument to the quantile() function. For the Hazen and Weibull cases the
percentages change, but the two quantile ensembles are equivalent as shown by the first
Using R
Using R
The first demonstration is example 231 , which simulates n = 30 values from a twoparameter Weibull distribution using the built-in rweibull() function. The lmom.ub()
function computes a sample L-moments of the simulated data, and the parwei()
function computes the parameters for a three-parameter Weibull distribution from the
L-moments. The pp() function implements eq. (2.18) with a default to the Weibull plotting positions. (The pp() function is used in many examples as a precursor to graphical
operations.) The empirical distribution finally is plotted with F on the horizontal axis and
the sort()ed data on the vertical. The quantiles for the plotting-position values of F are
drawn as a line by the lines() function, which makes use of the quawei() function for
the QDF of the Weibull. The output from the example is shown in figure 2.10.
55
#pdf("pp1.pdf")
fake.dat <- rweibull(30,1.4, scale=400) # selected parameter vals
WEI <- parwei(lmom.ub(fake.dat)) # compute Weibull parameters
# from sample L-moments
PP <- pp(fake.dat) # plotting positions
plot(PP, sort(fake.dat), xlab="NONEXCEEDANCE PROBABILITY",
ylab="QUANTILE")
lines(PP,quawei(PP,WEI))
#dev.off()
1500
1000
500
QUANTILE
0.0
0.2
0.4
0.6
0.8
1.0
NONEXCEEDANCE PROBABILITY
Figure 2.10. Empirical distribution of simulated data from specified Weibull distribution and
Weibull distribution fit to L-moments of the simulated data from example 231
Instead of using simulated data to provide a second demonstration, the observed annual
peak streamflow data for a selected streamflow-gaging station operated by the U.S. Geological Survey are used. An annual peak streamflow is the largest instantaneous volumetric
rate of flow in a stream for a given year. Such data provide the backbone for statistical analyses that govern the management of flood plains and design of drainage infrastructure
such as bridges.
56
The selected streamflow-gaging station is 05405000 Baraboo River near Baraboo, Wisconsin. The annual peak streamflow data were acquired at http://nwis.waterdata.
usgs.gov/nwis/peak/?site_no=05405000&. This station has n = 73 years of
record between 19142006, and the data are available as a *.RData file provided in the
lmomco package. The data are titled lmomco/data/USGSsta05405000peaks.RData.
In example 232 , the Baraboo River data are loaded by the data() function and
attach()ed to the workspace for convenient access to the annual peak data. Readers
can find more details for the data.frame(), attach(), and detach() functions in
the R documentation: help(data.frame). The data of interest are in the column labeled
peak_va of the data frame. These data are sort()ed into the variable Q. The Weibull
plotting positions are computed using the pp() function. To demonstrate the fit of the
Normal distribution by the method of moments, the
and
sample statistics of the data
are set equal to the variables mu and sig, respectively. The data are strictly positive and
heavy tailed; therefore, the log-Normal distribution (a Normal distribution of logarithms
of the data) should also be considered. The
and
sample statistics of the log10(Q) values are set equal to the variables mu.lg and sig.lg, respectively. The values are shown
in the example.2
232
This example is treated in further detail in Chapter 8. The values in the example are repeated in
table 8.3 on page 233.
57
The example continues by plot()ting the empirical distribution of the data in which,
unlike example 231 , the horizontal axis is shown in standard normal deviates. Such an
axis is obtained by the qnorm() function. Data that are normally distributed will plot
as a straight line with a qnorm()-transformed horizontal axis and a linear vertical axis.
The qnorm() function, therefore, can be used to construct a normal probability axis
of standard normal deviates. Finally, the Normal distribution is plotted by the quantile
function qnorm() with =
and =
, which in code is qnorm(PP, mean=mu,
sd=sig) and represents the method of moments. The log-Normal distribution also is
plotted by suitable argument substitution and transformation. The results are shown in
figure 2.11. For completeness, example 233 computes basic summary statistics and
by
the summary() and sd() functions, respectively.
233
By elementary interpretation of the data points and the two fitted distributions in figure 2.11, the author concludes that these annual peak streamflow data are not normally
distributed. This conclusion is made because of the curvature of the data points relative to
the straight line of the Normal distribution. Visually, the log-Normal distribution provides
a much more reasonable model of the distribution of annual peak streamflow for these
data, but even this distribution appears to curve too much and away from the data in the
far tails.3
The basic distributional analysis of the Baraboo River annual peak streamflow is completed by creation of a box plot of the annual peak streamflows so that a juxtaposition
of the empirical distribution shown in figure 2.11 can be made. The code listed in example 234 suffices, and the box plot is shown in figure 2.12. The whiskers extend to the
most extreme data points, which for this particular box plot are no more than 1.5 times
the IQR (interquartile range in eq. (2.15)) from the box. (The IQR() function computes
the IQR.) The lone open circle represents the largest, maximum, or xn:n value, which is
an order statistic maxima.
3
These annual peak streamflows also are used in the context of L-moment statistics in Section 8.2.3
in search of a better fit.
58
STREAMFLOW, IN FT^3/S
Figure 2.11. Empirical distribution of annual peak streamflow for U.S. Geological Survey
streamflow-gaging station 05405000 Baraboo River near Baraboo, Wisconsin and Normal (solid
line) and log-Normal (dashed line) distributions fit by method of moments from example 232
234
#pdf("pp2boxplot.pdf")
boxplot(Q)
mtext("BARABOO RIVER", side=1)
#dev.off()
2.3 Summary
In this chapter, the concept of distributional analysis is expanded on relative to that provided in Chapter 1, and 34 examples are provided. This chapter reviewed continuous
random variables and the mathematics of probability density functions, cumulative distribution functions, hazard functions, and and quantile functions. The quantile function
discussion extends into the algebra of quantile functions, and examples of how this algebra can be used as a model building tool to create alternative distributions are provided.
59
BARABOO RIVER
Figure 2.12. Box plot of the distribution of annual peak streamflow for U.S. Geological Survey
streamflow-gaging station 05405000 Baraboo River near Baraboo, Wisconsin from example 234
60
Chapter 3
Order Statistics
3.1 Introduction
As mentioned in Section 1.3, a branch of statistics known as order statistics plays a prominent role in L-moment theory. The study of order statistics is the study of the statistics of
ordered (sorted) random variables and samples. This chapter presents a very brief introduction of order statistics to provide a foundation for later chapters. A comprehensive
exposition on order statistics is provided by David (1981), and an R-oriented approach is
described in various contexts by Baclawski (2008).
The random variable X for a sample of size n when sorted creates the order statistics
of X : X1:n X2:n Xn:n . The sample order statistics from a random sample are
created by sorting the sample into ascending order: x1:n x2:n xn:n . As will be
61
seen, the concept and use of order statistics take into account both the value (magnitude)
and the relative relation (order) to other observations. Barnett (2004, p. 23) reports that
. . . the effects of ordering can be impressive in terms of both what aspects of sample behavior can be usefully employed and the effectiveness and efficiency of
resulting inferences.
and that
. . . linear combinations of all ordered samples values can provide efficient estimators.
This dissertation will show that the L-moments, which are based on linear combinations
(recalling page 9) of order statistics, do in fact provide effective and efficient estimators of
distributional geometry.
In general, order statistics are already a part of the basic summary statistic repertoire
possessed by most individuals, including nonscientists and nonstatisticians. The minimum and maximum are examples of extreme value order statistics and are defined by
the following notation:
min{Xn } = X1:n
(3.1)
max{Xn } = Xn:n
(3.2)
X0.50 =
(X
[n/2]:n
X[(n+1)/2]:n
if n is odd
and thus clearly is defined in terms of one order statistic in the case of odd sample size or
a linear combination of two order statistics in the case of even sample sizes.
Other order statistics exist and several important interpretations towards the purpose
of this dissertation can be made. Concerning L-moments discussed in Chapter 6, Hosking
(1990, p. 109) and Hosking and Wallis (1997, p. 21) provide an intuitive justification for
L-moments and by association the probability-weighted moments (see Chapter 5). The
justification is founded on order statistics:
The order statistic X1:1 (a single observation) contains information about the location
of the distribution on the real-number line R;
62
For a sample of n = 2, the order statistics are X1:2 (smallest) and X2:2 (largest). For a
highly dispersed distribution, the expected difference between X2:2 X1:2 would be
large, whereas for a tightly dispersed distribution, the difference would be small. The
expected differences between order statistics of an n = 2 sample hence can be used to
express the variability or scale of a distribution; and
For a sample of n = 3, the order statistics are X1:3 (smallest), X2:3 (median), and X3:3
(largest). For a negatively skewed distribution, the difference X2:3 X1:3 would be
larger (more data to the left) than X3:3 X2:3 . The opposite (more data to the right)
would occur if a distribution were positively skewed.
These interpretations hint towards expression of distribution geometry by select use
of intra-sample differences. In fact, various intra-sample differences can be formulated to
express fundamental and interpretable measures of distribution geometry. Intra-sample
differences are an important link to L-moments, and the link justifies exposition of order
statistics in a stand-alone chapter. Kaigh and Driscoll (1987, p. 25) defined O-statistics
as smoothed generalizations of order statistics and provide hints (Kaigh and Driscoll,
1987, eq. 2.4, p. 26) towards L-moments by suggesting that linear combinations of the
order statistics in the previous list and others not listed provide for location, scale, and
scale-invariant skewness and kurtosis estimation.
n!
E[Xj:n ] =
(j 1)!(n j)!
x(F ) F j1 (1 F )nj dF
(3.4)
n!
n1
=n
(j 1)!(n j)!
j1
63
(3.5)
a
a!
=
b
(a b)! b!
for b a
(3.6)
and by convention 0! = 1; eq. (3.6) is an expression for the number of possible combinations of a items taken b at a time. Factorials u! are defined as
(3.7)
For both integer and non-integer u, the factorial can be computed using (u + 1) where
( ) is the complete gamma function defined in eq. (8.85) on page 244. In R, the gamma()
function is ( ) and the lgamma() function is the natural logarithm of ( ). The later is
the most often used version in general programming because ratios of factorials of large
(3.8)
The PDF of the Xj:n (j th order statistic of a sample of size n) for a random variable
having CDF F (x) and PDF f (x) is defined (David, 1981, p. 9) as
fj:n (x) =
(3.9)
where B(a, b) is the beta function or complete beta function. The beta function is defined
for a, b > 0 as
Z
B(a, b) =
a1
b1
(1 F )
Z
dF =
(a)(b)
xa1
dx =
a+b
(1 + x)
(a + b)
(3.10)
1
n
= (n + k) B(n k + 1, k + 1)
k
(3.11)
The CDF of Xj:n for a random variable having CDF F (x) and PDF f (x) is defined (David,
1981, p. 8) as
Fj:n (x) =
n
X
n
i=j
[F (x)]i [1 F (x)]ni
64
(3.12)
E[Xj:n ] =
xfj:n (x) dx
(3.13)
(3.14)
or
E[Xj:n ] =
Z
E[X1:1 ] =
(3.15)
Therefore, the familiar mean can be interpreted thus: The mean is the expected value of a
single observation if one and only one sample is drawn from the distribution.
Hosking (2006) reports from references cited therein that the expectations of extreme
order statistics characterize a distribution. In particular, if the expectation of a random
variable X is finite, then the set {E[X1:n :n=1, 2, ]} or {E[Xn:n :n=1, 2, ]} uniquely
determine the distribution. Hosking (2006) reasons that such sets of expectations contain
redundant information. Technically a subset of expectations therefore can be dropped, and
the smaller set is still sufficient to characterize the distribution. This feature of extreme
order statistics is further considered in Chapter 6 on page 122 in the context of distribution
characterization by L-moments.
Using R
Using R
Using eq. (3.4), the expected value of the 123rd-ordered (increasing) value of a sample
of size n = 300 is computed for an Exponential distribution in example 31 . The ratio
of factorial functions in eq. (3.4) is difficult to compute for large valuesjudicious use
of the fact that n! = (n + 1) and use of logarithms of the complete Gamma function
(a) suffices. The results of the integration using the Exponential QDF by the qexp()
function and stochastic computation using random variates of the Exponential by the
rexp() function for E[X123:300 ] are very similar.1
The first and second values (the third is from simulation) should seemingly be the same, but a
bug in logic has not been found. The following example that uses j=300 shows that the first and
second values are identical.
65
Finally, changing j=123 in example 31 to j=300 for the maximum order statistic, produces RESULTS: 6.283 and 6.283 and 6.297. These values are also
similar.
(3.16)
(3.17)
Durrans (1992) considers eq. (3.16) in more detail by exploring the possibility of fractional order of the exponent by suggesting the substitution of n (integer) for , which is
real-valued ( > 0). Durrans (1992, p. 1650) comments that an attractive feature of distributions of fractional order statistics is the thickening and thinning of the [distribution]
66
(3.18)
(3.19)
for the QDF of the maximum and minimum, respectively. Gilchrist (2000, p. 85) comments
that, at least for xn:n , that the quantile function of the largest observation is thus found
from the original quantile function in the simplest of calculations.
For the general computation of the distribution of non-extrema order statistics, the computations are more difficult. Gilchrist (2000, p. 86) shows that the QDF of the distribution
of the j th order statistic of a sample of size n is
(3.20)
where xj:n (F ) is to be read as the QDF of the j th order statistic for a sample of size n
given by nonexceedance probability F . The function B(1) (F, a, b) is the QDF of the Beta
distributionthe
(1)
f (x) =
x1 (1 x)1
B(, )
(3.21)
where and are parameters and B(, ) is the beta function of eq. (3.10). The first two
product moments (mean and variance) of the Beta distribution are
2 =
++1
=
(3.22)
(3.23)
It follows that the QDF for an F and sample size of n of the order statistic extrema are
67
(3.24)
Using R
Using R
In the context of eqs. (3.16) and (3.17), the expectations of extrema for the Exponential
distribution are stochastically computed in example 32 using the min() and max()
functions. The random variates from the Exponential are computed by the rexp() function. The example begins by setting the sample size n = 4, the size of a simulation run
in nsim, and finally, the scale parameter (note that R uses a rate expression for the dispersion parameter) of the Exponential distribution is set to 1,000. (A location parameter
of 0 is implied.) The example reports 1000, 1500, and 500 for the respective mean and
expectations of the maximum and minimum. (It is known, as shown in Section 7.2.2 in
eq. (7.17), that the mean of this Exponential distribution is 1,000.)
32
J
68
The two previous examples imply that eqs. (3.16) and (3.17) provide a more efficient
means of computing the distribution of extrema because sorting is computationally expensive. The system.time() function in example 34 measures the relative time to compute the expectation of a minimum value of a sample of size n = 4. The example shows
that use of eq. (3.17) is more than 35 times faster for the authors computer.
34
J
The distributions of individual order statistics in eq. (3.20) are easily demonstrated.
Example 35 defines the qua.ostat() function to compute the quantiles for a given
order statistic. The arguments f and para to the function are the Fj:n and lmomco parameter list (see page 163 and ex. 71 ), respectively. The parameter list is a data structure specific to the lmomco package. The other two arguments are self explanatory. The
qbeta() function is used to compute quantiles of the Beta distribution. Finally, the
par2qua() function dispatches the para parameter list to the appropriate distribution
with F = betainv.F.
35
"qua.ostat" <function(f,j,n,para) {
betainv.F <- qbeta(f,j,n-j+1) # compute nonexceedance prob.
return(par2qua(betainv.F,para))
}
# Now demonstrate usage of the qua.ostat() function
PARgpa <- vec2par(c(100,500,0.5), type="gpa") # make parameters
n <- 20; j <- 15; F <- 0.5 # sample size, rank, and nonexceedance
ostat <- qua.ostat(F,j,n,PARgpa)
print(ostat)
[1] 571.9805
After defining the qua.ostat() function by the function() function, the example
continues by specifying an lmomco parameter list for the Generalized Pareto distribution
into variable PARgpa using vec2par() through the type="gpa" argument. A sample
size of n = 20 is set, and the median of the distribution of the 15th-order statistic for such a
69
sample is computed. The example reports x15:20 (0.5) = 572 or the 50th percentile of the
15th value of a sample of size 20. The qua.ostat() function actually is incorporated
into the lmomco package. The function is shown here as an example of syntax brevity by
which eq. (3.20) can be implemented using the vectorized nature of the R language.
Tn =
n
X
ci:n h(Xi:n ) +
i=1
n
X
dj h? (X[npj +1]:n )
(3.25)
i=1
where Xi:n are the order statistics, c1:n , , cn:n and d1 , , dn are given coefficients or
weight factors, 0 < p1 < < pk < 1, and h(a) and h? (a) are given functions for
argument a. The coefficients ci:n for 1 i n are generated by a bounded weight
function J(a) with a domain [0, 1] with a range of the real-number line R by either
i/n
ci:n =
J(s) ds
(3.26)
(i1)/n
or approximately
ci:n =
J(i/[n + 1])
n
(3.27)
The quantity to the left of the + in eq. (3.25) uses all of the order statistics whereas
the quantity to the right of the + is a linear combination of a finite number of order
statistics (quantiles). L-estimators generally have the form of either quantity, but not both.
Estimators defined by the left quantity are known as type I and those of the right are
known as type II. L-estimators of type I are discussed by Huber (1981, p. 55) and Barnett
and Lewis (1995, p. 146).
The simplest example suggested by Jurekov and Picek (2006, p. 64) of an L-estimator
of distribution location are the sample median and the midrange, in which the later is
defined as
70
Tn =
X1:n + Xn:n
2
(3.28)
(3.29)
Sn,k =
n
2k + 1
1 X
n
i=1
i1 ni
Xi:n
k
k
(3.30)
where Xi:n are the order statistics and k is a weighting or trimming parameter. A sample
version Sn,k results when Xi:n are replaced by their sample counterparts xi:n . Readers are
asked to note that Sn,0 = = X n or the arithmetic mean, and Sn,k is the median if either
Using R
Using R
The lmomco package provides support for Sn,k through the sen.mean() function,
which is demonstrated in example 36 . In the example, some fake data are set into fake.
dat, and a Sen object sen is created. A list sen is returned by the sen.mean() function.
36
71
$source
[1] "sen.mean"
mean(fake.dat)
[1] 155
# PART 2, sample medians
sen <- sen.mean(fake.dat, k=(length(fake.dat)/2) - 1)
print(sen)
$sen
[1] 57.5
$source
[1] "sen.mean"
median(fake.dat)
[1] 57.5
The first part of the example shows that by default Sn,0 = , which is 155 for the example.
The second part shows that k can be chosen to yield the median, which is 57.5 for the
example.
Finally, Sn,k is equivalent to the first symmetrically trimmed TL-moment (that will
(k )
(k)
J
Foreshadowing Section 4.1.1, but here providing an informative example in the context
of the trimmed mean, in example 38 , the mean square errors (MSE) of the sen.mean(),
trim.mean() (Rizzo, 2008, p. 156), and median() estimators are computed and com-
pared the three errors to those reported by Rizzo (2008, pp. 156157). The example begins
by defining a trim.mean() function and using the same sample size n = 20 as used by
Rizzo. For this particular example, the set.seed() function is used to set a seed for the
72
random number generator in current use by R. By setting the seed, users for this example
should precisely reproduce the output shown.2
38
show numerical equivalency between the values reported by Rizzo. Further, the results
show that the equivalent algorithms for sen.mean() and trim.mean() have smaller
mean square errors than the familiar median. This is a natural consequence of the median
using far less numerical information contained in the sample than used by the trimmed
mean.
Note that the general practice in this dissertation is to be independent of specific seeds so users
should expect numerically different, but stochastically similar results for other examples herein.
73
to the second L-moment 2 . The Gini mean difference G (Serfling, 1980, p. 263) is a robust
estimator (Jurekov and Picek, 2006, p. 64) is defined as respective population G and
sample G statistics as
(3.31)
G =
X
2
(2i n 1) xi:n
n(n 1) i=1
(3.32)
where Xi:n are the order statistics, xi:n are the sample order statistics, and n 2. The
statistic G is a measure of the expected difference between two randomly drawn values
from a distribution. Hence, the statistic is a measure of distribution scale or spread (see
second justification in the list starting on page 63).
The Gini mean difference is considered by Barnett and Lewis (1995, p. 168). However,
David (1981, p. 192) considers G in more detail and reports that, although the statistic is
named after Gini (1912), G was already studied by Helmert in 1876 [(Helmert, 1876)3 ]
and not brand new then! (Exclamation point is Davids.) Hald (1998, p. 644) provides
historical discussion of Helmerts article.
Using R
Using R
The lmomco package provides support for G through the gini.mean.diff() function,
which is demonstrated in example 39 . In the example, a fake data set is set into fake.
dat, a Gini object is created, and assigned to variable gini. A list gini is returned. The
, see Chapter 6)
G statistic is listed in gini$gini, and the second sample L-moment (
2
is listed in gini$L2. Thus, G = 237.
39
J
3
Astronomische Nachrichten is the oldest astronomical journal of the world that is still being
published (http://www.aip.de/AN/).
74
J
After reporting, within discussion of order-based inference, that linear functions of
the ordered sample values can form not only useful estimators but even optimal ones,
Barnett (2004, p. 27) goes on to report that the quantity
n
1.7725 X
V =
(2i n 1)Xi:n = G
n(n 1) i=1
(3.33)
=V;
Eq. (3.33) is very similar to eq. (3.32): 1.7725 G/2
The Gini mean difference is related to the second L-moment 2 by G = 22 . Thus, 2
is related to V ;
The sample standard deviation is
=
2;
The value
75
Barnett (2004) asserts that the efficiency of V is about 98 percent for all sample
sizes. Assuming that relative efficiency4 RE is meant, R is used to test this claim. In example 311 , the variance of V and the familiar definition
2 by the var() function are
computed for a large sample size of n = 2,000 for a very large number of simulations.
311
n
<- 2000
# sample size
nsim <- 200000 # no. of simultions
"Barnett" <- function(n) {
gini <- gini.mean.diff(rnorm(n))$gini
return((sqrt(pi)*gini/2)^2)
}
GiniVar
<- var(replicate(nsim, Barnett(n)
))
ClassicVar <- var(replicate(nsim, var(rnorm(n))))
RE <- ClassicVar/GiniVar # relative efficiency
print(RE)
[1] 0.9738433
# Barnett (2004, p. 27) reports 98 percent.
The example estimates that RE 0.97, which is acceptably close to the about 98
percent value reported by Barnett. Therefore, the computed value in example 311 is
consistent with Barnetts value. Barnett also states that this RE holds for all sample sizes.
This conclusion is tested in example 312 for a sample size of n = 10.
312
n <- 10
GiniVar
<- var( replicate(nsim, Barnett(n)
))
ClassicVar <- var( replicate(nsim, var(rnorm(n)) ))
RE <- ClassicVar/GiniVar # relative efficiency
print(RE)
[1] 0.8752343
Example 312 estimates RE 0.88 for n = 10, which is clearly at odds with Barnetts statementRE is in fact substantially related to sample size. Another experiment
shows that RE 0.93 for n = 20. Finally, the performance (bias) of the Gini mean difference (equivalently, the second L-moment) compared to the sample standard deviation is
76
3.3 Summary
In this chapter, order statistics are formally introduced, and 12 examples are provided.
The order statistics are based on ordering or sorting the random variable or the sample
data. The order statistics are a fascinating class of statistics, which are relatively obscure to
nonstatisticians, yet ironically are within the natural experience of virtually all persons
for example the minimum and maximum and to a lesser degree the median. The primary
results shown in the chapter are the expression for the expectation of an order statistic, the
Sen weighted mean, and the Gini mean difference. The expectation of an order statistic has
great importance for the remainder of this dissertation. Foreshadowing, the L-moments
and TL-moments of Chapter 6, the theoretical and numerical connections between these
and both the Sen weighted mean and Gini mean difference are shown.
77
Chapter 4
Product Moments
In this chapter, I present generally salient background context for the remainder of the
dissertation. The chapter primarily focuses on the definitions and sample counterparts
of the product moments. Because the product moments are expected to be familiar to
many readers, this chapter serves as a relatively independent component of the larger
dissertation and establishes a basic structure for the parallelism of the two chapters on
probability-weighted moments and L-moments. The topic of sampling bias and sampling variance very likely is new material to readers lacking a statistical background,
but the topics are important to understand for the discussions that justify the authors
preference towards use of L-moment statistics. Additionally, the discussion of bias and
boundedness as a function of sample size of some product moments is particularly influential albeit not well known. Direct use of the results in this chapter is not expected for
purposes of distributional analysis with L-moment statistics using R.
4.1 Introduction
Data are distributed, and data are acquired through sampling (ideally substantial sampling) of a random variable. One of the challenges before the practitioner of distributional
analysis is the reduction of a sample of many numbers to geometric characterization of a
distribution by a few more salient numbers. This reduction can be made by computing
percentiles such as x0.10 , x0.25 , x0.50 , x0.75 , and x0.90 for the 10th, 25th, 50th, 75th, and
90th percentiles, respectively; by computing other distribution metrics such as the sample range; or by computing the statistical moments (a generic meaning of the term). The
moments of a distribution are particularly useful because specific mathematical opera-
78
tions are readily performed to compute moments on either distribution functions or their
samples.
Moments are statistics that quantify different components or geometric characteristics
of a distribution. For example, the arithmetic mean locates the distribution on the realnumber line R and therefore is an expression of central tendency, and the standard deviation describes the variability or spread along R. These are but two well-known examples of
a moment type known as the product moments. There are, however, many different ways
that moments can be defined and computed. As seen throughout this dissertation, there
also are probability-weighted moments, L-moments, trimmed L-moments, and other variations.
The product moments such as the mean, standard deviation, skew, and kurtosis are
familiar statisticsthe others listed at the end of the previous paragraph are less so. The
product moments are used in elementary examples in Chapter 2. In contrast, formal definitions and some experiments with their sampling properties are provided in this chapter.
Before product moments are introduced, a review of some statistical concepts and terminology is needed. The review provides background for some of the examples used in this
chapter and elsewhere in this dissertation.
as a random variable
estimated. Whichever is the case, consider the estimated statistic
are dependent on the sampled data.
with a true value that is denoted as . Values for
is defined as the difference between the expectation of the
The bias in the estimation of
estimate minus the true value or
= E[]
Bias[]
79
(4.1)
=
RMSE[]
q
)2 ]
E[(
(4.2)
=
RMSE[]
q
2 + E[(
E[])
2]
Bias[]
(4.3)
q
2 + Var()
Bias[]
(4.4)
or
=
RMSE[]
The square of the RMSE is known as the mean square error (MSE). Rizzo (2008, p. 155)
reports for MSE, but shown here as RMSE, that
v
u X
m
u
=t1
(j) )2
RMSE[]
(
m j=1
(4.5)
where (j) is the estimator for the j th sample of size n and m is the number of simulation
runs of samples of size n.
, Var[]
, and RMSE[]
are useful measures of statistical performance. They
Bias[]
are performance measures because the sampling bias and sampling variance describe the
accuracy and precision, respectively, of the given estimator.
or
Amongst an ensemble of estimators, the estimator with the smallest RMSE[]
is said to be the most statistically efficient. If an estimator is resistant to large
MSE[]
changes because of the presence of outliers or otherwise influential data values, then the
estimator is said to be robust. The relative efficiency of two estimators is
1,
2 ] = MSE[2 ]
RE[
1]
MSE[
and when two estimators are unbiased, then the relative efficiency can be defined as
80
(4.6)
1,
2 ] = Var[2 ]
RE[
1]
Var[
(4.7)
Using R
Using R
Sampling bias and sampling variance are used as metrics to evaluate and compare the
properties of product moments, L-moments, and other statistics. For the sake of brevity,
the R functions mean(), sd(), and occasionally summary() will be used to compute
.
compute eqs. (4.1) and (4.4) as well as Var[]
41
81
if(verbose) {
= ",round(b,
digits=digits),
cat(c("Bias (B)
"MSE(h,s)
= ",round(mse, digits=digits),
"RMSE(h,s)
= ",round(rmse,digits=digits),
"sqrt(Var(h))
= ",round(vh, digits=digits),
"sqrt(RMSE^2-B^2) = ",round(nv, digits=digits),
sep="")
}
return(list(bias=b, mse=mse, rmse=rmse, sd=vh))
"\n",
"\n",
"\n",
"\n",
"\n"),
n = 10 for a large simulation size nsim=100000. First, the Rmean list is generated to hold
the sampling statistics of the mean() function, and second, the Rmedn list is generated
to hold the sampling statistics of the median function. The reported biases are near zero
because the mean and median are both unbiased estimators.
42
A natural followup question concerning the mean and the median is asked. Which has
the smaller sampling variance? The end of example 42 reports that the RE[mean, median]
0.73, which is less than unity so the conclusion is that the arithmetic mean has a smaller
82
sampling variance than the median for at least the Normal distribution as used here.
Finally, a previous demonstration of MSE computation is made for a trimmed mean and
the median using sam.biasvar() in example 38 .
= E[X]
(4.8)
Z
E[X] =
x f (x) dx
(4.9)
Higher-order product moments are defined in terms of expectations of powers of differences from
Mr = E[(X )r ] for r 2
and in integral form
r
(4.10)
(x )r f (x) dx
E[(X ) ] =
(4.11)
The quantity M2 is known as the variance of the distribution, which is familiarly written
as 2 . An often useful measure is the standard deviation or
83
(4.12)
because has the same units as . The also is useful because the magnitude of the
number is more similar to the than is 2 and similar scientific notation can be used in
written communication when needed.
It is often convenient to remove dimension from the higher product moments for r 2
and form the product moment ratios. In particular, the common ratios are coefficient
of variation CV , skew G, and kurtosis K of a distribution and are defined as the three
dimensionless quantities
CV = / = coefficient of variation
G=
3/2
M3 /M2
= skew
K = M4 /M22 = kurtosis
(4.13)
(4.14)
(4.15)
It is typical for the term ratio to be dropped in reference to CV , G, and K , and refer
to these three statistics as product moments. This practice will generally be adhered to
here.
1X
=
xi
n i=1
(4.16)
1X
Mr =
(xi
)r for r 2
n i=1
(4.17)
It is important to emphasize that these two statistics are only estimates of the true underlying and generally unknown values and Mr .
The M r unfortunately are biased and in practice so-called unbiased estimators are used
instead. An unbiased estimator of the sample variance
2 is
84
1 X
(xi
)2
=
n 1 i=1
2
(4.18)
and note the division by n 1 instead of n as seen for the theoretical definition (M2 ). By
convention, the sample standard deviation is
(4.19)
=
and the sample coefficient of variation is CV
/
.
Although
2 is an unbiased estimator of variance,
v
u n
uX
[(n
1)/2]
t (xi
0 =
)2
(n/2) 2
i=1
(4.20)
where (a) is the complete gamma function that is shown in eq. (8.85) and is obtained by
the gamma() function.1 The
0 estimator of will be compared to
by example in this
chapter.
The sample variance can be written in an unusual way based on sample order statistics. As given by Jones (2004, p. 99) after Yatracos (1998), two expressions for the sample
variance are
2 =
n1
2 X
i(n i)(x{i,i+1} x{1,i} )(x[i+1:n] x[i:n] )
n2 i=1
(4.21)
2 =
n1
2 X
i(n i)(x{i+1,n} x{i,i+1} )(x[i+1:n] x[i:n] )
n2 i=1
(4.22)
where
2 is the sample variance, x[i:n] are the usual sample order statistics, and x{j,k} for
j k is the mean of x[j:n] , . . . , x[k:n] . Numerical experiments, which are not reported here,
1
Actually the computation of the gamma() function for large argumentssample sizes in
the case hereis problematic. The computationally preferred technique is to use logarithms:
exp(lgamma((n-1)/2) - lgamma(n/2)) (see eq. (3.8)). This technique is used in the
pmoms() function of lmomco.
85
indicate that the two expressions yield numerically equivalent values for
2 . A function2
implementing the first expression for
(standard deviation) is shown in example 43 .
Numerical experiments suggest that
is about 1 in the fifth significant figure less than
of eq. (4.19).
43
Continuing with the higher product moments, a nearly unbiased estimator of sample
is
skew G
n2
= M3
G
3
(n 1)(n 2)
(4.23)
is
A nearly unbiased estimator of sample kurtosis K
n2
= 1
K
4 (n 2)(n 3)
n+1
2
M 4 3M2 + 3
n1
(4.24)
The function (or method) is not an efficient means to compute the standard deviation.
86
Using R
Using R
fake.dat <- c(123, 546, 345.2, 12, 875, 321, 90, 800)
mu <- mean(fake.dat); sig <- sd(fake.dat); cv <- sig/mu
cat(c(round(mu, digits=2), round(sig, digits=2),
round(cv, digits=3), "\n"))
389.02 324.83 0.835
87
= 0.835.
CV
n) square deviation? Yes, it does. Speaking frankly, in the authors first college statistics
course as a student (an introductory undergraduate course in Mechanical Engineering),
the students were simply told something like you give up a degree of freedom because
the mean itself requires estimation, and no other discussion is recalled. Okbut what
does degree of freedom mean?
The author was unsatisfied with the paraphrased answer. Many years after that, during
the study (by necessity) of L-moments, the concept of sample statistics as estimators of
unknown population values was made manifest. This dissertation is a result of a legacy
of deep reflection and insatiable curiosity resulting from that first statistics course.
The message to convey is that individual estimators have their own unique statistical
properties. With a simple n term in the denominator, 2 is on average underestimated and
division by a corrected sample size compensates. In distributional analysis, interests
often are in the expression of variability in the same units as the mean. As a result, interest
commonly involves estimation of , and a simple square-rooting of the sample variance
(
2 ) might not be sufficient.
What does degree of freedom mean? Spatz (1996, p. 188) states the freedom in degrees
of freedom [Spatzs italics] refers to the freedom of a number to have any possible value.
Spatz (1996) continues with further detailed description and attributes an explanatory
quotation to Walker (1940) who states, A universal rule holdsThe number of degrees
of freedom is always equal to the number of observations minus the number of necessary
relations obtaining among these observations.
88
Using R
Using R
Max.
14000
p
M 2 = 9,700 and
2 = 9,865, and the latter being closer to 10,000 is obviously the preferable estimator
J
of the two.
0
89
list.
46
# square root of M2
# sigma hat
# sigma hat prime
}
# compute summary of each vector of simulated standard dev
summary(bias.tmp)
Min. 1st Qu. Median
Mean 3rd Qu.
Max.
1553
7697
9111
9215
10640
20060
summary(unbias.tmp)
Min. 1st Qu. Median
1637
8114
9603
Max.
21150
summary(umvubias.tmp)
Min. 1st Qu. Median
1683
8342
9873
Max.
21740
and G
(see Section 4.3.4) are of interest.
Concerning this dissertation, the bounds of CV
as
Kirby (1974) provides applicable discussion of the sample size boundedness of CV
and other statistics. Further discussion is provided by Wallis and others (1974).
well as G
90
(CV
=
For a strictly positive distribution, the CV
/) is bounded (Kirby, 1974) accord can attain values no larger than
ing to sample size n. Specifically, CV
CV
(n 1)
(4.25)
regardless of how large the CV is of the distribution from which the sample was drawn.
Using R
Using R
For a demonstration, which will be returned to later in Chapter 6 in the context of sample L-moments as estimators, a Gamma distribution having = 3,000 (True.MU=3000)
and CV = 10 (True.CV) is defined in example 47 . These statistics result in = 30,000
or True.SD=30000. The help() function for a random Gamma variate (the rgamma()
function) reports the relation between the product moments of the distribution and the
shape (a) and scale (s) parameters. The algebra is shown in the last line of example 47 .
47
ples drawn from the Gamma distribution with the rgamma() built-in R function. The CV
for
values are computed by sd(x)/mean(x) and stored in cvtmp. The estimate of CV
the each sample size is computed by mean(cvtmp) and stored in the variable cv. The
3
Transparency is supported in portable document format (PDF) version greater than or equal to
91
points() function, with each operation, plots a single semi-transparent red filled circle.
p
(n 1) upper limit. The true CV = 10
is shown by the solid horizontal line. The thick line represents the mean of 100 simulated
sample values for each sample size. (There are 100 symbols within each vertical strip.) For
very small samples sizes, it is seen that the sample estimate of CV generally is severely
p
limited because of the (n 1) bounds and as sample size increases to n = 200, the
is about 7.8. The CV
is biased low because of the underestimaexpected value of CV
tion sampling property of
. The figure is but one example that could be constructed
In the figure, the dashed line represents the
for different parent distributions. Figures such as 4.1 show that the product moments
can have considerable limitations for distributions having large relative variation. This
example is considered again in the context of L-moments in Chapter 6 and specifically in
Section 6.5.4.
92
8
2
CV
10
12
14
50
100
150
200
SAMPLE SIZE
(thick solid
Figure 4.1. Demonstration of upper limit boundedness (dashed line) and bias of CV
and curved line) as computed by 500 simulations for each sample size for a Gamma distribution
having = 3,000 and CV = 10 (solid horizontal line) from example 48
4.3.4 Bias and Boundedness of Skew
n 1
|G|
n2
(4.26)
where n is sample size. Dingman (2002, p. 559, eq. CB2-10) reports eq. (4.26) as |gx | =
Using R
Using R
are readily
The effects of the boundedness and negative bias (underestimation) of G
demonstrated by statistical simulation using the lmomco package. The Pearson Type III
distribution is selected. The Pearson Type III distribution is particularly interesting to
study using product moments because the parameters of the distribution are the first three
product moments in a similar fashion as the first two product moments are parameters of
the Normal distribution. Therefore, comparisons of skewness estimators using the Pearson
Type III distribution are readily made.
For a demonstration that begins in example 49 , a Pearson Type III distribution with
parameters = 1000, = 500, and G = 5 or PE3(1000, 500, 5) is specified using
the vec2par() (vector to parameters) function. The nonexceeds() function returns a
useful vector of F values and quape3() function returns the quantiles of the distribution
as set by the pe3 parameters. This Pearson Type III distribution is shown in figure 4.2.
49
#pdf("pe3experimentA.pdf")
True.Skew <- 5
pe3 <- vec2par(c(1000,500,True.Skew), type="pe3")
F
<- nonexceeds(); Q <- quape3(F,pe3)
plot(F,Q, type="l")
#dev.off()
The demonstration continues in example 410 . The example sets up of the number
of simulation runs nsim to perform for each of several selected sample sizes nsam. The
for each of the sample sizes. The rlmomco() funcvector G stores the mean values of G
tion is used to generate random variables of sample size n from the Pearson Type III
parent. Specifically, the rlmomco() function returns simulated values by dispatching
to the QDF of the Pearson Type III distribution. Similar random variable generation
was performed in example 49 using the quape3() function. The rlmomco() function actually dispatches to the quape3() function. The correct dispatch is made because
the content in the type field of the pe3 lmomco parameter list declares the distribution
as Pearson Type III (see example 71 on page 163). The pmoms() function computes
the product moments of the simulated sample. For this particular study, interest is in
3000
1000
2000
4000
5000
0.0
0.2
0.4
0.6
0.8
1.0
Figure 4.2. Parent Pearson Type III distribution of PE3(1000, 500, 5) used to assess bias in product moment skew from example 49
410
500
c(6, 8, 10, 12, 15, 20, 25, 30)
<- 0
<- vector(mode = "numeric")
#pdf("pe3experimentB.pdf", version="1.4")
plot(c(), c(), type="b",
xlim=range(nsam), ylim=c(0,1.25*True.Skew),
xlab="SAMPLE SIZE", ylab="PRODUCT MOMENT SKEW")
for(n in nsam) {
for(i in seq(1,nsim)) {
D
<- rlmomco(n,pe3)
PM <- pmoms(D)
myG <- PM$ratios[3]
sG[i] <- myG
points(n,myG, pch=16, col=rgb(0.5,0,0,0.05))
}
counter <- counter + 1
G[counter] <- mean(sG)
}
95
4
3
2
0
10
15
20
25
30
SAMPLE SIZE
(thick solid
Figure 4.3. Demonstration of upper limit boundedness (dashed line) and bias of G
curved line) as computed by 500 simulations for each sample size for a Pearson Type III distribution of PE3(1000, 500, 5) (G = 5 and is the solid horizontal line) from example 410
for a substantially asymmetrical
The results of figure 4.3 demonstrate that the bias of G
for highlydistribution is considerable and in fact is alarming for general application of G
skewed data. Further, the bias reduces slowly as sample size increases. The results also
96
example.
Treatment for low outliers is particularly important in analysis of annual peak streamflow in
semiarid to arid regions like Texas. Asquith and Roussel (2009, p. 19) provide salient discussion.
The low outlier problem in Texas flood hydrology, as encountered by the author circa 1995, has had
a profound philosophical impact on the authors policies towards analysis of hydrometeorological
data in Texas and the greater American Southwest.
97
4.5 Summary
In this chapter, the product moments are described, and both the theoretical and sample
product moments are named and mathematically described. Principally, these are the
product moments of mean, standard deviation, variance, coefficient of variation, skew,
and kurtosis. The 22 examples in the chapter demonstrate the computation of these statistics and many of their properties. Among these properties are the concepts of bias and sampling variance, which also are introduced in the chapter, and how each reflects the properties of a statistical estimator is discussed. Several examples are provided and built-in
R functions that are demonstrated include mean(), median(), and sd(). The pmoms()
function of the lmomco package is used, and this function returns the first four product
moments and alternative definitions of standard deviation. The bias of the standard deviation is demonstrated as is the boundedness of the coefficient of variation. The bias and
boundedness of the skew also is demonstrated. Finally, a discussion of logarithmic transformation, which often is used to mitigate for the sampling properties of the product
moments, is provided.
98
Chapter 5
Probability-Weighted Moments
5.1 Introduction
The probability-weighted moments (Greenwood and others, 1979) are an alternative
statistical moment that like the product moments, characterize the geometry of distributions and are useful for parameter estimation. The probability-weighted moments
emerged in the late 1970s generally for the purposes of parameter estimation for distributions having only a QDF form. In particular, the five-parameter Wakeby distribution of Section 9.2.4 was the subject of many of the early studies. At the time, the Wakeby distribution
(Landwehr and others, 1979a) seems to have been of particular discipline-specific interest
for flood hydrology. However, the theory of probability-weighted moments (Hosking,
1986) and their appearance as a new tool in the statisticians tool box garnered additional
interest (Landwehr and others, 1979b, 1980; Hosking and others, 1985; Ding and Yang,
1988).
99
The probability-weighted moments are well suited, and generally superior, to the product moments for parameter estimation for distributions of data having large skew, heavy
or long tails, or outliers. Although powerful for parameter estimation, the probabilityweighted moments unfortunately are difficult to individually interpret as measures of distribution geometry. For example, Ulrych and others (2000, p. 53) remark that probabilityweighted moments obscure the intuitive understanding of L-moments.1 By the mid
1980s, the probability-weighted moments were reformulated into the L-moments, which
were unified by Hosking (1990) and are formally described in Chapter 6.
The L-moments are readily interpreted in similar fashions as the product moments in
Chapter 4. The probability-weighted moments and L-moments are linear combinations
of each other. Computation of one therefore yields the other; so inferences based on either
are identical. The choice of between probability-weighted moments and L-moments can
be influenced by simple mathematical convenience.
Variations on probability-weighted moments exist. For example, they are amenable
to situations of data censoring, and the definitions and applications of probabilityweighted moments for some types of censored data are deferred to Sections 12.2 and
Section 12.4 in the context of advanced topics of distributional analysis. Another variant of probability-weighted moments has been developed (Haktanir, 1997) called selfdetermined probability-weighted moments, which increases statistical performance by
utilizing mathematical properties of the underlying probability distribution (Whalen
and others, 2002, p. 177). This variant is not considered in this dissertation.
The lmomco package provides probability-weighted moment support, and the functions
are listed in table 5.1. These functions support both theoretical and sample computations.
The distinctions between the two computation types are discussed in the next section. The
listed functions are thoroughly demonstrated following the Using R identifiers in this
chapter and elsewhere in this dissertation.
See Section 3.1 and particularly page 62 of this dissertation related to L-moment interpretation
in terms of order statistics.
100
Table 5.1. Summary of probability-weighted moment related functions of the lmomco package by
Asquith (2011)
Function
theopwms()
pwm()
pwm.ub()
pwm.gev()
pwm.pp()
vec2pwm()
pwm2vec()
Purpose
Compute theoretical probability-weighted moments by distribution
Compute unbiased sample probability-weighted moments
Compute unbiased sample probability-weighted moments by dispatch to pwm()
Compute sample probability-weighted moments that are optimized
for the Generalized Extreme Value distribution
Compute sample probability-weighted moments by plotting positions
Convert a vector to probability-weighted moments
Convert probability-weighted moments to a vector
(5.1)
where p, r, and s are integers. By historical convention, the most common probabilityweighted moments r are
r = M1,r,0 = E[x(F ) F r ]
(5.2)
Z
r =
x(F ) F r dF
(5.3)
E[X ] =
[x(F )]r dF
101
(5.4)
Readers are asked to juxtapose the quantities being raised to the power r in eqs. (5.3)
and eq. (5.4). In the case of product moments, the quantities x are raised to r. Whereas,
for the probability-weighted moments, the nonexceedance probability values 0 F 1
are raised to r. In other words, each x is weighted by a power of F , hence, the descriptive
name of probability-weighted moment.
This subtle mathematical adjustment makes substantial changes and specific improvements to the sampling properties of the probability-weighted moments relative to the
product moments. As values for the differences x become large in the computation
of sample product moments, these large differences have an increasingly larger influence
on the estimation of the moment. In other words, relatively more weight is contributed
by large differences to the computation of the moment in the product moment case. This
increased proportionality of more weight does not occur with the weighting by powers
of F for the probability-weighted moments in part simply because of the constraint that
Using R
Using R
The theopwms() function, which implements eq. (5.3) by using the integrate()
function, the theoretical probability-weighted moments for the standard Normal distribution are computed in example 51 . In the example, the lmomco parameter list (see
page 163 and ex. 71 ) for the distribution is set by the vec2par() function and the theoretical probability-weighted moments are set into NORpwm. The first two r are set into B0
and B1 by definition unique to this distribution (see Section 7.2.1). The deltaMEAN and
deltaSIGMA are the respective differences, and the output by the cat() function shows
102
1 X
n
j1
1 n1
r =
xj:n
n
r
r
j=1
(5.5)
1X
r =
n j=1
j+A
n+B
r
xj:n
(5.6)
where A and B are plotting-position coefficients A > B > 1. Hosking (1986, pp. 3233)
reports that there is no general reason to estimate [probability-weighted moments] by any
particular unbiased or plotting-position estimator. The presentation of either estimator
occurs throughout probability-weighted moment (and L-moment) literature; in particular,
r is particularly common: (Landwehr and others, 1979b; Hosking, 1990, 1995; ZafirakouKoulouris and others, 1998). The j = 1 term in eq. (5.5) is sometimes written as j = r + 1
with no numerical change in results because of zero multipliers on the first r terms.2 The
following example demonstrates
52
103
The r are used in general practice, but in special circumstances in which a parent distribution is known, optimal values of A and B might exist. For the vast majority of applications, r are sufficient. Hosking and Wallis (1997, pp. 3334) provide succinct discussion
and pertinent literature citations. Chen and Balakrishnan (1995) make comparisons of the
two probability-weighted moment estimators for the Generalized Extreme Value, Generalized Logistic, and Generalized Pareto distributions in the context of the infeasibility
problem.
Chen and Balakrishnan defined the infeasibility problem as a situation in which the
upper limit of a distribution is less than one or more of the largest sample values or in
which the lower limit is greater than one or more of the smallest sample values. The
authors consider, using simulation and a range of sample sizes and shape parameters, the
percent of time that r and r produce infeasible distribution parameters. The authors conclude that r can measurably reduce the probability of infeasible parameters for certain
conditions of sample size and shape. Chen and Balakrishnan (1995, p. 569) recommend
that a routine check be carried out to see whether the problem of infeasible parameter estimates occurs, and use modified probability-weighted moment estimators if the
problem does occur.
Modified probability-weighted moment estimators are described on various pages by
Hosking (1986) to mitigate for infeasible parameter estimates, and the algorithm is summarized by Chen and Balakrishnan (1995, p. 568) in a near verbatim quote:3
Let x denote x1:n or xn:n , if the boundary condition [limit] is found to be violated by the [probability-weighted moment] estimators [applicability for either
unbiased and plotting-position seems apparent to this author (Asquith)] of the
parameters, equate x to + / and solve for . This leads to
This algorithm is much more meaningful after reviewing the Generalized Extreme Value, Generalized Logistic, and Generalized Pareto distributions in Chapter 8.
104
Further commentary, based on the authors experiences (Asquith and Roussel, 2009)
with large numbers of sample probability-weighted moment computations with realworld data using small sample sizes, is needed. In rare circumstances, values for sample
probability-weighted moments computed by r , when converted to L-moments, violate
(barely) the theoretical bounds or constraints discussed in Chapter 6. Because probabilityweighted moments and L-moments are linear combinations of each other, having one is
the same as having the other. Therefore, when the L-moment constraints are violated, the
author suggests that plotting-position estimators can be used as a fall-back method of
computation.4
Special classes of data could have prior estimates of F ; in other words, probability is
known a priori. An example are distributions of grainsize, in which the fraction of the
sample passing specific diameters (sieve size) is recorded. The random variable in this
situation is seemingly the fraction passing and not the diameterthe diameter being
fixed by the measurement apparatus. Asquith (2003, chap. 4) suggests that a probabilityweighted moment type referred to as prior probability-weighted moments can be used
for a numerical approximation to eq. (5.3). Prior probability-weighted moments are not
considered in this dissertation.
Using R
Using R
The sample probability-weighted moments are shown mathematically in eq. (5.5) with
notation (a b ). The (a b ) notation is defined as
a
a!
=
b
(a b)! b!
for b a
(5.7)
and by convention 0! = 1; eq. (5.7) is an expression for the number of possible combinations of a items taken b at a time.
The computation of combinations is trivial in R with the choose() function. The function is demonstrated in example 53 for the problem of solving for the number of combinations of a committee of 3 from a group of 20 people. This example is adapted from
Ross (1994, example 4a). The result is that there are 1,140 possible combinations.
105
choose(20,3) # built-in to R
[1] 1140
Combinatorial theory and notation important for order statistics and other statistics
based on order. Readers should note that the use of the choose() function is important
because of the ratio in eq. (5.7) by direct computation by use of three factorial() functions is not always feasible for large a and b because of inherent numerical limitations of the
computer. Finally, the terms returned by (a b ) are known as binomial coefficients.
The probability mass function of the Binomial distribution, not a PDF because the
distribution is discrete (not continuous), is available as the pbinom() function and is
defined as
n i
P (i) =
p (1 p)n1 for i = 0, 1, , n
i
(5.8)
J
Returning to the sample probability-weighted moments, the unbiased r are readily
computed in example 55 with the pwm.ub() function. In the example, the Normal
distribution is sampled for n = 100, which has = 100 and = 50, and the sample
is placed into fake.dat. The unbiased r values of the sample finally are computed by
pwm.ub() on the fake.dat vector.
55
J
106
For further demonstration of sample probability-weighted moments, a custom function is created for computation of an arbitrary number of r using the plotting-position
formula. The test.pwm.pp() function is defined in example 56 .
56
107
The $source attribute in the output shown in the example from the test.pwm.pp()
and pwm.gev() functions identifies the calling function. The $A and $B variables of the
list returned by the pwm.gev() function store the A and B argument values for later
reference if needed.
3 = 102 in example 58 is created and displayed from the PWM variable using the
str() function.
58
The example shows that only the first five (only four are computable for the example, so
NA [not applicable] is returned for 5 ) are supported by the function for as.list=TRUE
and are available as the PWM$BETAr values for 0 r 4. An alternative probabilityweighted moment list structure also is used in lmomco and is shown in example 59 . In
the example, the previous variable PWM of example 58 is converted to L-moments and
back to probability-weighted moments. The L-moments are not shown in the example
in order to maintain the focus on probability-weighted moments. The r are stored in a
vector named $betas. The name of the generating function of the values in the vector
is stored in the $source string. The $source variable is used in many list structures by
lmomco to cast heredity of the numerical results.
59
lmom2pwm(pwm2lmom(PWM))
$betas
[1] 450 -214 -139 -102
NA
$source
[1] "lmom2pwm"
108
That there are two data structures in lmomco, which represent probability-weighted
moments, is a historical artifact. (Technically, there are variations of the theme such
as shown in example 57 .) The fact that there are two primary structures containing
probability-weighted moments is partly a reflection of changing design ideas and decisions by the author. The form seen in example 59 is preferable because of the vector form
of the r , which can grow to arbitrary length, can readily be queried to extract specific r
in a programming context.
Using R
Using R
The Gamma distribution is described in Section 7.2.3, and from that section, the relations between 0 and 1 and the parameters and are
0 =
(5.9)
(5.10)
where () is the complete gamma function.5 The relations between the product moments
and the parameters are more straightforward and are
= /
2
= /
(5.11)
(5.12)
109
n <- 20; nsim <- 10000 # sample size and number of simulations
# set the gamma distribution according to lmomco style
Alp <- 2; Beta <- 3
PAR.gam <- vec2par(c(Alp,Beta), type="gam")
# Alp is SHAPE and Beta is SCALE.
# create some vectors
Alp.PWM <- vector(mode="numeric")
Alp.PM <- Beta.PM <- Beta.PWM <- Alp.PWM
# the simulation loop
for(i in 1:nsim) {
X <- rlmomco(n,PAR.gam) # random samples
sampar <- pargam(pwm2lmom(pwm(X)))
Alp.PWM[i] <- sampar$para[1]
Beta.PWM[i] <- sampar$para[2]
sampms <- pmoms(X)
samMU <- sampms$moments[1]
samSD <- sampms$moments[2]
tmpB <- samSD^2/samMU
Alp.PM[i] <- samMU/tmpB
Beta.PM[i] <- tmpB
}
results <- c(mean(Alp.PWM), mean(Beta.PWM),
mean(Alp.PM), mean(Beta.PM))
results <- sapply(results, round, digits=3)
cat(c("PWM Results: alpha=",results[1]," beta=",results[2],"\n"))
PWM Results: alpha= 2.154 beta= 3.134
cat(c("PM Results: alpha=",results[3]," beta=",results[4],"\n"))
PM Results: alpha= 2.327 beta= 2.942
110
The results reported at the end of the example show that the probability-weighted
moments provide a closer estimate to the true shape of the distribution = 2 and that
the product moments provide a closer estimate to the true scale of the distribution = 3.
Different results would occur for different values of , , and sample size. In general, the
probability-weighted moments will remain a competitive tool for parameter estimation,
and as the magnitude of the scale and/or shape increases they will often be superior to
product moments.
5.4 Summary
In this chapter, the probability-weighted moments are described. A brief historical context of the moments and their heredity to L-moments is provided. The mathematics of
both the theoretical and sample probability-weighted moments then followed. The sample probability-weighted moments can be computed either by unbiased estimators or by
plotting-position estimators, and both techniques are described. A total of 10 examples
are provided, and probability-weighted moment related functions of the lmomco package
that were demonstrated include pwm.gev(), pwm.ub(), theopwms(), pwm2lmom(),
and lmom2pwm(). The lmomco probability-weighted moment list is discussed to enhance
the understanding of the probability-weighted moment implementation of the lmomco
package. Finally, a short discussion of some sampling properties of probability-weighted
moments in the context of the method of probability-weighted moments for the Gamma
distribution is made. Because probability-weighted moments and L-moments are linear combinations of each other, a complementary discussion of sampling properties of
probability-weighted moments is indirectly provided in Chapter 6 and specifically in Section 6.5.
111
Chapter 6
L-moments
In this chapter, I present a comprehensive introduction to L-moments an ancillary discussion. Understanding of the L-moments, but not the entire chapter, provides a critical
prerequisite needed for this dissertation. I have purposefully placed both censored and
multivariate L-moments in a later chapter. This chapter presents the defining mathematics and sample counterparts of L-moments along with a step-by-step presentation
of distribution fit by L-moments. Secondarily important components of this chapter are
the visualization of L-moment weight factors, a reference frame perspective between
L-moments and product moments, and TL-moments (defining mathematics and sample counterparts). The discussion of the sampling properties of L-moments is to be
juxtaposed with similar discussion of the product moments in an earlier chapter. The
sampling properties provide an important justification for distributional analysis with
L-moment statistics using R.
6.1 Introduction
As with the probability-weighted moments, L-moments (Hosking, 1990) are an attractive alternative system of moment-like quantities (Jones, 2004, p. 98) and thus are an
alternative to product moments. Like other statistical moments, L-moments characterize
the geometry of distributions and summarize samples. L-moments are directly analogous
tothat is, have similar interpretations asthe product moments. This makes L-moments
conceptually accessible to many potential users.
L-moments are based on linear combinations of differences of the expectations of order
statistics (see Section 3.1) as opposed to the product moments, which are based on powers
(exponents) of differences (see eq. (4.10)). For example, the product moment definition
112
of skew (based on differences to a third power, see eq. (4.14)), results in extremely poor
sampling performance for distributions characterized by heavy tails, asymmetry, and
outliers. The performance of kurtosis, which is based on differences to the fourth power
(see eq. (4.15)), is even worse. In part because of favorable sampling performance, Hosking
(1992) concludes that L-moments can provide good summary measures of distributional
shape and may be preferable to [product] moments for this purpose.
Data that frequently contain outliers and heavy tails are endemic in the earth-system
sciences. The distribution of flood magnitude is one such example and earthquake damages are another. The history of L-moments could be considered as beginning with the
statistical needs of researchers of surface-water hydrology (Landwehr and others, 1979a,b,
1980) with interests in floods, extreme rainfall hydrology, and ancillary topics in the mid
1970s through the later parts of the 20th century. However, Hosking (1990) traces statistical connections to L-moments back to the 19th century. Historically, L-moments were
developed from probability-weighted moments (see Chapter 5) but were adumbrated1
earlier (Hosking, 1999, p. 1) such as by Kaigh and Driscoll (1987) or Sillitto (1951, 1969).
The core theory of L-moments for univariate applications was unified by about the late
1980s to early 1990s. Hosking (1990) provides a canonical reference along with the general
historical context and placement of L-moments in the broader statistical literature.
Since that time, the L-moment and probability-weighted moment literature continues to
develop and expand (Delicado and Goria, 2008; Elamir and Seheult, 2003, 2004; Haktanir,
1997; Hosking, 1995, 2000, 2006, 2007a,b,c; Jones, 2004; Karvanen, 2006; Kliche and others,
2008; Kroll and Stedinger, 1996; Liou and others, 2008; Royston, 1992; Serfling and Xiao,
2007; Ulrych and others, 2000; Unnikrishnan and Vineshkumar, 2010; Wang and others,
2010; Whalen and others, 2002). Interest in L-moments is not limited to the statistical
profession and those interested in distributions of earth-system phenomena, but interest
exists within financial (Hosking, 1999; Hosking and others, 2000; Jurczenko and others,
2008) and reliability disciplines (Unnikrishnan and Vineshkumar, 2010) as well.
A summary and a then contemporary statement (early 1990s) concerning the excitement
that L-moments caused is informative. Vogel (1995) states that
The challenges posed by extreme hydrological events continue to vex hydrologists. The introduction of the theory of L-moments (Hosking, 1990) is probably the single most significant recent advance relating to our understanding
of extreme events. Generally, L-moments are linear combinations of ordered
1
113
from the Lmoments package is listed in table 6.3, and those functions of the lmom package
are listed in table 6.4. Many of the functions listed in the four tables are used in examples in
this chapter. The functions in these tables and others are answers to the call for L-moment
support by developers of statistical packages made by Royston (1992) that is summarized
on page 10 of this dissertation.
Table 6.1. Summary of L-moment computation and support functions of the lmomco package
by Asquith (2011)
Function
are.lmom.valid()
lmorph()
theoLmoms()
theoTLmoms()
theoLmoms.max.ostat()
lmoms()
lmoms.ub()
lmomRCmark()
lmomsRCmark()
TLmom()
TLmoms()
pwm2lmom()
lmom2pwm()
vec2lmom()
vec2TLmom()
lmom2vec()
Purpose
Check theoretical bounds of L-moments
Morphs between two styles of L-moment lists
Compute theoretical L-moments of a distribution
Compute theoretical TL-moments of a distribution
Compute theoretical L-moments by maximum order
statistics
Compute an unbiased sample L-moments by dispatch to TLmoms()
Compute unbiased sample L-moments by lmoms()
Compute a right-censored sample L-moment by indicator variable
Compute right-censored sample L-moments by indicator variable
Compute an unbiased sample TL-moment
Compute unbiased sample TL-moments by dispatch
to TLmom()
Convert
probability-weighted
moments
to
L-moments
Convert L-moments to probability-weighted
moments
Convert a vector to L-moments
Convert a vector to TL-moments
Convert L-moments to a vector
115
Table 6.2. Summary of L-moment computation functions for probability distributions of the lmomco
package by Asquith (2011)
Distribution
Cauchy
Exponential
Gamma
Generalized Extreme Value
Generalized Lambda
Generalized Logistic
Generalized Normal
Generalized Pareto
Gumbel
Kappa
Kumaraswamy
log-Normal3
Normal
Pearson Type III
Rayleigh
Reverse Gumbel
Rice
Wakeby
Weibull
Right-Censored Generalized Pareto
Trimmed Generalized Lambda
Trimmed Generalized Pareto
L-moments
lmomcau()
lmomexp()
lmomgam()
lmomgev()
lmomgld()
lmomglo()
lmomgno()
lmomgpa()
lmomgum()
lmomkap()
lmomkur()
lmomln3()
lmomnor()
lmompe3()
lmomray()
lmomrevgum()
lmomrice()
lmomwak()
lmomwei()
lmomgpaRC()
lmomTLgld()
lmomTLgpa()
Table 6.3. Summary of L-moment computation functions of the Lmoments package by Karvanen
(2009)
Function
Lmoments()
t1moments()
Purpose
Compute unbiased sample L-moments
Compute unbiased sample TL-moments with trim t = 1
116
r1
1X
k r1
(1)
r =
E[Xrk:r ]
r k=0
k
(6.1)
where r is the integer order of the L-moment, and E[Xrk:r ] is the expectation of the r k
order statistic of a sample of size r, and this equation commonly is expressed in terms
of the QDF as described presently. L-moments also are commonly formulated (Hosking,
1990) from rth-shifted Legendre polynomials Pr (F ), which are defined as
Pr (F )
r
X
r+k
rk r
=
(1)
Fk
k
k
k=0
(6.2)
Z
r =
x(F )Pr1
(F ) dF
(6.3)
The first four theoretical L-moments in terms of the order statistic expectations follow
from eq. (6.1) and are
1 = E[X1:1 ]
(6.4)
2 = 12 (E[X2:2 ] E[X1:2 ])
(6.5)
(6.6)
(6.7)
117
Z
r2
r
1X
j r2
[F (x)]rj1 [1 F (x)]j+1 dx
(1)
r =
r j=0
j
j + 1
or
(6.8)
r =
(6.9)
where
r2
1 X
r 1 r2j
j r1
Lr (u) =
(1)
u
(1 u)j
1 r j=0
j
j+1
(6.10)
The first four theoretical L-moments in terms of the QDF using eqs. (3.4) and (6.1) are
1 =
x(F ) dF
(6.11)
x(F ) (2F 1) dF
(6.12)
x(F ) (6F 2 6F + 1) dF
(6.13)
(6.14)
2 =
0
3 =
0
4 =
0
The theoretical L-moments can be written in terms of the derivatives of the QDF (notationally x(r) (F ); x(0) (F ) is the usual QDF, x(1) (F ) is the first derivative, . . . ). This particularly striking result (Hosking, 2007b, p. 3027) is
r+1
1
=
r!
F r (1 F )r x(r) (F ) dF
(6.15)
This equation (derived from eq. (6.66) for k = r) is particularly useful in interpretation
of 2 (L-scale), which is a measure of distribution variability or spread. The spread of
118
Table 6.4. Summary of L-moment computation functions for samples and by probability distribution
of the lmom package by Hosking (2009a)
Function
samlmu()
lmrexp()
lmrgam()
lmrgev()
lmrglo()
lmrgpa()
lmrgno()
lmrgum()
lmrkap()
lmrln3()
lmrnor()
lmrpe3()
lmrwak()
lmrwei()
Purpose
Compute unbiased sample L-moments
Compute L-moments of Exponential distribution
Compute L-moments of Gamma distribution
Compute L-moments of Generalized Extreme-Value distribution
Compute L-moments of Generalized Logistic distribution
Compute L-moments of Generalized Pareto distribution
Compute L-moments of Generalized Normal (lognormal) distribution
Compute L-moments of Gumbel (Extreme-Value Type I) distribution
Compute L-moments of Kappa distribution
Compute L-moments of Log-Normal (3 parameter) distribution
Compute L-moments of Normal distribution
Compute L-moments of Pearson Type III distribution
Compute L-moments of Wakeby distribution
Compute L-moments of the Weibull distribution
the distribution is proportional to the rate of change (the first derivative) of the QDF. The
greater the rate of change, the larger distance between successively ordered samples.
All theoretical L-moments can be expressed by the first derivative of a QDF. Hosking
(2007a, p. 2877) shows these to be
Z
1 L =
(1 F ) x(1) (F ) dF
(6.16)
2 =
F (1 F ) x(1) (F ) dF
(6.17)
F (1 F )(2F 1) x(1) (F ) dF
(6.18)
F (1 F )(5F 2 5F + 1) x(1) (F ) dF
(6.19)
3 =
0
Z
4 =
and in general
Z
r =
Zr (F ) x(1) (F ) dF
for r 2
119
(6.20)
Zr (F ) =
Pr1
(v) dv
(6.21)
2 > 0
(6.22)
and continuing with the bounds of the L-moments, the theoretical L-moment ratios are
the dimensionless quantities
2 = 2 /1 = coefficient of L-variation
(6.23)
3 = 3 /2 = L-skew
(6.24)
4 = 4 /2 = L-kurtosis
(6.25)
r = r /2
(6.26)
The quantity 2 is meaningful for positive random variables (X 0) and is 0 < 2 < 1.
Other authors (most notably J.R.M. Hosking) lack the subscripted 2 on 2 , but the subscript explicitly is used here and preferred by the author to draw a connection to the
second element of a vector of L-moment ratios.2 As seen in many examples herein, the
lmoms() and vec2lmom() functions (along with many more) return an L-moment ratio
r = 0 for odd r
(6.27)
(6.28)
Another reason advocated by the author for 2 is that the symbol remains available to refer
to the more venerable Kendalls Tau statistic (Hollander and Wolfe, 1973, chap. 8) in investigative
settings involving L-moments and correlation (independence) tests by Kendalls Tau.
3
The irony is noted that these product moments have no theoretical upper limit of magnitude,
yet suffer from algebraic bounds based on sample size as discussed in Chapter 4.
2
120
1) 4 < 1
(6.29)
4 1/4
(6.30)
These bounds are useful and are philosophically attractive because the magnitudes of
3 and 4 are much more constrained than are G and K , and more importantly, these
bounds are not a function of sample size, unlike the algebraic sample-size bounds for G
and K . Hence, relative comparisons of the quantification of the concepts of skewness and
kurtosis for samples and distributions are more informative using L-moments. Additional
intra-moment constraints of L-moment ratios exist, Jones (2004) shows that 6 1/6
and a lower bound for 6 of
1
(424 2
25
144 3) < 6
(6.31)
r
X
(1)
rk
k=0
r
r+k
k for r 0
k
k
(6.32)
from which the first five4 L-moments in terms of probability-weighted moments are
1 =
(6.33)
2 = 21
3 = 62
61 +
(6.34)
(6.35)
(6.36)
(6.37)
If x(F ) is a valid QDF, then the L-moments can be computed directly by numerical
integration to either bypass or otherwise verify the algorithms of many functions in Chapters 79 that convert distributions set by known parameters into L-moments. The general
4
Five are shown in the system of equations here instead of the four in parallel constructs in this
dissertation because of the 5 expression for the Kumaraswamy distribution.
121
equation derived from eqs. (3.4) and (6.1) for computing L-moments given a QDF is
r1
1X
r!
k r1
r =
(1)
r k=0
k
(r k 1)! k!
Z 1
x(F ) F rk1 (1 F )k dF
(6.38)
Hosking (2006) comments that each r can be written as the expectations of extreme
order statistics such as by
r =
r
X
(1)
rk 1
k=1
r1
r+k2
E[Xk:k ]
k1
k1
(6.39)
in terms of maxima order statistics. The set of r in terms of extreme (minima and maxima) order statistics therefore also characterize a distribution. However, the extreme order
statistics do so with redundancy (see Chapter 3, page 65). Hosking (2006, p. 193) shows
that a wide range of distributions can be characterized by their [r ] with no redundancy.
In other words, the characterization by [r ] is nonredundant, in that if even one [r ] is
dropped from the set the remaining [r ] no longer [uniquely] suffice to determine the
distribution (Hosking, 2006, p. 194). As a result, Hosking (2006, p. 198) suggests that
the distribution information contained in r is maximally independent of information
contained by the remaining r1 in the set. By Hoskings logic and remark, L-moments
are particularly suitable as summary statistics of a distribution.
Expansion of eq. (6.39) results in the following system of equations for the first four r
in terms of the largest order statistics
1 = E[X1:1 ]
2 = E[X2:2 ]
(6.40)
E[X1:1 ]
(6.41)
(6.42)
(6.43)
This system of equations is demonstrated later in this chapter (see example 610 ).
122
Using R
Using R
As the output shows, the r for odd r are effectively zero because the Normal distribution is symmetric. The example demonstrates that odd-order L-moment ratios are
consistent with the observation that the odd-order ratios measure distribution asymmetry.
Specifically, each odd-order ratio provides for a progressively higher measure of distribution asymmetry. The theoLmoms() can be used to compute L-moments and L-moment
ratios for QDFs for which analytical or numerical solutions have not been developed. The
theoLmoms() function is useful to verify the computations of other algorithms in several
123
$lambdas
[1] 100.0
$ratios
[1]
NA
45.0 -13.5
18.0
0.45 -0.30
0.40
$source
[1] "pwm2lmom"
In the example, the numerical equivalency of the L-moments in variable lmr to those
in $lambda and $ratios of the terminating output is evident. Readers are asked to note
in example 62 that the use of the vec2lmom() function differs from previous demonstrations because the coefficient of L-variation 2 is used instead of 2 . The argument
lscale=FALSE, thus, is needed in the example.
The third and terminal use of the are.lmom.valid() function in example 63 has
a different list style passed into it compared to the other two. The lmorph() function
is used for internal conversion. Thus, the different implementation styles of L-moments
within the lmomco package also are shown. The styles are discussed in more detail in
Section 6.2.2.
Finally, the author suggests that the following algorithm be considered in circumstances
in which the sample L-moments by unbiased estimators are invalid. Such a circumstance
might occur in large data mining operations in which the sample L-moments (next section)
of hundreds or thousands of observed data sets are computed. It is possible that in a few
samples, typically very small, that invalid L-moments would be computed. The unbiased
sample L-moments are computed with lmoms() and then tested by are.lmom.valid().
124
If the unbiased sample L-moments are not, then L-moments are computed through the
sample probability-weighted moments that are based on plotting positions of the Generalized Extreme Value distribution.
64
J
Eqs. (6.8) and (6.9) both provide expressions for r in terms of the CDF. At first review,
both equations appear not too difficult to implement in R; however, eq. (6.9) is less compatible with vectorization of R as provided by the integrate() function.5 Example 65
implements eq. (6.8) instead of eq. (6.9) because of the much greater algorithmic burden of
placing the series of Lr (u) of eq. (6.10) inside the integral. The code example 65 provides
an excellent example of the congruent use of function within function (and within function) development, numerical integration, and series solution. The algorithmic flexibility
of R is shown.
65
The author initially tried to implement eq. (6.9) as this equation seemed somehow easier than
eq. (6.8)the author failed after considerable and frustrating efforts. However, success was found
for eq. (6.8) and is shown in this dissertation.
125
uses the QDF of the Normal distribution, to those from lambda.by.cdf(), which uses
the CDF of the distribution.
66
Example 66 shows that 2 , 4 , and 8 are all equivalent. (Odd order r are not shown
as these are zero for the Normal distribution.) The results demonstrate the reliability of
x2:n xn:n . The sample order statistics thus are estimated by simply sorting the
data in ascending order. The sample L-moments are
" r1
1 X
#
n
X
n
r
1
i
1
n
i
1
r =
xi:n
(1)j
r r
j
r
j
j
i=1
j=0
(6.44)
2 /
1 = sample coefficient of L-variation
2 =
3 /
2 = sample L-skew
3 =
4 /
2 = sample L-kurtosis
4 =
(6.45)
(6.46)
(6.47)
r =
r
2
126
(6.48)
The author recognizes that the sample L-moments (and sample probability-weighted
moments) in lmomco are not computationally efficient. For efficiency, Wang (1996b)
describes direct sample estimators of r for r 4 and provides FORTRAN source code
based on expansion of eq. (6.44). The FORTRAN algorithm is fast. However, the lmomco
package uses the choose() function of R for the binomial coefficients (a b ) to support an
arbitrary order r of L-moments. Binomial coefficient computation is seen example 54
on page 106.
Using R
Using R
The sample L-moments are readily computed as shown in example 67 . The output of
the lmoms() (lmomco), samlmu() (lmom), and Lmoments() (Lmoments) functions show
that the respective package authors (Asquith, 2011; Hosking, 2009a; Karvanen, 2009) have
differing implementation ideas for an L-moment object. For the lmomco package, this
data structure is known as the lmomco L-moment list. In general, these L-moment
objects interact in package-specific ways with other functions available in the two packages
and are thus evidently intended somewhat for intra-package purposes.
67
J
127
As shown in the output of example 68 , the L-moments Lx and L-moment ratios LCV
and TAUx self-document or label the values (2 = 23 or 3 = 0.1). This nomenclature
style for an lmomco L-moment list, however, is restrictive. The nomenclature would rapidly
become burdensome as the number of L-moments increases. An alternative data structure
is produced in example 69 .
69
0.30000000
It is seen in the morphed LMR list that the values have been vectorized in $lamdas and
$ratiosthe greater programming flexibility of using vectors hopefully is self evident.
The lmorph() function thus converts (and visa versa) the L-moment objects into differing
data structures. The structure shown is useful because other L-moment types, such as the
TL-moments can be supported. These L-moment types require additional documentation
concerning the trimming of the sample. Finally, the $source attribute, as seen in other
special lmomco lists, identifies the name of the called function.
128
There are two L-moment data structures in lmomco, and this is a historical artifact. The
fact that there are two primary structures is partly a reflection of changing design ideas
and decisions by the author. The form seen in example 69 is preferable because of the
vector forms of r and r , which can grow to arbitrary length, can readily be queried to
extract specific r or r in a programming context.
"maxOstat.system" <function(r=1) {
sapply(1:r, function(k,r) { (-1)^(r-k)/k * choose(r-1,k-1) *
choose(r+k-2,k-1) }, r=r)
}
coes1 <- maxOstat.system(1); coes2 <- maxOstat.system(2)
coes3 <- maxOstat.system(3); coes4 <- maxOstat.system(4)
lmr <- vec2lmom(c(1200, 500, 0.3)) # set first three L-moments
GEVpar <- pargev(lmr) # perform parameter estimation for GEV
# Perform large samplings of samples the four
# sample sizes, extract the maximum each time and finally compute
# the mean of each.
x <- rlmomco(2000, GEVpar) # simulate 2000 values for resampling
samlmr <- lmoms(x) # compute sample estimates in typical fashion
E11 <- mean(replicate(100000, max(sample(x, 1, replace=TRUE))))
E22 <- mean(replicate(100000, max(sample(x, 2, replace=TRUE))))
E33 <- mean(replicate(100000, max(sample(x, 3, replace=TRUE))))
E44 <- mean(replicate(100000, max(sample(x, 4, replace=TRUE))))
lam1 <- E11*coes1
lam2 <- E22*coes2[2] + E11*coes2[1]
lam3 <- E33*coes3[3] + E22*coes3[2] + E11*coes3[1]
lam4 <- E44*coes4[4] + E33*coes4[3] + E22*coes4[2]+ E11*coes4[1]
t3 <- lam3/lam2; t4 <- lam4/lam2
cat(c("# By maxima:",
129
round(c(lam1,lam2,t3,t4), digits=3),"\n"))
# By maxima: 1200.245 493.06 0.301 0.281
cat(c("# By lmoms():",
round(c(samlmr$lambdas[1:2],
samlmr$ratios[3:4]), digits=3),"\n"))
# By lmoms(): 1198 497.731 0.294 0.206
can be
The relative contribution of individual data values on the computation of
r
depicted by visualization of L-moment weight factors. To begin, the sample L-moments
r
r
can be shown to be linear combinations of the ordered sample (x1:n x2:n xn:n )
(r)
and a weight factor wj:n . The equation is
n
X (r)
= 1
w xj:n
r
n j=1 j:n
(6.49)
X
i=0
(1)
k1i
k1 k1+i j1
n1
/
i
i
i
i
(6.50)
(r)
The wj:n (weights), when graphically depicted, visually show the relative contribution of
combined with wj:n for an alternative formattention is needed in the form of the weight
factor when comparing L-moment computations. When the weight factors are in the form
130
wj:n /n (note the 1/n), then the weights express, with regard to sign, the relative amount
that each sample order statistic contributes to a given r .
Using R
Using R
(r)
The wj:n for a sample n = 19 are shown in figure 6.1. The figure shows the relative
contribution of each ordered observation on the summation for the L-moment. The plots
were generated by example 611 and are based on the Lcomoment.Wk() function. This
example reproduces the weight factor distributions as shown in a figure by Hosking and
Wallis (1997, fig. 2.6)the 6 has been added for this dissertation.
611
J
131
10
Wk4, LKURTOSIS
10
10
10
15
15
1.0
Wk6, TAU6
1.0
Wk3, LSKEW
15
15
10
1.0
Wk5, TAU5
Wk2, LSCALE
1.0
15
1.0
1.0
Wk1, MEAN
10
15
Figure 6.1. Graphics showing the weight factors of sample L-moment computation for each observation from a n = 19 sample on the respective L-moment from example 611
To conclude this section, it is informative to show an example of the L-moment weight
factors for proportional computation of the L-moments from a sample. In example 612 ,
, the
it is shown for a sample n = 4 that each value contributes 0.25, whereas for the
2
order statistic x2:4 = 20 contributes 0.0833. Finally, the last two lines of output shows
L-moment equivalencenote that lmoms() does not use the Lcomoment.Wk() function.
Therefore, a double check of sorts is provided.
612
132
Wk1[i]
Wk2[i]
Wk3[i]
Wk4[i]
<<<<-
Lcomoment.Wk(1,i,n)/n
Lcomoment.Wk(2,i,n)/n
Lcomoment.Wk(3,i,n)/n
Lcomoment.Wk(4,i,n)/n
}
round(Wk1, digits=4),
cat(c("# Weights for mean",
# Weights for mean 0.25 0.25 0.25 0.25
round(Wk2, digits=4),
cat(c("# Weights for L-scale",
# Weights for L-scale -0.25 -0.0833 0.0833 0.25
cat(c("# Weights for 3rd L-moment", round(Wk3, digits=4),
# Weights for 3rd L-moment 0.25 -0.25 -0.25 0.25
cat(c("# Weights for 4th L-moment", round(Wk4, digits=4),
# Weights for 4th L-moment -0.25 0.75 -0.75 0.25
"\n"))
"\n"))
"\n"))
"\n"))
The author acknowledges the reference frame idea and written suggestions from George
Rudy Herrmann in fall of 2008.
133
The Lagrangian view is where the reference frame moves with the fluid, and the Eulerian reference system is where the reference frame is fixed and fluid moves past the reference frame. It can be conceptualized that L-moments often perform better than product
moments because the overall set of measures has a narrower range of variation (is more
compact), which allows for greater relative precision.
The Lagrangian-Eulerian comparison might be arcane, so consider the reference-frame
comparison a little further:
With L-moments, one traverses an ordered sample by traveling from one point to the
next, the length of each leg of the trip is recorded, and various quantities based on
these lengths are computed.
With product moments, one traverses a random sample by traveling from the mean
to each individual point in succession with no regard to order (data magnitude), the
length of each individual and non-interacting trip (the Eulerian view) is recorded,
and various quantities based on powers of the lengths are computed.
The total travel distance for the information content of the sample is greater in the Eulerian
view and the average travel distance is greater as well as variously exponentiated. Hence,
travel with this view is much less efficient (not the statistical meaning of efficient).
In an effort use other language for description, L-moments are anchored to the reference scale differently through ordering and intra-sample computations. Whereas, product
moments are explicitly anchored to the reference scale by the mean and order is unimportant. Finally to conclude this discussion, it can be considered that
L-moments are statistics of jumps between the ordered sample values,
whereas
Product moments are statistics of moment arms about the mean.
Hopefully, this conceptualization and distinct will aid some readers in understanding the
differences between the two moment definitions.
134
Using R
Using R
The comparison of the reference frame of L-moments and product moments is enhanced
upon visualization of the differences in travel distances. In example 613 , a random sample of n = 100 is drawn from an Exponential distribution. The absolute values of the
trip distance from each observation to the mean are computed and set in the PM variable.
The n 1 intra-sample distances are computed and set in the LM variable. The values of
the two variables are shown. Clearly, the travel distances for the computation of product
moments (PM) are greater than those for the computation of L-moments (LM). The example concludes by plotting the results in figure 6.2. The figure shows that the intra-sample
distances and individual trip distances to the mean are considerably smaller in magnitude and have smaller variationhence, a source of the desirable sampling properties of
L-moments that are described in Section 6.5.
613
20
40
60
80
100
Index
Figure 6.2. Comparison of intra-sample distances (solid circles) and individual trip distance to
mean (open circles) for respective L-moment and product moment computation from example 613
x(F ) = + ( )F
(6.51)
Z
1 =
x(F ) dF
0
136
(6.52)
Z
F dF
dF +
1 =
F dF
0
F =1
F =1
F =1
2
+ F
= F
F 2
2
2
F =0
F =0
F =0
=+
2
2
(6.53)
1 = 12 ( + )
(6.54)
x(F ) (2F 1) dF
2 =
(6.55)
F dF 2
F 2 dF 1
0
0
0
F =1
F =1
F =1
2 3
2 3
2 2
F
F
F
+
1
=
2
3
3
F =0
F =0
F =0
2 2
=+
3
3
2
2
2 = 2
F dF + 2
(6.56)
2 = 61 ( )
(6.57)
1 = 12 ( + )
(6.58)
2 = 16 ( )
(6.59)
The Uniform distribution is of limited interest in distributional analysis with the obvious and considerable exception of UNI(=0, =1), which is equivalent to the default of
the R function runif(). The Uniform distribution and the runif() function are critical
for simulation of random variables. The mean (and median) nonexceedance probability of
the UNI(=0, =1) distribution is 0.5, which clearly is (0 + 1)/2 by eq. (6.58). Likewise,
it follows that the 2 of the distribution by eq. (6.59) is 1/6.
137
and
are 1 and 3, respectively, an equivalent UniSuppose that the sample values
1
2
form distribution fit by the method of L-moments is established by
= 1 = 1 ( + ) = = 2
1
2
2 = 3 = 61 ( ) = = 18 +
(6.60)
(6.61)
which upon further simplification yields UNI(=8, =10). For the example, the sample
L-moments are thus equated to the theoretical L-moments of the distribution by adjusting
(well directly solving for in this situation) the parametersthe method of L-moments
is demonstrated. Some distributions are so complex that numerical methods must be
employed to perform the method of L-moments. (Numerical methods also are common
with use of product moments.)
Using R
Using R
The method of L-moments is further demonstrated in example 614 . In the example, n = 10,000 values from a Gamma distribution having respective scale and shape
parameters = 3 and = 4 are simulated using the rgamma() function. The sample
L-moments are computed by the lmoms() function. Next, the parameters are estimated by
the lmom2par() function and an n = 10,000 sample is simulated using the rlmomco()
function instead of the rgamma() function. The function concludes with a report of four
(2:5) of the seven summary statistics returned by the summary() function.
614
138
The summary statistics (minus the minimum and maximum) values are shown at the
end of the example. The two rows of summary statistics are effectively identical. Many variations (and admittedly copies) of the algorithmic theme of the example are used through-
r(t1 ,t2 )
r1
1X
k r1
(1)
E[Xr+t1 k:r+t1 +t2 ]
=
r k=0
k
(6.62)
1 ,t2 )
(t
r
X
1
r
|{z}
k=0
average
of terms
z }| {
(1)k
r1
k
| {z }
combinations
where
139
z
}|
{ (t ,t )
(r + t1 + t2 )! Ir,k1 2
(r + t1 k 1)! (t2 + k)!
|
{z
} | {z }
left tail
right tail
(6.63)
(t ,t2 )
Ir,k1
Z
=
0
left tail
right tail
z }| { z
}|
{
r+t1 k1
t2 +k
x(F ) F
(1 F )
dF
| {z }
(6.64)
quantile
function
where t1 represents the trimming level of the t1 -smallest, t2 represents the trimming level
of the t2 -largest values, r represents the order of the TL-moments. The overbraces and
annotations are added to this particular definition of an L-moment to conceptualize how
the mathematics interact. For the condition t1 = t2 = 0, then eq. (6.38) is recovered.
(t1 ,t2 )
(F )
Pr(t1 ,t2 ) (F )
r
X
r + t1
rj r + t2
=
(1)
F j (1 F )rj
j
r
j
j=0
(6.65)
(r k)!(r + t1 + t2 + 1)!
(r + 1)!(r + t1 )!(r + t2 )!
Z 1
(t ,t )
1 2
r+1
=
(6.66)
and in terms of the CDF F (x), if the derivatives of the QDF do not exist, as
(t ,t )
(r 1)!(r + t1 + t2 + 1)!
(r + 1)!(r + t1 )!(r + t2 )!
Z
(t +1,t +1)
F (x) dx
1 2
r+1
=
(6.67)
2 1
(t ,t2 )
= 2 1
(t ,t2 )
/1 1
for X 0
(6.68)
for r > 2
(6.69)
and
(t ,t2 )
1 ,t2 )
r(t1 ,t2 ) = (t
/2 1
r
Hosking (2007b) shows that the TL-moment ratios, unlike the L-moment ratios, have
bounds greater than 1 in absolute value for all r 2, and these bounds increase as r
140
|r(t1 ,t2 ) |
2(m + 1)!(r + t1 + t2 )!
r(m + r 1)!(2 + t1 + t2 )!
for m = min(t1 , t2 )
(6.70)
1
(t1 ,t2 1)
1 ,t2 )
1 ,t2 1)
(2r + t1 + t2 1)(t
= (r + t1 + t2 )(t
(r + 1)(r + t1 )r+1
r
r
r
1
(t1 1,t2 )
(t1 ,t2 )
(t1 1,t2 )
(2r + t1 + t2 1)r
= (r + t1 + t2 )r
+ (r + 1)(r + t2 )r+1
r
(6.71)
(6.72)
Hosking (2007b, p. 3027) remarks that these relations are of mostly mathematical interest,
but does suggest that they might be useful for r for r 3 near their theoretical bounds.
For example, manipulation of the relations provides 3 (0,1) = (3 4 )/[2(1 3 )], which
could be used to estimate 4 from two different measures of L-skewness.
To conclude this section, Hosking (2007b, pp. 30343035) introduces yet another type of
theoretical L-moment called alternative trimmed L-moments. These particular versions
are analogous to, but are numerically distinct from, the TL-moments in this dissertation,
which are specifically defined by eq. (6.62). These alternative trimmed L-moments are
attractive because these and their respective L-moment ratios attain the same range of
(t ,t2 )
r 1
feasible values as [the usual] L-moments. The alternative trimmed L-moments
terms of the 1st derivative of the QDF x
(1)
in
(F ) for r 2 are
(t1 + t2 + 1)!
(r 1)!t1 !(t2 + 1)!
Z 1
(1,1)
(t1 ,t2 ) =
r+1
(6.73)
0
(t ,t2 )
1
and the
1
(trimmed mean) is
1
1
2
1
(6.74)
which can be expanded using eq. (3.4). Finally, Hosking (2007b) ends with an expression
for the alternative trimmed L-moments in terms of order statistic expectations. They are
the quantities
141
(t1 ,t2 ) =
r+1
r1
(r 2)! X
k r 1 (t2 + k)!(r + t1 + t2 k 1)!
(1)
(r + t1 + t2 )! k=0
k
(k + 1)!(r k)!
Using R
Using R
By analytical solution 3
(1)
tion shows. The attributes $trim, $leftrim, and $rightrim of the lmomco L-moment
list (see page 127 and exs. 67 69 ) in lmr summarize the t, t1 , and t2 settings, respectively, for the call made to the theoTLmoms() function. The $source attribute, as seen in
other special lmomco lists, such as lmomco probability-weighted moment list (see page 108
142
and examples 58 and 59 ) or lmomco parameter list (see page 163 and ex. 71 ), identifies the name of the called function. The lmomco TL-moment list in example 615 does
not structurally differ from the other lmomco L-moment lists presented in Using R on
page 127.
(t1 ,t2 )
r1
P
(1)k
1
k=0
=
r i=t +1
1
nt
X2
r1
i1
r + t1 k 1
n
k
t2 + k
xi:n
ni
(6.76)
r + t1 + t2
where t represents the trimming level of the t1 -smallest or t2 -largest values, r represents
the order of the TL-moments.7 If t1 = t2 = 1 and r = 1 for a TL-mean in eq. (6.76), then
the Sen weighted mean of eq. (3.30) results.
Using R
Using R
The denominator in eq. (6.76) is a constant and should be pulled out to the left and at the level
of 1/r . However, the constraints of typesetting require the quantity to be typeset where shown.
143
[1]
J
The sample TL-moments with at least t1 = t2 = 1 permit estimation for a distribution
such as the Cauchy, which has infinite extreme order statistics. Example 617 for sample sizes of n = 10,000 for 10 simulations shows the individual estimates of the usual
(whole sample) sample mean, which does not exist for the distribution, and also shows
the TL-mean for symmetrical trimming of the two smallest and two largest values. The
results demonstrate that the sample mean is unstable and that the TL-mean (t1 = t2 = 2)
is much more stable and more reliably shows that the central location of the symmetrical
Cauchy is zero.
617
144
tions of interest.
145
nsam
SHAPE
PE3PAR
lmr
TAU3
<<<<<-
U) {
draw random samples
compute L-moments
return the difference
The summary statistics show that the mean difference is near zero, so a conclusion
could be made that 3 is effectively an unbiased estimator of 3 even for a comparatively
small sample size of n = 20.
. In both cases, the statistics over estimate kurtosis (emphasis that term
sample size than K
is conceptual), and this over estimation decreases with increasing sample size. In fact by
146
0.3
0.2
0.1
0.0
0.4
j
<- 0
for(n in nsam) {
j <- j + 1; print(j)
for(i in nsim) {
pm <- pmoms(rlmomco(n,THEpar))
lmr <- lmoms(rlmomco(n,THEpar))
pme[i] <- (pm$kurt - 3)/3
lme[i] <- (lmr$ratios[4] - T4)/T4
}
pmbias[j] <- mean(pme)
lmbias[j] <- mean(lme)
}
#pdf("unbias1.pdf")
plot(nsam,pmbias, type="l", lty=2, lwd=2, ylim=c(-0.05,0.40),
xlab="SAMPLE SIZE", ylab="BIAS RATIO OF KURTOSIS")
lines(nsam,lmbias, lwd=3); abline(0,0)
#dev.off()
20
40
60
80
100
SAMPLE SIZE
Figure 6.3. Bias ratios of product moment kurtosis (dashed line) and L-kurtosis (solid line) as a
function of sample size for standard Normal distributed data from example 619
147
(the Normal distribution) of the product moments. Emphasis is needed that the Normal
is not a distribution associated with particularly heavy tails. Readers are encouraged to
experiment with other distribution types and parameter combinations. Readers can rerun
the example by changing the distribution type on the line commented as # control
dist. here. (See documentation ?dist.list for the dist.list() function for a
The shape and scale parameters of the Gamma (see Section 7.2.3 for definitions) are computed and set into the variables s and a, respectively.
Example 620 continues by converting a vector of the parameters into an lmomco parameter list (see page 163 and ex. 71 ) by the vec2par() function and in turn computing the
true L-moments using the lmomgam() function. The L-moments are set into True.LMR.
The true 2 is extracted from this list by True.LMR$LCV and subsequently output. The
value is 2 = 0.460; this is the relative L-variation of the defined Gamma distribution.
620
J
148
Following example 620 and using the parameters a and s for selected sample sizes,
a simulation study is performed in example 621 . The results are plotted using example 622 and are shown in figure 6.4.
621
nsam <- c( 5, 8, 10, 14, 16, 20, 25, 30, 40, 50,
60, 70, 80, 100, 120, 140, 160, 180, 200)
nsim <- 100
counter <- 0
cv <- vector(mode="numeric")
lcv <- cvtmp <- lcvtmp <- cv
for(n in nsam) {
counter <- counter + 1
for(i in seq(1,nsim)) {
x
<- rgamma(n, shape=a, scale=s)
lmr <- lmoms(x)
cvtmp[i] <- sd(x)/mean(x) # CV hat
lcvtmp[i] <- lmr$ratios[2] # Tau2 hat or LCV
}
cv[counter] <- mean(cvtmp)
lcv[counter] <- mean(lcvtmp)
}
It is seen in the figure that the bias ratio of 2 is much closer to unity and even is near
#pdf("cvlcv.pdf")
plot(nsam, cv/True.CV, type="l",
ylim=c(0.2, 1.1),
xlab="SAMPLE SIZE",
ylab="CV/(True CV) or L-CV/(True L-CV)")
lines(nsam, lcv/True.LCV, lty=2)
legend(50,0.4,
c("PRODUCT MOMENT CV",
"COE. OF L-VARIATION (L-CV)"),
lty=c(1,2,3))
#dev.off()
149
0.8
0.6
0.4
PRODUCT MOMENT CV
COE. OF LVARIATION (LCV)
0.2
1.0
50
100
150
200
SAMPLE SIZE
sample size, in the context of the effects of a single high outlier on the estimation of G
and 3 .
An estimator is said to be consistent (Ugarte and others, 2008, pp. 252254), if paraphrasing Ugarte and others, the variance of a consistent estimator decreases as n increases and
that the expected value [of the estimator] tends to [the true value] as n increases. The con-
in eq. (4.23) and is explored in eq. (6.46) in the context of the log-Normal
sistency of G
3
distribution. This distribution is positively skewed and hence right-tail heavy. However,
further dilation of the right tail is made by contamination so that the robustness of the
two estimators also can be compared.
A sampled log-Normal distribution is created for a sample of n = 100 in example 623
and set into the fake.dat vector. The example also produces the plot of the empirical
150
distribution seen in figure 6.5. The variable zout holds the value of the single-value contamination, which is appended to the fake.dat vector.
623
3.5
3.0
2.5
2.0
1.5
log10(sort(fake.dat))
1.0
Figure 6.5. Empirical distribution of simulated log-Normal data from example 623
It should be pointed out that the value X = 7,000 (the high outlier and contamination)
corresponds to F = 0.999888, and if the data were annual maxima, this is nearly the
#pdf("consist2.pdf", version="1.4")
plot(sams, lskew, xlab="SAMPLE SIZE", ylab="L-SKEW",
pch=sym, cex=siz,
8
Ugarte and others (2008, p. 469) report that bootstrap is an allusion to a German legend about
a Baron Mnchhausen, who was able to lift himself out of a swamp by pulling himself up by his
own hair. The author had previously understood this legend to be the source of bootstrap, but
does not recall the other source(s). In the 1988 movie The Adventures of Baron Munchausen (note
spelling difference) or Abenteuer des Baron von Mnchhausen, Die (Germany), the Baron character
played by John Neville pulls himself out of the sea and not a swamp.
152
col=rgb(0,0,0,0.5))
#dev.off()
#pdf("consist3.pdf", version="1.4")
plot(sams, skew, xlab="SAMPLE SIZE", ylab="SKEW",
pch=sym, cex=siz,
col=rgb(0,0,0,0.5))
#dev.off()
#pdf("consist4.pdf", version="1.4")
plot(sams, logskew, xlab="SAMPLE SIZE",
ylab="SKEW OF LOGARITHMS",
pch=sym, cex=siz,
col=rgb(0,0,0,0.5))
#dev.off()
In figures 6.66.8, the open circles represent samples in which zout high outlier was
not drawn (drawn as picked by sample() function) and conversely, the grey circles
represent samples in which one or more values of zout were drawn. The size of the
grey circles are successively increased according to the number of zout values that were
0.6
0.4
0.5
LSKEW
0.7
0.8
0.9
50
100
150
200
SAMPLE SIZE
Figure 6.6. Relation between 3 and sample size of simulated log-Normal distribution shown in
figure 6.5 from example 624
153
Figures 6.66.8 show that the probability of one or more drawings of zout increases
with increasing sample size. This conclusion is made because there is increasing density
and often size of grey circles as n 200. It also is seen in the figures, in particular
figure 6.6, that two general states of sample skewness estimation exist. In general, but not
6
2
SKEW
10
50
100
150
200
SAMPLE SIZE
Considering first figure 6.6 and the open circles, these symbols form a mirrored
parabola shape with the tapered or diminishing end toward the right. This shape shows
the reduction in sampling variance as n increases and the tapered end is trending towards
3 0.52, which is about lmoms(10^rnorm(100000,mean=2,sd=0.5)). Considering the grey circles, a similar pattern also is seen when zout values are included in the
samples, but the 3 values are about 1.4 times largerthe effect of zout is thus to increase
distribution skewness (not skewness as measured by G) to the right as expected. To clarify,
the sample values of 3 increase as the number of zout values in the sample increases.
154
1.0
0.5
0.5
0.0
SKEW OF LOGARITHMS
1.5
50
100
150
200
SAMPLE SIZE
of logarithms and sample size of simulated log-Normal distribuFigure 6.8. Relation between G
tion shown in figure 6.5 from example 624
in figure 6.7, it is again seen that the open circles form a
Drawing attention from 3 to G
mirrored parabola with the tapering-end toward the right. Because the open circles taper
As seen in the example, the summary() function shows statistical values that strongly
is consistent.
far from Normal, the estimator G
This discussion illustrates why product moments of logarithms are frequently used in
disciplines with substantially skewed data. The logarithms of the data frequently reduce
data skewness. However, the author argues that the analyst ends up then analyzing the
logarithms of the data and not the data in their native unit systemnot always a philosophically attractive situation. The use of the L-moments generally avoids the need for
logarithmic transformation (or any other) and avoids resultant concerns of transformation
156
6.7 Summary
In this chapter, historical background of L-moments is presented, and both the theoretical and sample L-moments were described. Principally, these are the L-moments of mean,
L-scale, L-skew, and L-kurtosis. The boundedness of the L-moments is presented and compared to the unfavorable sample size boundedness of the sample product moments. The
interrelations between L-moments and probability-weighted moments are shown along
with visualization of the relative contribution (weight factors) of specific order statistics
to the computation of the first five L-moments. The chapter continues with a theoretical
and sample description of the TL-moments (the L-moments of trimmed samples). The
sampling properties of L-moments are considered and closing discussion of logarithmic
transformation, which began in Chapter 4, is completed. Finally, the 26 examples in the
chapter demonstrated computations of these statistics using numerous L-moment-related
functions such as lmoms(), TLmoms(), lmom2pwm(), and samlmu().
157
Chapter 7
L-moments of Univariate Distributions
7.1 Introduction
Probability distributions are obvious and important concepts for distributional analysis.
Distributions are chosen and parameters fit to data for various reasons and purposes.
Numerous continuous distributions in the context of L-moment theory are available to
the analyst, and many are considered in this dissertation. Some distributions such as
the Normal or Gamma are well known across disciplines; whereas, others such as the
Kumaraswamy or Kappa are not. This chapter, in conjunction with Chapters 8 and 9,
represents a major reference component of this dissertation: L-moments and parameters
of univariate distributions and using R to perform analysis with these distributions.
The preceding chapters provide background, definitions, general mathematics, and
methods for computation of L-moments, probability-weighted moments, and related
statistics. As required by the nature of the prior discussion and examples, L-moments
158
occasionally are used to compute distribution parameters from sample data, and parameters often are used to specify parent distributions in support of simulation experiments or
graphical presentation. Many of the preceding examples also used simulation to study the
sampling properties of L-moments and, by association, probability-weighted moments.
Furthermore, comparisons of the sampling properties of L-moments to those of product
moments also are made. Those earlier examples have used several of the distributions that
are described in detail in either this chapter or Chapters 8 and 9.
It can be concluded from the preceding discussion that many aspects of this chapter, thus, have been foreshadowed in narrative and example. However, this chapter and
Chapters 8 and 9 systematically treat with mathematical exposition the 22 distributions1
supported by the lmomco package and in many cases by the lmom package as well.
The author acknowledges the semantic similarity between the distribution functions of
the lmom and the lmomco packages. When both packages (lmomco and lmom) are loaded,
a listing of the object(s) masked by one library over the other is provided to the user.
For example, among about two dozen other naming conflicts,2 both packages import a
cdfgev() function. This function in both packages provides the CDF of the Generalized
The log-Normal3 distribution is a special case of the Generalized Normal so the distribution is
not separately counted although separate functions are provided by the lmomco package.
2
The conflicts or object masks as of 2011 are: cdfexp, cdfgam, cdfgev, cdfglo, cdfgno,
cdfgpa, cdfgum, cdfkap, cdfln3, cdfnor, cdfpe3, cdfwak, cdfwei, quaexp,
quagam, quagev, quaglo, quagno, quagpa, quagum, quakap, qualn3, quanor,
quape3, quawak, and quawei.
159
Table 7.1. Summary of distribution functions provided by the lmom package by Hosking (2009a)
Distribution
Exponential
Gamma
Generalized Extreme Value
Generalized Logistic
Generalized Normal
Generalized Pareto
Gumbel
Kappa
log-Normal3
Normal
Pearson Type III
Wakeby
Weibull
PDF
--------------
CDF
cdfexp()
cdfgam()
cdfgev()
cdfglo()
cdfgno()
cdfgpa()
cdfgum()
cdfkap()
cdfln3()
cdfnor()
cdfpe3()
cdfwak()
cdfwei()
QDF
quaexp()
quagam()
quagev()
quaglo()
quagno()
quagpa()
quagum()
quakap()
qualn3()
quanor()
quape3()
quawak()
quawei()
Table 7.2. Summary of L-moment and parameter functions by distribution provided by the lmom
package by Hosking (2009a)
Distribution
Exponential
Gamma
Generalized Extreme Value
Generalized Logistic
Generalized Normal
Generalized Pareto
Gumbel
Kappa
log-Normal3
Normal
Pearson Type III
Wakeby
Weibull
L-moments
lmrexp()
lmrgam()
lmrgev()
lmrglo()
lmrgno()
lmrgpa()
lmrgum()
lmrkap()
lmrln3()
lmrnor()
lmrpe3()
lmrwak()
lmrwei()
160
Parameters
pelexp()
pelgam()
pelgev()
pelglo()
pelgno()
pelgpa()
pelgum()
pelkap()
pelln3()
pelnor()
pelpe3()
pelwak()
pelwei()
161
(1996b), Hosking and Wallis (1997), and Stedinger and others (1993). These and additional
citations are provided as needed on a distribution-specific basis.
lmomco are provided by functions titled cdfXXX(), and the QDFs of lmomco are provided
by functions titled quaXXX(). Distribution functions of lmomco for the PDF, CDF, and
QDFs are listed in table 7.3.
The distribution functions listed in table 7.3 show that the lmomco package breaks
considerably from R tradition in the naming of functions related to distributions. The
nomenclature of R is fine, but the nomenclature can be restrictive if one has a requirement
or need for shifting between (or experimenting with) different distributions as part of
distributional analysis. The R nomenclature lacks some parallelism. However, mimicking
the R tradition, lmomco has the following functions, which provide an alternative means
of calling distributions by the dlmomco(), plmomco(), qlmomco(), and rlmomco()
functions. This dialect simultaneously makes lmomco distribution support more familiar
162
first sentence under the DISTRIBUTION FUNCTIONS headings of this and Chapters 8
and 9. For the example distribution, the moment-order listing for the Generalized Normal
distribution in the previous paragraph is GNO(228, 330, 0.413).
71
J
Concluding commentary is needed. The R environment is built around the design ideal
that distribution functions receive somethat is, not necessarily allparameters through
named arguments to the function. Whereas, lmomco has more compartmentalized design
ideals in which a data structure represents the single parameter argument to the distribution functions. Example 72 provides a comparison of implementation styles for reporting
the upper quartile X0.75 of the Normal distribution. Four different approaches are used
in the example, and the output is shown on the last line of the example: X0.75 = 1,067.
163
For its distribution functions, the lmom package consistently uses a simple vector of
parameter values. This style is an intermediate between the lmomco parameter list and the
general, but not universal, named argument style of R. In the example, the differences in
argument passage are contrasted for the Normal distribution.
page 127 and exs. 67 69 ). The list is used by many functions within the lmomco package that need L-moments. The list can be reverted to a vector by the lmom2vec() function.
The vec2par() function converts a vector of parameters into an lmomco parameter list,
which is shown and described in example 71 in the previous section. The opposite
conversion is supported by the par2vec() function. The vec2pwm() function converts
a vector of parameters into an lmomco probability-weighted moment list (see page 108
and examples 58 and 59 ). The list is used by many functions of lmomco that need
probability-weighted moments. The list can be reverted to a vector by the pwm2vec()
function. The five functions listed in this paragraph also are considered with other highlevel conversion functions on page 169 and also listed in table 7.6.
Table 7.3. Summary of distribution functions provided by the lmomco package by Asquith (2011)
Distribution
PDF
Cauchy
pdfcau()
Exponential
pdfexp()
Gamma
pdfgam()
Generalized Extreme Value
pdfgev()
Generalized Lambda
pdfgld()
Generalized Logistic
pdfglo()
Generalized Normal
pdfgno()
Generalized Pareto
pdfgpa()
Gumbel
pdfgum()
Kappa
pdfkap()
Kumaraswamy
pdfkur()
log-Normal3
pdfln3()
Normal
pdfnor()
Pearson Type III
pdfpe3()
Rayleigh
pdfray()
Reverse Gumbel
pdfrevgum()
Rice
pdfrice()
Wakeby
pdfwak()
Weibull
pdfwei()
Right-Censored Generalized Pareto pdfgpa()
Trimmed Generalized Lambda
pdfgld()
Trimmed Generalized Pareto
pdfgpa()
CDF
cdfcau()
cdfexp()
cdfgam()
cdfgev()
cdfgld()
cdfglo()
cdfgno()
cdfgpa()
cdfgum()
cdfkap()
cdfkur()
cdfln3()
cdfnor()
cdfpe3()
cdfray()
cdfrevgum()
cdfrice()
cdfwak()
cdfwei()
cdfgpa()
cdfgld()
cdfgpa()
QDF
quacau()
quaexp()
quagam()
quagev()
quagld()
quaglo()
quagno()
quagpa()
quagum()
quakap()
quakur()
qualn3()
quanor()
quape3()
quaray()
quarevgum()
quarice()
quawak()
quawei()
quagpa()
quagld()
quagpa()
abbreviations, but the pattern should be evident from the tables in this section. For example, the parameters for the Normal distribution are computed by the parnor() function.
Functions for the parameters in terms of L-moments for the distributions in table 7.3 are
listed in table 7.4.
165
ation for the distribution. For example, the L-moments of the Normal distribution are computed by the lmomnor() function. Functions for the L-moments in terms of the parameters by distribution for the same distributions in table 7.3 are listed in table 7.4.
The theoLmoms() function computes the L-moments of distributions supported by
lmomco. The function uses numerical integration and therefore bypasses analytical or
quasi-analytical solutions shown in this chapter and Chapters 8 and 9. The algorithms
in the theoLmoms() function are distinct from those in the lmomXXX() functions; the
lmomXXX() functions, when possible, are based on analytical expressions or solutions
6.92e-02
1.23e-01
Table 7.4. Summary of L-moment and parameter functions by distribution provided by the lmomco
package by Asquith (2011)
Distribution
Cauchy
Exponential
Gamma
Generalized Extreme Value
Generalized Lambda
Generalized Logistic
Generalized Normal
Generalized Pareto
Gumbel
Kappa
Kumaraswamy
log-Normal3
Normal
Pearson Type III
Rayleigh
Reverse Gumbel
Rice
Wakeby
Weibull
Right-Censored Generalized Pareto
Trimmed Generalized Lambda
Trimmed Generalized Pareto
L-moments
lmomcau()
lmomexp()
lmomgam()
lmomgev()
lmomgld()
lmomglo()
lmomgno()
lmomgpa()
lmomgum()
lmomkap()
lmomkur()
lmomln3()
lmomnor()
lmompe3()
lmomray()
lmomrevgum()
lmomrice()
lmomwak()
lmomwei()
lmomgpaRC()
lmomTLgld()
lmomTLgpa()
Parameters
parcau()
parexp()
pargam()
pargev()
pargld()
parglo()
pargno()
pargpa()
pargum()
parkap()
parkur()
parln3()
parnor()
parpe3()
parray()
parrevgum()
parrice()
parwak()
parwei()
pargpaRC()
parTLgld()
parTLgpa()
provides a single and alternative interface, if not more convenient for the user, to the
are.parXXX.valid() functions.
The following two examples in 74 and 75 demonstrate the use of the parameter
validation function are.parXXX.valid(), and the use of the distribution type function is.XXX(). Example 74 sets the parameters of a Gumbel distribution fit to the
L-moments of a fake data set into the para variable. Subsequently, the quantile Q for
the median (F = 0.5) of the distribution is computed by the quagum() if the parameters in para are valid Gumbel parameters. An attempt to compute the median of the
Exponential distribution follows; however, the attempt fails because the type of the para
167
Table 7.5. Summary of convenience functions by distribution provided by the lmomco package by
Asquith (2011)
Distribution
-Cauchy
Exponential
Gamma
Generalized Extreme Value
Generalized Lambda
Generalized Logistic
Generalized Normal
Generalized Pareto
Gumbel
Kappa
Kumaraswamy
log-Normal3
Normal
Pearson Type III
Rayleigh
Reverse Gumbel
Rice
Wakeby
Weibull
Right-Censored Generalized Pareto
Trimmed Generalized Lambda
Trimmed Generalized Pareto
Parameter validation
are.par.valid()
are.parcau.valid()
are.parexp.valid()
are.pargam.valid()
are.pargev.valid()
are.pargld.valid()
are.parglo.valid()
are.pargno.valid()
are.pargpa.valid()
are.pargum.valid()
are.parkap.valid()
are.parkur.valid()
are.parln3.valid()
are.parnor.valid()
are.parpe3.valid()
are.parray.valid()
are.parrevgum.valid()
are.parrice.valid()
are.parwak.valid()
are.parwei.valid()
are.pargpa.valid()
are.parTLgld.valid()
are.parTLgpa.valid()
Distribution type
-is.cau()
is.exp()
is.gam()
is.gev()
is.gld()
is.glo()
is.gno()
is.gpa()
is.gum()
is.kap()
is.kur()
is.ln3()
is.nor()
is.pe3()
is.ray()
is.revgum()
is.rice()
is.wak()
is.wei()
is.gpa()
is.TLgld()
is.TLgpa()
list is not "gum". The parameter validation functions internally call the distribution type
tests by is.XXX() and check whether values of the parameters meet distribution-specific
constraints.
168
J
The followup to example 74 is 75 that shows use of the is.glo() function for a
Generalized Logistic distribution that is fit to the sample L-moments by the parglo()
function. The example does not verify whether the parameters are consistent with the
indicated distributionthey would be in the example because the parglo() function
returns valid parameters for the distribution for the sample data provided.
75
169
Table 7.6. Summary of high-level conversion functions provided by the lmomco package by
Asquith (2011)
Function name
vec2lmom()
lmom2vec()
vec2par()
par2vec()
vec2pwm()
pwm2vec()
par2lmom()
lmom2par()
par2pdf()
par2cdf()
par2qua()
are.lmom.valid()
are.par.valid()
Action
Convert vector to L-moments
Convert L-moments to a vector
Convert vector to parameters
Convert parameters to a vector
Convert vector to probability-weighted moments
Convert probability-weighted moments to a vector
Convert parameters to L-moments
Convert L-moments to parameters
Convert parameters to the PDF
Convert parameters to the CDF
Convert parameters to the QDF
Check theoretical bounds of L-moments
Check parameters consistency for indicated distribution
76
J
Example 77 demonstrates the utility of the lmomco parameter list. Using the given
L-moments set by the vec2lmom() function into lmr, the parameters for Generalized
Extreme Value, Gumbel, and Weibull distributions are computed, and 400 random values produced from each distribution. The empirical distribution of each distribution is
developed by the plotting positions (pp() function) and the sort()ing of the values.
The example completes by plotting the distributions. The three empirical distributions
(Generalized Extreme Value, thin line; Gumbel, dashed line; and Weibull, thick line) are
shown in figure 7.1.
170
Table 7.7. Summary high-level distribution functions of lmomco package by Asquith (2011) that
mimic the nomenclature of R
Function name
dlmomco()
plmomco()
hlmomco()
qlmomco()
rlmomco()
Action
Probability density functions (see Section 2.1.1)
Cumulative probability functions (see Section 2.1.2)
Hazard functions (see Section 2.1.3)
Quantile distribution functions (see Section 2.1.4)
Random variates (random values)
77
The basic algorithm in example 77 is simple and syntactically parallelonly the argument type to the lmom2par() function requires adjustment to change to another distribution. The dashed line of the Gumbel distribution is specified by the lty=2 (line type)
argument to lines(), and the thick line of the Weibull is specified by the lwd=3 (line
width) argument.
tions are fit by the method of L-moments and specifically fit to the sample L-moments
1
(L-scale).
(mean) and
2
171
0
1000
500
QUANTILE
500
1000
0.0
0.2
0.4
0.6
0.8
1.0
NONEXCEEDANCE PROBABILITY
Figure 7.1. Example of three distributions, Generalized Extreme Value (thin line), Gumbel (dashed
line), and Weibull (thick line) fit to the identical L-moments from example 77
For most one- and two-parameter distributions, the first parameter is known as the
location parameter and the second parameter, if present, is known as the scale parameter.
Following the lead of J.R.M. Hosking in his written works (see the References section that
begins on page 402) and his FORTRAN library (Hosking, 1996b), lmomco implements the
scale parameter as a true scalemeaning that the scale parameter has the same units as the
location parameter. This philosophy is applied to scale parameters for distributions having
three or more parameters. The author agrees with this philosophy and explicitly does not
support in package-level code the inversion of scale parameters to rate parameters as R
doesthe Gamma distribution as implemented by R is an example.3
Occasionally, a two-parameter distribution can be reformulated as a one parameter if
the location parameter simply provides a translation on the real-number line Rsuch a
3
The author historically has found the inconsistency of presentation of scale or rate parameters
in distributions amongst various literature or software sources confusing. A likely source of the
confusion is a background in a discipline (civil engineering and geosciences) that does not typically
involve survival analysis. For survival analysis, the rate of events or death seems to be the more
natural perspective/interpretation of distribution dispersion.
172
distribution is the Exponential distribution, use help(rexp) for the rexp function for
details. Some distributions, such as the two-parameter Gamma distribution, lack a location
parameter, but have the addition of a shape parameter along with the scale parameter.
Distributions with three or more parameters as a rule have at least one shape parameter
and are covered in later chapters.
DISTRIBUTION FUNCTIONS
The distribution functions of the Normal having parameters (mean, location) and
(standard deviation, scale, > 0) are
(7.1)
(7.2)
(x) =
exp(x2 /2)
2
Z
(7.3)
(x) =
(x) dt
173
(7.4)
1 =
(7.5)
2 = 1/2
(7.6)
3 = 0 (symmetrical)
4 = 30 1 arctan( 2) 9 = 0.1226
(7.7)
(7.8)
= 1
(7.9)
= 2
(7.10)
Finally, the CDF and QDF of the standard Normal distribution can be respectively approximated (Stedinger and others, 1993, chap. 18, p. 11) by
(83z + 351)z + 562
F (z) = 1 0.5 exp
for 0 < z 5
703/z + 165
(7.11)
(7.12)
and
Readers are encouraged to compare eq. (7.12) to the QDF of the Generalized Lambda
distribution in eq. (9.13) and see that eq. (7.12) is in the form of a Generalized Lambda.
A Normal distribution having = 0 and = 1 is known as the standard Normal
distribution. Finally, the log-Normal distribution is a Normal fit to the logarithms of a
random variable.
Using R
Using R
) as distinct
An investigation of the bias of
compared to the bias of the product (
2
estimators of when the parent is Normal follows. In example 78 , a NOR( = 10000,
= 6000) is specified. The vectors e1 and e2 will record the individual biases (errors) of
each simulated valuethe difference between the estimate and true value . As commonly
done in this dissertation, the rnorm() function is used to generate simulated data. The
is
computed through eq. (4.19) and saved by simsig <-sd(sim.dat), and 2 is computed
by the lmoms() function. The example ends with a report of the results.
174
mu <- 10000; sig <- 6000; n <- 20; nsim <- 10000
e1 <- vector(mode = "numeric"); e2 <- e1
for(i in seq(1,nsim)) {
fake.dat <- rnorm(n, mean=mu, sd=sig)
sim.sig <- sd(fake.dat) # usual standard deviation
lmr <- lmoms(fake.dat); siml2 <- lmr$lambdas[2]
e1[i] <- sig - sim.sig; e2[i] <- sig - sqrt(pi)*siml2
}
round(mean(e1),2),
cat(c("BIAS SD=",
" BIAS SD.via.L2=", round(mean(e2),2), "\n"))
BIAS SD= 57.09
BIAS SD.via.L2= -23.36
has less bias (|23.36| < |57.09|) than the familThis particular example shows that
2
iar
for a NOR(10000, 6000) with a small sample size of 20. The numerical results will
vary and the sign on the estimated L-moment bias might change from time to time, but
the conclusion will generally remain the same for this sample size (n = 20). The use of
L-moments as potential drop-in-replacements for the product moments is partly demonstrated. Simply stated, the biases reported in example 78 show that on average for
sample of n = 20. However, 2 will not always be a preferable estimator of for other
distributions such as for the Gamma distribution.
(storms), cosmic rays, customers, and wear out of parts. The Exponential as implemented
by lmomco is a two-parameter version, whereas, the built-in version to R has one parameter.
DISTRIBUTION FUNCTIONS
The distribution functions of the Exponential having parameters (location, lower
bounds) and (scale, > 0) are
f (x) = 1 exp(Y )
(7.13)
F (x) = 1 exp(Y )
(7.14)
x(F ) = log(1 F )
(7.15)
Y = (x )/
(7.16)
where
1 = +
(7.17)
2 = /2
(7.18)
3 = 1/3
(7.19)
4 = 1/6
(7.20)
= 1
(7.21)
= 22
(7.22)
= 1
(7.23)
176
(7.24)
where is a shape parameter. This distribution is also the survival function of the Weibull
distribution and hence separate implementation in R is not needed.
Using R
Using R
The single example 78 for the Normal distribution was comparatively complex. The
code in that example is substantially simplified for the Exponential distribution to demonstrate the parXXX(), lmomXXX(), quaXXX(), and cdfXXX() functions using the Exponential distribution. (A demonstration of the pdfXXX() functions is shown for the Cauchy
distribution in example 717 on page 184.)
The Exponential distribution is fit to some data in example 79 by the parexp()
function. The returned lmomco parameter list (see page 163 and ex. 71 ) is labeled as
PARexp. This list obviously is displayed by the print() function, and the output is
fake.dat <- c(1542, 1291, 578, 860, 968, 405, 326, 493, 829, 423)
lmr <- lmoms(fake.dat); PARexp <- parexp(lmr)
print(PARexp) # print the lmomco parameter list
$type
[1] "exp"
$para
xi
alpha
299.8778 471.6222
$source
[1] "parexp"
J
The L-moments of the fitted Exponential from example 79 , or more generally any
parameterized Exponential, are readily computed by the lmomexp() function as shown in
example 710 . The example also compares the fitted L-moments to the sample L-moments
of the data. The cat() function and respective ensembles of output provide for a comparison between the L-momentsthe ensembles are the same only through the second
exp
L-moment (1 =771.5, 2 =235.8) and not for higher orders (3 =0.249, 3 =0.333).
710
177
cat(c(LMRexp$lambdas[1], LMRexp$lambdas[2],
LMRexp$ratios[3], LMRexp$ratios[4],"\n"))
771.5 235.811111111111 0.333333333333333 0.166666666666667
and 69 ).
The lack of rounding of the results shown in example 710 is unsightly. The output in
example 711 is cleaner for the contents of the lmr variable originating from example 79 .
The sapply() and round() functions are used. The output is rounded to three digits
by digits=3. The example shows how features of R can be used in compact and nested
operations.
711
sapply(c(lmr$lambdas[1:2],
lmr$ratios[3:4]), round, digits=3)
[1] 771.500 235.811
0.249
0.053
J
The distribution functions of the Exponential are readily accessible. Assuming that the
parameters from examples 79 and 710 are available, the median of the distribution
(F =0.5) and the equivalent F value for 999 units of x are computed, respectively, by
example 712 . The x0.50 is about 599 and F (999) = 0.79.
712
J
The R environment has built-in functions for the Exponential distribution. For example, the QDF of the distribution is qexp(). The R implementation of the Exponential
lacks the location parameter, which is provided by the lmomco package. A comparison of
178
The two values are identical as anticipated. The quaexp() function provides more
parallel syntax to other distributions within the lmomco package. The lmomco package
provides more flexibility by implementing a two-parameter version of the Exponential
distribution instead of a one-parameter version as is standard with R. The personal preference of the analyst obviously influences the choice of function to use.
DISTRIBUTION FUNCTIONS
The distribution functions of the Gamma having parameters (shape, > 0) and
179
(x/)1 exp(x/)
()
Z x
1
F (x) =
t1 exp(t/) dF
() 0
f (x) =
(7.25)
(7.26)
1 =
(7.27)
(7.28)
and the higher order L-moments are complex. Hosking (1996b) provides an algorithm
using rational-function approximations for 3 and 4 . The parameters in terms of the
L-moments are complex. Hosking (1996b) provides minimax approximations for parameter estimation from the L-moments.
The mode statistic is the most frequently occurring value, and in continuous variables,
the mode is the peak of the PDF. The mode of the distribution is Modegam = ( 1) for
1. If < 1, then the PDF of the Gamma acquires a decaying shape towards the right
in a similar fashion as the Exponential distribution. The mode can be used for parameter
estimation if the mode of the distribution is known or otherwise needs to be locked-in at a
given position. This application of the mode is of interest in use of the Gamma distribution
for streamflow hydrograph modeling in which the peak streamflow corresponds to the
mode of the distribution (Asquith and Roussel, 2007, appendix 4).
Unlike those for the L-moments, the relations between the product moments and the
parameters are more straightforward and are
= /
(7.29)
= 2 /
(7.30)
Using R
Using R
The Gamma distribution is demonstrated using some L-moments derived from a previous study. The L-moments listed in table 7.8 are derived from Asquith and others (2006)
180
and represent the first three L-moments of storm depth (depth of rainfall). Rainfall depth is
a strictly positive phenomena and as a result positive skewness generally is present. These
L-moments are based on real valuesthat is, not log10 -transformed valuestherefore
application of a log-Normal distribution is not immediately feasible. However, the Gamma
distribution has a zero lower bounds.
Table 7.8. L-moments of storm depth for storms defined by a minimum interevent time of 72 hours
in Texas derived from Asquith and others (2006, table 5)
(inches)
1
0.964
2
0.581
3
0.452
Continuing the discussion with the code in example 714 , the L-moments are set by
the vec2lmom() function with the lscale=TRUE option being set because 2 is provided and not 2 as in virtually all other examples herein. The pargam() function estimates the Gamma distribution parameters from the L-moments, and the parameters are
shown by the str() function. The QDF of the distribution for selected F values from
the nonexceeds() function is generated by quagam(). The resulting plot is shown
gam
181
4
0
quagam(F, PARgam)
0.0
0.2
0.4
0.6
0.8
1.0
Figure 7.2. Quantile function of the Gamma distribution with = 0.633 and = 1.46 from
example 714
For the example, knowledgeable analysts might argue that an Exponential distribution
should be considered because the Exponential, like the Gamma distribution, also has
a lower bounds of zero. The lmomco package permits a quick comparison as shown in
example 715 .
715
The 3
= 0.333 of the Exponential is much less than 3 = 0.452 of storm depth and
gam
much further from the 3 = 0.407 of the fitted Gamma distribution. An immediate conclusion is that the Gamma distribution would be preferred for these sample L-moments
and
are both fit when a Gamma is used, and
because
3
1
2
gam
exp
The R environment has a built-in function named qgamma() for the quantiles of the
Gamma distribution and the quagam() function uses this function. To demonstrate that
182
the functions are the same, the median of the example distribution is computed in example 716 in which the Gamma parameters in PARgam come from example 715 .
716
# Native R code
qgamma(0.5, shape=PARgam$para[1], scale=PARgam$para[2])
[1] 0.5424176
# Using package lmomco
quagam(.5,PARgam)
[1] 0.5424176
When comparing the appearance of the calls to the QDF of the Gamma using the built-in
R and lmomco styles, the author argues that the parameter list structure of lmomco provides
a generally cleaner interfaceas does the style used by the lmom package as wellbut
other factors certainly influence opinion. A feature of R is that it provides freedom of
DISTRIBUTION FUNCTIONS
The distribution functions of the Cauchy having parameters (location) and (scale,
> 0) are
"
f (x) =
1 +
2 #!1
arctan[(x )/]
+ 0.5
(7.31)
(7.32)
(7.33)
1 =
(7.34)
(1)
2 = 0.698
(1)
3 = 0 (symmetrical)
(1)
4 = 0.343
(7.35)
(7.36)
(7.37)
= 1
(1)
= 2 /0.698
(7.38)
(7.39)
Although the usual L-moments do not exist, the Cauchy distribution is the limiting
point {3 0, 4 1} (Hosking, 2007b) on the L-moment ratio diagram of 3 and 4 (see
Chapter 10).
Using R
Using R
The properties of the Cauchy distribution and some features of lmomco are now
explored. In example 717 , a Cauchy is specified using the vec2par() function. The
commonly used (in this dissertation) nonexceeds() function returns a list of selected F
values. The par2qua() function is used to convert the parameters into the quantiles of
the distribution. For the example, the quacau() function could have been used instead
because the par2qua() function simply dispatches to the quacau() function. The PDF
of the distribution is created with the pdfcau() function and is shown in figure 7.3.
717
J
The L-moments of the Cauchy distribution do not exist because the extreme order
statistics (minimum and maximum or X1:n and Xn:n ) of the distribution are both infinite. However if these are trimmed, then the TL-moments can be computed. The largest
and smallest values in other words must be discarded for moments to exist. However,
an attempt is made to compute usual L-moments theoretically using the theoLmoms()
184
0.0000
0.0005
f(x)
0.0010
0.0015
30000
20000
10000
10000
20000
30000
J
The code in example 718 fails because of infinite extrema of the Cauchy distribution.
Instead, the theoTLmoms() function is used in example 719 with symmetrical t = 1
trimming (trim=1) and three TL-moments on the return (nmom=4). The TL-moments are
then shown by the str() function. Because the Cauchy is symmetrical, it is seen that
(1)
3(1) = 0. The theoretical integration shows that (1)
1 = 100 and 2 = 140, which by
(1)
eq. (7.35) should be 2 = 0.698 100 = 139.6.
719
185
4.78e+01
$
$
$
$
$
ratios :
trim
:
leftrim :
rightrim:
source :
num [1:4]
NA
num 1
NULL
NULL
chr "theoTLmoms"
1.40e+00 -6.79e-17
3.43e-01
J
The ability for independent L-moment (or TL-moment) computation given a parameterized distribution is a feature of lmomcothe package has functions such as theoLmoms()
and theoTLmoms() primarily for the purpose of permitting users to cross check the
lmomXXX() (L-moments of distribution) functions. A check on the output of the function
theoTLmoms() can be made by the lmomcau() function in example 720 and similarly
lmomcau(cau)
$lambdas
[1] 100.0000 139.6000
0.0000
$ratios
[1] 0.000 1.396 0.000 0.343
$trim
[1] 1
$source
[1] "lmomcau"
47.8828
186
must be estimated for a region.4 Clarke and Terrazas (1990) consider L-moments and the
Gumbel for flood-flow regionalization of the Rio Uruguai. The three-parameter Generalized Extreme Value generally is now preferred over the Gumbel because the Gumbel
distribution is a special case of the Generalized Extreme Value. Specifically, the Gumbel
is not fit to the skewness of the data. Because the L-moments are such useful statistics for
computation of distribution skewness, the preference for the Generalized Extreme Value
is justified.
DISTRIBUTION FUNCTIONS
The distribution functions of the Gumbel having parameters (location) and (scale,
> 0) are
f (x) = 1 exp(Y ) exp[ exp(Y )]
(7.40)
(7.41)
(7.42)
where
Y = (x )/
(7.43)
1 = +
(7.44)
2 = log(2)
(7.45)
(7.46)
(7.47)
= 2 / log(2)
(7.48)
= 1
(7.49)
Thompson and others (2007) use the lmomco package for their L-moment computations. This
paper provides the first known citation of lmomco.
4
187
Using R
Using R
Hershfield (1961) provides a venerable, but still authoritative, reference for the depthduration frequency of rainfall in the United States. (Depth-duration frequency of rainfall
also is considered in Section 11.1.) The Gumbel distribution was used by Hershfield in the
regional study along with presumably considerable smoothing of contour lines of equal
depth. The data listed in example 721 represent the 24-hour storm depths in inches
having the respective annual recurrence intervals estimated by the author (Asquith) for
the southern tip of Lake Michigan near the Illinois and Indiana border. An equivalent
Gumbel distribution to these data is estimatedemphasis is needed that the data do not
represent a random sample. Therefore, special processing is needed.
721
P <- c(2.8, 3.5, 4.0, 4.6, 5.2, 5.6) # precipitation data, inches
T <- c(2, 5, 10, 25, 50, 100) # recurrence interval, years
F <- T2prob(T) # re-express in nonexceedance probability
# custom quantile function of Gumbel, with no check on parameters
"myquagum" <- function(f, para) {
return(para[1] - para[2] * log(-log(f)))
}
# objective function to minimize
"afunc" <- function(x, RHS=NULL, F=NULL) {
return(sum((RHS - myquagum(F,x))^2))
}
# perform non-linear optimization
result <- optim(c(4,2), fn=afunc, RHS=P, F=F)
PAR <- vec2par(result$par, type="gum") # extraction of parameters
#pdf("tp40gum.pdf")
plot(F,quagum(F,PAR), type="l",
xlab="NONEXCEEDANCE PROBABILITY",
ylab="RAINFALL DEPTH, INCHES")
points(F,P)
#dev.off()
In the example, a custom QDF of the Gumbel distribution is created. This is done so that
a currently (2011) hardwired parameter validation component of the quagum() function
conducted by the are.pargum.valid() function is bypassed. The objective function
afunc() returns the sum of square error for the x(F ) values in P for the desired F
in F. The optim() function is used with initial starting parameter values of GUM(4, 2),
188
5.5
4.0
4.5
3.5
3.0
5.0
0.5
0.6
0.7
0.8
0.9
1.0
NONEXCEEDANCE PROBABILITY
Figure 7.4. Gumbel distribution fit by non-linear optimization to data available from Hershfield
(1961) from example 721
which were chosen by inspection of the values in P. The optimization converges by least
squares, and the results (solid line) are shown in figure 7.4. The figure shows remarkably
good agreement with the data points (open circles). Thus, example 721 shows how a
distribution can be fit in a posterior manner to historical data or fit to selected information
As another example with the Gumbel distribution, an alternative method for fitting
distributions, which has not previously been described in this dissertation, is usedthe
method of percentiles (Gilchrist, 2000, p. 34). (Karian and Dudewicz (2000) provide
an extensive discussion on the method in the context of the Generalized Lambda distribution.) The method estimates the distribution parameters such that specific quantiles are achieved. A different quantile is needed for each parameter in the distribution.
For the Gumbel, two quantiles are needed. For demonstration, suppose that the sample
x0.50 = 8,000 (median) and x0.90 = 17,000 (90th percentile) are available and a Gumbel
fit to these values is needed. Using eq. (7.42), one can write
189
(7.50)
(7.51)
(7.52)
= 4777
(7.53)
(7.54)
This solution by the method of percentiles is shown in figure 7.5, which was created by
example 722 . The example is unusual here in that F 0 (exceedance probability) is used
instead of F on the horizontal axis. The x
0.50 (on right) and x0.90 (on left) values are plotted
as squares to show that GUM(6249, 4777) passes through the two points as the method
of percentiles forced.
722
190
(7.55)
20000
0
10000
QUANTILE
30000
0.0
0.2
0.4
0.6
0.8
1.0
EXCEEDANCE PROBABILITY
Figure 7.5. Gumbel distribution fit by method of percentiles from example 722
The distribution is useful in analysis of right-tail censored (type I and type II censoring, see Section 12.2) data. The distribution is the distribution of a log-transformed twoparameter Weibull distribution, which finds a place in distributional analysis of lifetime
or reliability studies. To use the Reverse Gumbel distribution in the lmomco package, a
right-tail censoring fraction is needed because support for right-tail censoring is available. The censoring fraction could be estimated as the number of observed (noncensored)
values m divided by the sample size n or
= m/n
(7.56)
The parameter is not explicitly another parameter of the distribution in the sense
that it only indirectly controls the geometry of the fitted distribution. If = 1, then a
Reverse Gumbel distribution is fit without right censoring and the usual L-moments are
used. When < 1, then the B-type L-moments, through the B-type probability-weighted
moments, are used. Both of these B-type moments are described in Section 12.2.
191
DISTRIBUTION FUNCTIONS
The distribution functions of the Reverse Gumbel having parameters (location),
(7.57)
(7.58)
(7.59)
where
Y = (x )/
(7.60)
B
1 = 1
B
2 = [log(2) + 2 1 ]
(7.61)
(7.62)
where
1 = Ei[ log(1 )]
(7.63)
2 = Ei[2 log(1 )]
(7.64)
and
Z
Ei(x) =
t1 exp(t) dt
(7.65)
is the exponential integral as defined by Hosking (1995, p. 558, A.9). Jeffrey (2004, p. 168)
provides more details concerning the exponential integral.
The parameters of the distribution are
B
2
log(2) + 2 1
= B
1 + ( + 1 )
Using R
(7.66)
(7.67)
Using R
The lmomco package supports the Gumbel and Reverse Gumbel as separate distributions. Using the Reflection Rule (see page 36), the two distributions are now explored.
192
Example 723 begins the exploration, which will be based on simulated data from a
Gumbel parent. A sample size of n = 1,000 is drawn from a Gumbel distribution, using
rlmomco(), into variable X. The Gumbel has L-moments 1 = 400 and 2 = 1200, and
pargum() computes the parameters. The Cunnane plotting positions are computed by
pp(X, a=0.40).
723
nsim
lmr
X
PP
<<<<-
1000
vec2lmom(c(400,1200))
rlmomco(nsim, pargum(lmr))
pp(X, a=0.40)
Continuing in example 724 , for the random sample X, the first five L-moments are
computed by lmoms(X), and the L-moments also are computed for the negated sample
by lmoms(-X). Finally, four different lmomco parameter lists (see page 163 and ex. 71 )
are computedtwo lists for the Gumbel and two lists for the Reverse Gumbel.
724
lmr
<- lmoms(X) # L-moments of Gumbel
neglmr <- lmoms(-X) # L-moments of -X
PARgumC
PARgumD
<- pargum(lmr)
<- pargum(neglmr)
# Parameters of Gumbel
# Parameters of Gumbel
#pdf("revgum.pdf")
plot(PP, sort(X), type="n",
xlab="NONEXCEEDANCE PROBABILITY",
ylab="QUANTILE", ylim=c(-5000,15000))
lines(PP, quagum(PP,PARgumC), col=2, lwd=5) # red and thick
# Curve mimics the parent if nsim is large enough
lines(PP, quagum(PP,PARgumD))
# Thin black curve is Gumbel fit to negated values. The mean
# is reduced, L-scale is not. Curve plots under previous. Both
193
theoLmoms(PARgumC);
theoLmoms(PARgumD)
theoLmoms(PARrevgumC); theoLmoms(PARrevgumD)
Table 7.9. Comparison of computed L-moments for four Gumbel distribution parameter lists from
example 726
Function theoLmoms()
PARgumC
PARgumD
PARrevgumC
PARrevgumD
1
502.5
502.5
502.5
502.5
2
1264
1264
1264
1264
3
0.1699
.1699
.1699
.1699
4
0.1504
.1504
.1504
.1504
5
0.0559
.0559
.0559
.0559
J
194
5000
5000
QUANTILE
10000
15000
0.0
0.2
0.4
0.6
0.8
1.0
NONEXCEEDANCE PROBABILITY
Figure 7.6. Comparison five Gumbel-like distributions as sequentially described in example 725
For another example of the Reverse Gumbel, Hosking (1995, p. 558) reports that the
Reverse Gumbel is the distribution of log X when X has a two-parameter Weibull distribution. The two-parameter Weibull is a three-parameter Weibull with a lower bounds of
zero. This statement is evaluated using computational tools provided by R and the lmomco
package in example 727 .
727
195
ing so that the user can watch the results in a poor sort of animation. Alternatively, the
user could bound the code with a pdf() function at at beginning and dev.off() and
the end and then page through the resulting portable document format (PDF) file.
DISTRIBUTION FUNCTIONS
The distribution functions of the Kumaraswamy having parameters (scale, > 0)
and (scale, > 0) are
f (x) = x1 (1 x )1
(7.68)
F (x) = 1 (1 x )
(7.69)
(7.70)
196
1 = B(, )
(7.71)
(7.72)
3 =
(7.73)
(7.74)
(7.75)
where B(a, b) is the beta function that is shown in eq. (3.10). Readers are encouraged to
compare this system of equations5 for the L-moments to those for first five L-moments
in terms of probability-weighted moments on page 121. The parameters can be solved
numerically by minimizing the combined Pythagorean distance between the combined
square errors (3 3 )2 and (4 4 )2 . This technique is implemented for the parkur()
function, which uses the optim() function of R for minimization.
The mode ( > 1, > 1) and antimode ( < 1, < 1) are
kur
Mode/Antimode
=
1
1
1/
(7.76)
and finally, the Kumaraswamy distribution for = = 1 becomes the Uniform distribution.
Using R
Using R
An example conversion of L-moments (1 = 0.7, 2 = 0.2) to Kumaraswamy parameters and back again with the lmorph() function being used to shorten the output is
shown in example 728 .
728
lmorph(lmomkur(parkur(vec2lmom(c(0.7, 0.2)))))$lambdas[1:2]
[1] 0.7 0.2
The purpose of the example is to demonstrate how these four functions of lmomco can
be chained together and more importantly how the numerical methods of the parkur()
function can be tested because the values 1 = 0.7 and 2 = 0.2 are recovered.
The author derived the relation for 5 for this dissertation; whereas, Jones (2009) is the source for
the others. However, the derivation is not too difficult given the established pattern (see eq. (6.37)).
5
197
For the Kumaraswamy, Jones (2009, figs. 2 and 4) provides contour plots of 3 and 4
based on natural logarithm values for and . Example 729 reproduces these two plots
using the contourplot() of the lattice package. The two plots are respectively shown
in figure 7.7.
729
Inspection of figure 7.7 for = = 1 (natural logarithms result in zero on each axis)
shows 3 = 0 and 4 = 0, which is consistent with the Uniform distribution, which is
198
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
.1
0.0
LOG OF BETA
.2
0
0.3
0.4
0.5
0.6
0.7
0.8
LOG OF ALPHA
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
LOG OF BETA
0.
0
0.1
0.2
0.3
0.4
2
0.5
0.6
0.7
2
LOG OF ALPHA
Figure 7.7. Relation between Kumaraswamy distribution parameters and L-skew and L-kurtosis
from example 729
199
uniformly distributed between 0 and 2 (Raju and Srinivasan, 2002, p. 872). Hosking
(1986, p. 65) provides the L-moments of the Rayleigh. Like the other two-parameter distributions of this chapter, the Rayleigh is not fit to the skewness or higher measures of the
shape of the data.
DISTRIBUTION FUNCTIONS
The distribution functions of the Rayleigh having parameters (location) and (scale,
> 0) are
(x ) exp(Y )
2
F (x) = 1 exp(Y )
p
x(F ) = + 22 log(1 F )
f (x) =
(7.77)
(7.78)
(7.79)
where
(x )2
22
The range of the distribution is 0 < x < .
Y =
(7.80)
p
1 = + /2
2 = 21 ( 2 1)
(7.81)
(7.82)
p
1/2 0.2929 for = 0
1 3/ 2 + 2/ 3
3 =
0.1140
1 1/ 2
1 6/ 2 + 10/ 3 5 4
4 =
0.1054
1 1/ 2
2 = 1
= p1
/2
200
(7.83)
(7.84)
(7.85)
(7.86)
2
= 2
( 2 1)
p
= 1 /2
(7.87)
(7.88)
Moderay =
(7.89)
which, like discussed for the Gamma distribution, can be used for parameter estimation
if the mode of the distribution is known or otherwise needs to be locked-in at a given
position. This application is of interest in use of the Rayleigh distribution in streamflow
hydrograph modeling in which the peak streamflow corresponds to the mode of the
distribution.
Using R
Using R
Using L-moments from example 714 , Rayleigh distributions as one- and two-parameter
versions are fit in example 730 . The PDFs of the two distributions are shown in figure 7.8.
The figure shows that the general shape of the two distributions are similar, but that the
location and shape vary when is specified.
730
J
For a final example, suppose that streamflow hydrograph models having one unit of
depth of runoff from a 36 square-mile watershed need to be created. The Gamma and
Rayleigh distributions are chosen because each can attain shapes similar to observed
streamflow hydrographs. Generally, streamflow hydrographs have a steep rising tail and
drawn-out receding tail. The two distributions are readily fit to the time of peak or the
mode of the distribution. Suppose also that this watershed generally peaks in about
5 hours from the inception of rainfall. The two distributions are fit and plotted next.
For a = 0 Rayleigh distribution, the parameter ray = Mode, so ray = 5 for the
problem at hand. The parameters of the Gamma now require estimation. Observing that
201
probability density
2.0
2.5
probability density
0.0
0.5
1.0
1.5
x
Figure 7.8. Comparison two Rayleigh distributions fit as one- or two-parameter versions to Lmoments of 1 = 0.964 and 2 = 0.581 for unknown (top) and known ( = 0, bottom)
lower bounds from example 730
the parameters of the Gamma in terms of the mode and mean 1 are
(7.90)
gam = 1 /Mode
(7.91)
all that is required therefore to fit the Gamma is the 1 of the Rayleigh fit that is computed
by the lmomray() function using the parameters of the Rayleigh. These computations
are made in example 731 . The PDFs of the two distributions are shown in figure 7.9.
731
themode
PARray
LMRray
mu
<<<<-
202
PARgam
0.10
0.05
0.00
0.15
#pdf("rayleighB.pdf")
plot( x, pdfray(x,PARray), type="l", ylim=c(min(y),max(y)),
xlab="TIME, IN HOURS",
ylab="UNITS OF WATERSHED DEPTH PER HOUR") # Rayleigh dist.
lines(x, pdfgam(x,PARgam), lty=2) # Gamma distribution (dashed)
#dev.off()
10
15
TIME, IN HOURS
Figure 7.9. Comparison two Rayleigh distributions (solid line) and Gamma distribution (dashed
line) fit to a time to peak (mode) of 5 hours from example 731
Although both streamflow hydrographs have unit volume (unit area under a PDF), the
figure shows that Gamma has a larger peak or mode (about 50 percent more) than the
Rayleigh. This difference comes by a contraction in general width of the Gamma hydrograph relative to the Rayleigh. The rising limbs of the hydrographs (< Mode) have dif203
ferent first derivative behavior. The Gamma has a rising limb inflection point and the
DISTRIBUTION FUNCTIONS
The distribution functions of the Rice having parameters (location, 0) and (scale,
> 0) are
204
2
x
x
x + 2
f (x) = 2 exp
I0
2
2
2
x
F (x) = 1 Q1
,
(7.92)
(7.93)
SNR = / =
(7.94)
For the PDF definition, where the function I0 (z) is the modified Bessel function of the
first kind for a real number z , which is defined in integral form as
1
Iv (z) =
(7.95)
Iv (z) = (z/2)
X
k=0
Hence, I0 (z) is
1
I0 (z) =
or
(z 2 /4)k
(k + 1)(v + k + 1)
(7.96)
(7.97)
X
(z 2 /4)k
I0 (z) =
(k + 1)2
k=0
(7.98)
QM (a, b) =
1
aM 1
(7.99)
Want an interesting tour through the mathematics of the signal processing and radar detection
field? Google Marcum Q function.
205
(7.100)
where Ik (z) is the Bessel function. For the Rice distribution, M = 1, which results in
2
k
X
a
k=0
Ik (ab)
(7.101)
The product moments (mean and variance) of the Rice distribution require the Laguerre
polynomial given by
(7.102)
p
/2L1/2 (z 2 /2) z as z becomes large. Using the Laguerre
p
/2 L1/2 ( 21 (/)2 )
(7.103)
2 = 22 + 2 2 (/2)L21/2 ( 21 (/)2 )
(7.104)
These two equations clearly are complex. For instance, two Bessel functions are involved
but notice the square of the / term or SNR that occurs in both the definitions of mean
and variance. A key to working with the Rice distribution is understanding of the influence
of / on the moments.
The L-moments of the Rice distribution are difficult to express. However, the recognition that 2 can be interpreted as a signal-to-noise ratio provides a key2 should be
proportional to SNR. The relations between 2 and functions based on the SNR can provide for parameter estimation by the method of L-moments. It was discovered by thought
and numerical experimentation for this dissertation that
/ = SNR = = F(2 )
(7.105)
where F(2 ) is an unknown function that is uniquely a function of 2 . If the quantity L05
is defined as
L05 =
p
/2 L1/2 ( 12 2 )
206
(7.106)
it was discovered again by thought and numerical experimentation for this dissertation
that
L05 = G(2 )
(7.107)
where G(2 ) is an unknown function, which also is uniquely a function of 2 . The parameter can be estimated using from eq. (7.103) by
= G(2 )
(7.108)
= F(2 )
(7.109)
F(2 ) and G(2 ) are needed. The direct application of linear interpolation through lookup
tables is used by the lmomco package.
Using R
Using R
207
The cdfrice() function in the lmomco package uses the integrate() function of R
on pdfrice() instead of the Marcum Q function to mitigate for potential complexities
in using the mathematics of examples 732 and 733 . However for illustration, example 734 provides for the Rice CDF using the Q1 (a, b) function of example 732 .
734
Finally, example 735 creates in figure 7.10 a graphical check on equivalency between
the integration of the pdfrice() and the CDF definition using the Marcum Q function.
735
208
0.020
0.010
0.000
PROBABILITY DENSITY
#pdf("riceA.pdf")
layout(matrix(1:2, byrow=TRUE))
plot(x, testpdf, type="l", ylab="PROBABILITY DENSITY") # top plot
plot(x, cdfrice.by.MarcumQ1(x, para=PARrice),
lwd=4, lty=3, type="l", ylab="CUMULATIVE PROBABILITY") #
dots
lines(x,cdfrice(x, para=PARrice)) # line on bottom plot
#dev.off()
20
40
60
80
100
60
80
100
0.8
0.4
0.0
CUMULATIVE PROBABILITY
20
40
x
Figure 7.10. Example PDF and two computations of CDF of a RICE(20, 40) distribution from
example 735
J
The Laguerre polynomial of eq. (7.102) is implemented by the LaguerreHalf() function of lmomco. This function is used in example 736 . The example shows similar results
for computed and simulated (999 simulations) of RICE(20, 40) random variables.
736
209
J
The final example in 737 for the Rice distribution provides an extensive comparison
of the shapes of the CDF and uses the several of the Rican functions of lmomco including
lmomrice(), cdfrice(), and quarice() for a range of SNR from near that of the
Rayleigh distribution (SNR 1) to the Normal distribution (SNR 1). The example
creates figure 7.11. Detailed discussion of the figure is required.
737
The Rice distributions in figure 7.11, albeit none all are fully drawn because of axis
limits, are extremely varied. The minimum SNR is so low that Rice Rayleigh and thus
2 0.2929; as a result, the Rayleigh distribution is drawn on the far right (the thin dashdot line). The solid lines represent true Rice distributions; whereas the two dashed lines
that also the nearly vertical represent Rice Normal; as a result, Normal distribution
fits using the Rician mean and variance in eqs. (7.103) and (7.104) using the Laguerre
210
polynomial. The single dotted and near vertical lines represent a Normal distribution
with the limiting mean ( = ) and variance ( 2 = 2 ) of the Rice distribution for very
high SNR. Finally, the distribution lines double in thickness when the SNR 1. The
mean and median of the distributions are indicated by open and filled circular symbols,
respectively.
Readers are encouraged to repeat example 737 with more or less expansive horizontal
and vertical axis limits to see the real breadth of Rician fits for an extreme range of SNR.
Readers also are encouraged to change the vertical axis transformation from qnorm() to
10
Rayleigh distribution
Rice distribution
Rice via normal with Laguerre
Rice via normal without Laguerre
Mean
Median
20
50
100
QUANTILE
Figure 7.11. Comparison of CDF for signal = 17 for a range of signal-to-noise (SNR) ratios for
Rice distribution from example 737. The thick lines represent SNR greater than unity. Increasing SNR shifts the curves from right to left, and the curves become near vertical near = 17.
The Rice distribution function of lmomco use the Rayleigh and Normal distributions as
limiting conditions for hard-wired thresholds for SNR that have been determined by the
author using numerical experiments to trap under and overflows. The documentation of
lmomco provides these threshold values.
211
212
0.15
0.20
LKURTOSIS
0.05
0.10
GEV
GLO
GNO
GPA
PE3
NOR
RAY
0.00
0.00
0.05
0.10
0.15
LSKEW
Figure 7.12. L-moment ratio diagram showing 500 simulations of n = 200 samples for a Rice
having = 5 and = 3 from example 738. The large open circle reprsents the pair-wise
means of L-skew and L-kurtosis and large solid circle represents the population values.
The example continues by performing 500 simulations of n = 200 samples for a Rice
having = 5 and = 3. The 3 and 4 of the sample are computed and plotted as the
small thin-lined open circles. The second-to-last line computes the mean values of the
3 and 4 and plots them as the large solid circle, and the example ends by plotting the
population values of 3 and 4 that were computed by the lmomrice() function.
The L-moment ratio diagram in figure 7.12 shows that the numerically computed
population.
213
7.3 Summary
In this chapter, an overview of distributions supported by the lmom and lmomco packages is provided, but the emphasis of presentation obviously is on the lmomco package.
The overview considered both the one- and two-parameter distributions that are the subject of this chapter, but also three-parameter (Chapter 8) and four- and more-parameter
(Chapter 9) distributions were identified. The overview summarized the many functions
of the two packages that provide convenient interaction with distributions or functions
that otherwise generally support distributional analysis.
This chapter continued with presentation of the mathematics and examples for 9 twoparameter distributions. (This presentation structure also is used in Chapters 8 and 9.)
The 38 examples in this chapter vary in size and scope, but collectively show how to estimate parameters using the method of L-moments, compute parameters from L-moments,
and how to use the R functions supporting the PDF, CDF, and QDF of the distributions.
Further, several of the examples demonstrate numerical exploration of sampling bias and
other selected topics.
The example for the Normal distribution investigates the sampling bias of the sample
standard deviation and compares the bias to that from an L-moment-based estimate
of the standard deviation. The biases reported in example 78 show that on aver-
214
The examples for the Gumbel distribution used non-linear optimization for posterior
distribution fit and introduced the method of percentiles for parameter estimation.
The examples for the Reverse Gumbel distribution explore the interrelations between
the Gumbel and Reverse Gumbel distributions through the Reflection Rule (see
page 36).
The first example for the Kumaraswamy distribution shows the conversion of
L-moments to parameters and back again. The second example is used to depict the
{3 , 4 }-parameter space for a wide range of the parameter values. The mapping
reproduces figures previously published in the literature.
The examples for the Rayleigh distribution demonstrate parameter estimation for
both known and unknown location parameter and compare the fits of the distribution and the Gamma distribution to a common mode statistic.
The examples for the Rice distribution are extensive and are used to show the reliability of the lmomco algorithms as these appear, after extensive searching, the first to
implement L-moments for the distribution. The examples verify the numerical integration of the PDF to create the CDF by making comparisons to the definition using
the Marcum Q function. Another example also verifies the quality of QDF, which
is based on root solving the CDF by computation of the mean from simulation compared to the theoretical mean based on the Laguerre polynomial. Another example
provides an extensive comparison of CDF shapes using a wide range of signal-tonoise ratios from less than to more than unity, and the example shows convergence
to the Rayleigh distribution as the signal vanishes and shows convergence to the Normal distribution as the noise vanishes. Finally, an L-moment ratio diagram depicting
the {3 , 4 }-parameter space of the Rice is drawn (see Chapter 10, which does not
encompass the Rice).
215
Chapter 8
L-moments of Three-Parameter Univariate Distributions
8.1 Introduction
The distributions considered in this chapter have three-parameters and thus are fit to the
mean, scale, and skewness (shape) of a sample distribution. As shown in Chapter 6 (see
example 618 ) and in examples in this chapter, most notably those associated with the
Pearson Type III distribution, L-moments can reliably estimate the skewness of a sample distribution through 3 . Because of the general reliability of 3 , the author suggests
that three-parameter distributions should receive considerable attention, and often these
might be preferred over lower-order distributions for magnitude and frequency analyses
for skewed data sets unless mitigating factors or compelling reasons exist.
Some notes about the source of material, in particular, the mathematics of the threeparameter distributions, which are discussed in this chapter, are needed. Unless otherwise stated, the material is heavily based on collective review of Evans and others (2000),
216
Hosking (1996b), Hosking and Wallis (1997), and Stedinger and others (1993). Additional
citations are provided as needed on a distribution-specific basis.
Finally, the chapter concludes with a summary of selected three-parameter distributions
with existing L-moment derivations that are not yet (as of May 2011) implemented within
the lmomco package. These additional distributions are associated with contemporary
research into L-moments, but mostly are presented to show a front line in the continued
development of the lmomco package.
DISTRIBUTION FUNCTIONS
The distribution functions of the Generalized Extreme Value having parameters (location), (scale, > 0), and (shape, > 1) are
where
and
(8.1)
(8.2)
1 log [1 (x )/] if 6= 0
Y =
(x )/
if = 0
(8.3)
+ (1 [ log(F )] )/ if 6= 0
x(F ) =
log[ log(F )]
if = 0
(8.4)
217
< x + / if > 0
(8.5)
< x <
if = 0
(8.6)
+ / x <
if < 0
(8.7)
1 = + [1 (1 + )]/
(8.8)
2 = (1 2 )(1 + )/
(8.9)
3 = 2(1 3 )/(1 2 ) 3
4 =
5(1 4
(8.10)
) 10(1 3 ) + 6(1 2
(1 2 )
)
(8.11)
where (a) is the complete gamma function that is shown in eq. (8.85). No explicit solution
for the parameter in terms of the L-moments is possible and a hybrid of numerical
methods are used by lmomco. The other two parameters are
(1
2 )(1
(8.12)
+ )
= 1 [1 (1 + )]/
(8.13)
Using R
Using R
Table 8.1. L-moments of wind speed data reported by Hosking and Wallis (1997, table 2.5)
Location
Brownsville, Texas
Corpus Christi, Texas
Port Arthur, Texas
(--)
39.8
47.5
48.5
218
6.26
4.87
7.15
0.037
.471
.059
The quantiles show that for the 99th-percentile (F = 0.99) or 100-year recurrence
interval (prob2T(0.99) from lmomco) for Corpus Christi, Texas is estimated to be about
56 and 41 miles per hour more than for Brownsville and Port Arthur, Texas, respectively.
It is unknown whether these differences are reliable and show that Corpus Christi has
higher wind risk than the other two locales or whether the differences exist because of
sampling and uncertainties of the basic form of the parent distribution. Regional analysis
of these sample L-moments and those from other observation points on the Texas Gulf
For another demonstration of the Generalized Extreme Value distribution, a small application is created to read-in a selected file of annual peak streamflow data from the U.S. Geological Survey streamflow-gaging station 08167000 Guadalupe River near Comfort, Texas.
The data resides in file lmomco/inst/testdata/sta08167000.txt. For illustration,
the fit of the Generalized Extreme Value is inverted into equivalent T -year recurrence
intervals to judge the historical context of the data. For the example, an explicit assumption is made that the Generalized Extreme Value is an appropriate distribution for the
problem.
The application begins with example 82 by prompting the user for the file name
using the file.choose() function. The contents of the selected file are read-in by the
read.table() function. The data reside in peak_va, and these are extracted and sorted
219
into the variable Q. The example ends with the computation of the Weibull plotting positions.
82
file
D
Q
Fs
<<<<-
The application is completed in example 84 . This example handles the portable document format (PDF) generation of the output in which two pages will be contained. The
gsub() function is used to strip out the trailing .txt of the file name and replacing it with
.pdf. The two calls to plot() generate the first and second pages of the file pdffile()
(sta08167000.pdf for the example). The abline() function is used to draw a one-toone sloped line on the T -year recurrence interval plot. Readers should note the use of
the prob2T() function to convert nonexceedance probabilities into recurrence intervals.
Finally, the two plots are shown in figures 8.1 and 8.2.
84
220
70
40
50
60
30
10
20
20
40
60
80
100
120
Figure 8.1. Comparison of T-year recurrence interval of individual annual peak streamflow data
points estimated by CDF of Generalized Extreme Value distribution and those from Weibull
plotting positions for U.S. Geological Survey streamflow-gaging station 08167000 Guadalupe
River at Comfort, Texas from example 84 [first plot() call]. The line is one-to-one sloped.
J
150000
100000
50000
0
Figure 8.2. Comparison of empirical distribution of annual peak streamflow data (open circles) and fitted Generalized Extreme Value distribution (solid line) for U.S. Geological Survey
streamflow-gaging station 08167000 Guadalupe River at Comfort, Texas from example 84
[second plot() call]
sive study of five parameter estimation methods for the distribution; the methods include
maximum likelihood, method of moments, method of percentiles, least and weightedleast squares, and method of L-moments.
DISTRIBUTION FUNCTIONS
The distribution functions of the Generalized Logistic having parameters (location),
1 exp[(1 )Y ]
[1 + exp(Y )]2
222
(8.14)
(8.15)
and
1 log[1 (x )/] if 6= 0
Y =
(x )/
if = 0
(8.16)
+ (1 [(1 F )/F ] )/ if 6= 0
x(F ) =
log[(1 F )/F ]
if = 0
(8.17)
< x + / if > 0
(8.18)
< x <
if = 0
(8.19)
+ / x <
if < 0
(8.20)
1 = + [1/ / sin()]
(8.21)
2 = / sin()
(8.22)
3 =
(8.23)
4 = (1 + 52 )/6
(8.24)
4 =
1 + 5(3 )2
6
(8.25)
= 3
=
(8.26)
2 sin()
= 1
(8.27)
sin()
Using R
(8.28)
Using R
Asquith (1998) in a large study of the L-moments and parameters of Generalized Logistic and Generalized Extreme Value distributions for annual maximum rainfall in Texas
223
concludes that the Generalized Logistic distribution is appropriate for rainfall durations
less than 24-hours and the Generalized Extreme Value distribution was appropriate for
larger durations. Parameters of the Generalized Logistic distribution of 1-hour annual
maximum rainfall for Travis County, Texas are listed in table 8.2.
Table 8.2. Parameters and corresponding L-moments of Generalized Logistic distribution for
1-hour annual maximum rainfall for Travis County, Texas derived from Asquith (1998)
1
2
3
4
(inches)
(inches)
1.7
0.35
(--)
0.20
(inches)
(inches)
1.82
0.374
(--)
(--)
0.200
0.200
The CDF and QDF of the fitted Generalized Logistic distribution are produced with
example 85 and are shown in figure 8.3. The variable PARglo stores the lmomco parameter list (see page 163 and ex. 71 ) for the distribution. The quaglo() and cdfglo()
provide the QDF and CDF of the distribution, respectively.
85
J
The corresponding L-moments of the Generalized Logistic parameters are listed in
table 8.2 and are computed in example 86 . The example uses the lmomglo() and
par2lmom() functions to the same effect. In each case, the lmorph() function is used to
convert the returned L-moments to a more succinct data structurethe lmomco L-moment
list (see page 127 and exs. 67 69 ). The L-moments are listed in table 8.2. It is a coincidence for this particular example that 3 and 4 are effectively equal.
86
224
0.0
0.2
0.4
0.6
0.8
1.0
0.0
0.4
0.8
Figure 8.3. CDF and QDF of Generalized Logistic distribution fit to L-moments in table 8.2 from
example 85
$
$
$
$
$
$
lambdas :
ratios :
trim
:
leftrim :
rightrim:
source :
J
glo
for
between 4 for these two distributions and many others are discussed further in Chapter 10.
Example 87 , for a symmetrical distribution (3 = 0), demonstrates the effect of larger
glo
225
pargev() and the parglo() functions. The lmomgev() and lmomglo() functions
glo
(T4.glo
(T4.gev = 0.107).
87
J
Continuing from example 87 , the code in example 88 produces the comparison
shown in figure 8.4. The thin line lwd=1 in the figure is the Generalized Extreme Value
and the thick line lwd=3 is the Generalized Logistic. Thus, although the distributions
mathematically differ, the distributions are fit to the same L-moments. For the example,
the two distributions generally have similar (near identical) quantiles in the central part
of the range of F values.
88
J
Finally, for the distribution parameters considered in example 87 and the F values, comparison of the PDFs of the two fitted distributions is made using example 89 .
The example uses the quaglo() and quagev() functions to compute distributionspecific ranges x.glo and x.gev. These ranges in turn are used with the PDF functions
pdfglo() and pdfgev(). The PDFs are shown in figure 8.5.
226
4000
2000
0
1000
Quantile
3000
GEV
GLO
0.0
0.2
0.4
0.6
0.8
1.0
Nonexceedance Probability
Figure 8.4. Comparison of QDF for Generalized Extreme Value and Generalized Logistic distributions fit to L-moments of 1 = 2000, 2 = 500, and 3 = 0 from example 88
89
5e04
0e+00
1e04
2e04
f(x)
3e04
4e04
GEV
GLO
1000
1000
2000
3000
4000
5000
Figure 8.5. Comparison of PDF for Generalized Extreme Value and Generalized Logistic distributions fit to L-moments of 1 = 2000, 2 = 500, and 3 = 0 from example 89
logarithmic transformation of the data prior to computation of sample statistics. Logarithmic transformation can be problematic for circumstances involving negative or zero
values. Further, logarithmic transformation can accentuate the influence of small values
(low outliers) on sample statistics while the influence of large values is decreased (see Section 4.4). Comparisons between the Generalized Normal and log-Normal distributions
are made in this section.
DISTRIBUTION FUNCTIONS
The distribution functions of the Generalized Normal having parameters (location),
2
F (x) = (Y )
f (x) =
228
(8.29)
(8.30)
1 log[1 (x )/] if 6= 0
Y =
(x )/
if = 0
(8.31)
< x + / if > 0
(8.32)
< x <
if = 0
(8.33)
+ / x <
if < 0
(8.34)
1 = + [1 exp(2 /2)]
(8.35)
(8.36)
There are no simple expressions for 3 , 4 , and 5 . There are no simple expressions for
the parameters in terms of the L-moments. Numerical methods are required.
Emphasis is needed that logarithmic transformation of the data prior to fitting of the
Generalized Normal distribution is not required. Whereas, logarithmic transformation
is needed for the log-Normal distribution having parameters , log , and log . A closely
related distribution to the Generalized Normal is the 3-parameter log-Normal distribution (log-Normal3). In particular, the log-Normal3 distribution for x > 0 has the same
distribution functions with the substitution of Y in eq. (8.31) for the following
Y =
log(x ) log
log
(8.37)
where is the lower bounds (real space) for which < 1 2 , log is the mean in
log-space, and log is the standard deviation in log-space for which log > 0.
The parameter equalities between the Generalized Normal and log-Normal3, by letting
= exp(log ), are
229
= +
(8.38)
= log
(8.39)
= log
(8.40)
from which the L-moments can be computed by algorithms for the Generalized Normal.
The parameters of the log-Normal3 in terms of the parameters of the Generalized Normal,
by letting = 1 , are
log =
log = log()
2
0.5log
(8.41)
(8.42)
log =
(8.43)
log = log()
(8.44)
(8.45)
for an unknown . Readers should note that natural logarithms are represented by the
log() function in the prior typeset mathematics, and this mimics the syntax of natural
logarithms log() in R. For an example of a study using the log-Normal3 and within in
the context of L-moments, Benson (1993) concludes that the log-Normal3 and Generalized Extreme Value distributions are appropriate for modeling hydraulic conductivity of
compacted soil liners (a common landfill liner and cover).
Using R
Using R
The Generalized Normal accommodates skewness. The generalized nature of the distribution is demonstrated by plotting a PDF for each of three ensembles of L-moments.
Example 810 sets the L-moments in lmr1, lmr2, and lmr3 by the vec2lmom() function. The parameters for each are set in PAR1, PAR2, and PAR3 by the lmom2par() and
pargno() functions. The two functions are purposefully used to show two alternative
230
distribution. (The function was created as a tool to verify that PDF functions properly
integrate to unitysee the documentation.) The three PDFs are shown in figure 8.6.
810
J
Returning to the distribution of annual peak streamflow for U.S. Geological Survey
streamflow-gaging station 05405000 Baraboo River near Baraboo, Wisconsin considered
in example 232 on page 57 and associated discussion, example 811 loads the data
and prepares the annual peak streamflow data for plotting by use of functions sort()
and pp(). The sample L-moments are computed by lmoms() and are listed in the first
three columns in table 8.3. The product moment values of the logarithms are shown in
the last two columns and are repeated from the output of example 232 . The Generalized
Normal parameters are computed by pargno() into GNOpar and are GNO(13811, 19049,
1.0710).
811
#pdf("gnolognor.pdf")
data(USGSsta05405000peaks) # from lmomco package
attach(USGSsta05405000peaks)
Q
<- sort(peak_va) # sort the annual peak streamflow values
PP <- pp(Q) # compute Weibull plotting positions
lmr
<- lmoms(Q);
GNOpar <- pargno(lmr)
lmr.lg <- lmoms(log10(Q)); NORpar <- parnor(lmr.lg)
plot(qnorm(PP),Q, xlab="STANDARD NORMAL DEVIATE",
ylab="STREAMFLOW, IN FT^3/S")
lines(qnorm(PP), quagno(PP,GNOpar)) # plot gno as solid line
lines(qnorm(PP), 10^quanor(PP,NORpar),
lty=2) # plot lognormal distribution as dashed line
#dev.off()
231
0.4
0.2
0.0
probability density
20
15
10
probability density
0.15
0.00
probability density
10
Figure 8.6. Probability density functions for three selected Generalized Normal distributions.
812
str(lmorph(lmomgno(GNOpar)))
List of 6
$ lambdas : num [1:5] 3134.6 893.9 159.7 132.1
52.9
$ ratios : num [1:5]
NA 0.2852 0.1786 0.1477 0.0592
$ trim
: num 0
$ leftrim : NULL
$ rightrim: NULL
$ source : chr "lmorph"
Continuing with the primary demonstration, example 811 also computes the sample
L-moments of log10 -transformed data and fits a Normal distribution using parnor(). The
empirical distribution and the fitted Generalized Normal and log-Normal distributions
are then plotted, and the results are shown in figure 8.7.
232
The plot in figure 8.7 shows that the Generalized Normal provides a preferable fit
the distribution is more reliably fit by the method of L-moments and has avoided the
use of logarithms. Using L-moments, the analyst can work in the natural units of the
data. By better representing the first three sample L-moments, the Generalized Normal is
preferable to the log-Normal for the current data. Readers might compare figure 2.11 on
page 59 to figure 8.7, and note that the log-Normal distribution is represented by a dashed
Table 8.3. L-moments of annual peak streamflow data for 05405000 Baraboo River near Baraboo,
Wisconsin and parameters for fitted Generalized Normal distribution
1
2
3
(log10 ) (log10 )
894
STREAMFLOW, IN FT^3/S
3135
(ft3 /s)
(ft3 /s)
(--)
0.1786 2849
(ft3 /s)
(ft3 /s)
1497
(--)
(ft3 /s)
(ft3 /s)
0.3683
3.438
0.2356
Figure 8.7. Empirical distribution of annual peak streamflow data for U.S. Geological Survey
streamflow-gaging station 05405000 Baraboo River near Baraboo, Wisconsin and Generalized Normal (solid line) and log-Normal (dashed line) distributions fit by method of L-moments
from example 811
233
0.99
Next, through the for() loop, the nsam differences between the two estimated X
and X0.99 are computed. The summary statistics of the differences then are computed in
example 814 .
814
Max.
5588.00
234
The summary statistics in example 814 show that the product moments, through the
assumption that the parent is log-Normal, provide slightly less biased estimates of X0.99
than the L-moments through the Generalized Normal distribution. The statistics also show
The Generalized Normal and log-Normal3 distributions are closely related. In example 815 , a Generalized Normal is fit to some L-moments, and the QDF is plotted in
figure 8.8.
815
The figure shows open circles for the Generalized Normal values by 5-percent increments.
Additionally, the lines depicted various solutions for the log-Normal3 distribution, in
which the unknown -parameter solution is plotted in red. In the figure, the red line (logNormal3) plots along the dashed line (Generalized Normal)the two distributions are
the same.
235
1500
1000
500
500
qlmomco(F, pargno(lmr))
2000
2500
0.0
0.2
0.4
0.6
0.8
1.0
Figure 8.8. Quantile function by 5-percent intervals for a Generalized Normal (dashed line) distribution and several log-Normal3 fits using selected lower limits and fit (red line) treating lower
limit as unknown from example 815
Generalized Pareto generally is less kurtotic (4 ) than the other three-parameter distributions described here and much less so for negatively skewed or left-tail heavy data (see
Chapter 10).
The Generalized Pareto distribution is especially useful as a distribution for pedagogical
purposes: (1) it is a three-parameter distribution that supports both known and unknown
lower limits, (2) the distribution functions are readily computed and theoretical integrations by eqs. (3.4) and (6.1) are straightforward, and (3) the L-moments in terms of the
parameters and parameters in terms of L-moments are readily computed. These factors
make the Generalized Pareto attractive for educational settings including examination
purposes.
DISTRIBUTION FUNCTIONS
The distribution functions of the Generalized Pareto having parameters (location),
where
f (x) = 1 exp[(1 )Y ]
(8.46)
F (x) = 1 exp(Y )
(8.47)
1 log[1 (x )/] if 6= 0
Y =
(x )/
if = 0
(8.48)
+ [1 (1 F ) ]/ if 6= 0
x(F ) =
log(1 F )
if = 0
(8.49)
and
< x + / if > 0
(8.50)
x<
(8.51)
if 0
1 = + /(1 + )
(8.52)
2 = /[(1 + )(2 + )]
(8.53)
3 = (1 )/(3 + )
(8.54)
(8.55)
= [(1 )/2 ] 2
(8.56)
= (1 + )(1 )
(8.57)
4 =
3 (1 + 53 )
5 + 3
237
(8.58)
= (1 33 )/(1 + 3 )
(8.59)
= (1 + )(2 + )2
(8.60)
= 1 (2 + )2
(8.61)
Using R
Using R
Suppose a Generalized Pareto is specified as GPA(6000, 400, 0.5), the first four
L-moments can be manually computed. Using analytical expressions (eqs. (8.52) (8.55))
for the L-moments in terms of the parameters that follow
(8.62)
(8.63)
(8.64)
(8.65)
a double check of the arithmetic with the par2lmom() and lmomgpa() functions is
now made in example 816 . In the example, the lmorph() function is used for format
conversion to show the two lmomco L-moment lists (see page 127 and exs. 67 69 ).
816
-5200
533
0.6
0.429
0.333
-0.103
320
238
$ L4
: num 229
$ L5
: num 178
$ source: chr "lmomgpa"
str(lmorph(lmomGPA))
List of 6
$ lambdas : num [1:5] -5200
533
320
229
178
$ ratios : num [1:5]
NA -0.103 0.600 0.429 0.333
$ trim
: num 0
$ leftrim : NULL
$ rightrim: NULL
$ source : chr "lmorph"
DISTRIBUTION FUNCTIONS
The distribution functions of the Right-Censored Generalized Pareto are the same as
those for the Generalized Pareto so reference to Section 8.2.4 is made. The relations by
Hosking (1995) between the parameters and the B-type L-moments (through the B-type
probability-weighted moments of Section 12.2) of the data under right-tail censoring are
B
1 = + m1
B
2 = (m1
(8.66)
m2 )
(8.67)
B
3 = (m1 3m2 + 2m3 )
(8.68)
B
4 = (m1 6m2 + 10m3 5m4 )
(8.69)
B
5 = (m1 10m2 + 30m3 35m4 + 14m5 )
(8.70)
where mr = [1(1)r+ ]/(r+) and is the right-tail censor fraction or the probability
Pr[] that x is less than the quantile at nonexceedance probability: (Pr[x < X()]).
239
Using R
Using R
DISTRIBUTION FUNCTIONS
The distribution functions of a t = 1 symmetrically-trimmed Trimmed Generalized
Pareto having parameters (location), (scale, > 0), and (shape, > 1) are defined
as for the Generalized Pareto on page 236.
The TL-moments of the Generalized Pareto (Trimmed Generalized Pareto) with sym(1)
metrical trimming of smallest and largest values ((1)
r or r ) are
(1)
( + 5)
( + 3)( + 2)
6
=
( + 4)( + 3)( + 2)
10(1 )
=
9 ( + 5)
5( 1)( 2)
=
4( + 6)( + 5)
1 = +
(1)
(1)
(1)
240
(8.71)
(8.72)
(8.73)
(8.74)
10 453
(8.75)
(1)
93 + 10
(1)
= 1
( + 5)
( + 2)( + 3)
(8.76)
(8.77)
Using R
Using R
An example of the Trimmed Generalized Pareto distribution in the context of computing theoretical t = 1 TL-moments using the theoTLmoms() function is provided in
example 615 on page 142. The results of that example are compared to analytical results
computed by the lmomTLgpa() function, which implements eqs. (8.71) (8.74) for the
same TLGPA(10, 5, 0.5) in example 817 . Comparison between the two examples shows
(1)
(1)
(1)
(1)
J
The robustness of the TL-moments in the presence of some contrived contamination
by outliers to a sample is now explored. In example 818 , a GPA(1000, 1000, 0.5) is
specified and a sample of size n = 30 is chosen for evaluation. The evaluation will use
99th percentile F = 0.99 is shown and indicates that both techniques underestimate
considerably in the right tail of the distribution. However, the bias using the TL-moments
is about half compared to the L-moments [(4972)/(8603) = 0.58].
241
242
parameters. This fact greatly simplifies comparisons between parameter estimates from
product moments and L-moments.
DISTRIBUTION FUNCTIONS
The distribution functions of the Pearson Type III having parameters (mean, location), (standard deviation, scale), and (skew, shape), but expressed with alternative
parameters (location), (scale, > 0), and (shape, > 0) are
((x )/)
if = 0
(8.78)
G(, Y1 )/()
if > 0
((x )/)
if = 0
(8.79)
Y1 = (x )/ and Y2 = ( x)/
(8.80)
and where G(a, b) is the incomplete gamma function, (a) is the complete gamma function, (a) is the PDF of the Normal distribution, (a) is the CDF of the Normal distribution. The relations between the product moments and the three alternative parameters for
6= 0 are
= 4/ 2
(8.81)
= ||/2
(8.82)
= 2/
(8.83)
Z
G(a, b) =
t(a1) exp(t) dt
243
(8.84)
(a) =
t(a1) exp(t) dt
(8.85)
The particular parameterization of the Pearson Type III shown is useful. For hydrologic data, more common situations of positive skewness (right-tail heavy), less common
negative skewness (left-tail heavy), and zero skewness (Normal distribution) are accommodated. The ranges of the distribution are
x < if > 0
(8.86)
(8.87)
(8.88)
1 = +
(8.89)
(8.90)
3 = 6 I1/3 (, 2) 3
(8.91)
where Ix (p, q) denotes the incomplete Beta function ratio, regularized incomplete Beta
function, regularized Beta function for short
(p + q)
Ix (p, q) =
(p) (q)
tp1 (1 t)q1 dt
(8.92)
which also is the same as the CDF of the Beta distribution B(x, p, q).
The parameters have quasi-analytical solutions (Hosking and Wallis, 1997, p. 202). The
following approximations have a relative accuracy better than 5 105 for all values of
. If 0 < |3 | < 1/3, let z = 332 and use minimax approximations by Hosking (1996b)
for
1 + 0.2906z
(8.93)
z + 0.1882z 2 + 0.0442z 3
if 1/3 |3 | < 1, let z = 1 |3 | and use
244
(8.94)
2
= sign(3 )
()
= 2
( + 0.5)
= 1
(8.95)
(8.96)
(8.97)
Finally, the log-Pearson Type III distribution is a Pearson Type III fit to the logarithms of
a random variable.
Using R
Using R
Daily mean streamflow for U.S. Geological Survey streamflow-gaging station 06766000
Platte River at Brady, Nebraska is available in the USGSsta06766000dvs data for the
period from 03/01/1939 to 09/30/1991. The flow-duration curve is a plot of the sorted
daily mean streamflow values plotting against nonexceedance probability computed by
plotting positions. Example 819 loads in these data and plots the time series of streamflow as measured daily.
819
Subsequently, example 820 fits the Pearson Type III distribution by the method of
L-moments. The fitted distribution is then plotted on the empirical distribution. Unlike
other examples herein, the empirical distribution is represented by a line instead of points.
Specific judgements of Pearson Type III fit are not made for these daily mean streamflows with the exception that there are considerable differences in the far-right (drought)
tail. The data trail off towards zero (no-flow), which is otherwise not representable on the
logarithmic scale. The Pearson Type III distribution would provide for, that is, estimate,
an order of magnitude or more streamflow than the data show or suggest for F 0.1
for drought. Hence, the Pearson Type III greatly overestimates the availability of a natural
resource under drought conditions in this particular example.
245
15000
10000
0
5000
FLOW, IN FT^3/S
20000
5000
10000
15000
DAY
Figure 8.9. Time series by day of daily mean streamflow for U.S. Geological Survey streamflowgaging station 06766000 Platte River at Brady, Nebraska from example 819
J
246
3
2
1
LOG10(FLOW), IN FT^3/S
DATA
Pearson Type III distribution
0.0
0.2
0.4
0.6
0.8
1.0
NONEXCEEDANCE PROBABILITY
Figure 8.10. Flow-duration curve of daily mean streamflow for U.S. Geological Survey streamflowgaging station 06766000 Platte River at Brady, Nebraska from example 820
8.2.8 Weibull Distribution
The Weibull distribution as implemented by lmomco is a three-parameter version, whereas,
the built-in R version has two parameters. The three-parameter version offers additional
flexibility. The Weibull is comprehensively summarized in Rinne (2008).
DISTRIBUTION FUNCTIONS
The distribution functions of the Weibull having parameters (location), (scale), and
(shape) are
f (x) = Y 1 exp(Y )/
(8.98)
F (x) = 1 exp(Y )
(8.99)
(8.100)
Y = (x )/
(8.101)
x<
(8.102)
= 1/
(8.103)
= /
(8.104)
(8.105)
The Weibull distribution is popular in the analysis of lifetimes in which case x is time t.
If < 1, then as t increases the failure rate decreasesthis condition is known as infant
mortality. If > 1, then as t increases the failure rate increasesthis condition is known
as wear out. If = 1, the Weibull Exponential distribution, and the failure rate is
constant: h(x) = 1/ (see example 24 ).
Using R
Using R
two plots. The high-level check.pdf() function plots the two PDFs. The mtext() function renders the respective plot titles. The plots are shown in figure 8.11.
821
Although each is fit to the same L-moments, the two PDFs shown in figure 8.11
appear quite different. A logical line of inquiry is: How different do the fitted distributions look compared to the empirical distribution? This question is answered in the next
example.
Example 822 and resulting plot in figure 8.12 make the comparison of the empirical
distribution to the fitted CDFs. Subsequently, a vector of nonexceedance probabilities is
created and set into the variable F. The intersection of the quantiles for the two distributions is created by sorting the values returned by the quawei() and quagev() functions.
822
Next, the plot is drawn in example 822 . The cdfwei() and cdfgev() functions
compute the F values for the empirical distribution. The vertical axis is a probability
axis by casting the F values into standard normal deviates using the qnorm() function.
The base-10 logarithms of the quantiles x are used to reduce visual curvature of the plot,
note however, that the distributions are not fit to the logarithms of the data. The Weibull
(thick line) and the Generalized Extreme Value (thin line) distributions are plotted. The
249
Weibull distribution
2.0e06
0.0e+00
probability density
0.0e+00
5.0e+06
1.0e+07
1.5e+07
2.0e+07
3e07
0e+00
probability density
0.0e+00
1.0e+07
2.0e+07
3.0e+07
Figure 8.11. Comparison of probability density functions for Weibull and Generalized Extreme
Value distributions fit to same L-moments of number of Internal Revenue Service refunds by
state from example 821
empirical distribution finally is plotted by the points() function. The data points are
drawn unnecessarily large for demonstration of the cex argument, which scales the points
larger or smaller depending on the cex argument value.
Several observations of figure 8.12 can be made. Because each is fit to 1 , 2 , and 3 ,
both distributions generally mimic the data between 1 and 1 standard deviations. Substantial differences exist primarily in the tails. Neither distribution exhibits quite enough
straightness in the right tail as suggested by the data and the respective plotting positions. The figure shows that the largest four values have been underestimated. For the left
tail, the Weibull distribution has the preferable fit compared to that of the Generalized
250
1
0
1
5.0
5.5
6.0
6.5
7.0
Figure 8.12. Comparison of cumulative probability functions for Weibull (thick line) and Generalized Extreme Value (thin line) distributions fit to same L-moments and empirical distribution of
number of Internal Revenue Service refunds by state from example 822
Extreme Value. Whether the tail differences are important or have ramifications for later
interpretations is a discipline-specific problem.
251
DISTRIBUTION FUNCTIONS
The distribution functions of the Polynomial Density-Quantile3 having parameters
(8.106)
< x <
(8.107)
(8.108)
(1 )
(1 3 )
1
1
3 =
arctanh()
2 =
(8.109)
(8.110)
4 = (53 / 1)/4
(8.111)
The parameter requires numerical solution of eq. (8.110), and the other parameters are
2 (1 3 )
(1 2 )
(8.112)
(8.113)
252
glo
alized Logistic distribution. For example, for a sample distribution having 3 = 0.1795
glo
pdq3
DISTRIBUTION FUNCTIONS
The distribution functions of the Polynomial Density-Quantile4 having parameters
(8.114)
(8.115)
< x <
253
(8.116)
1 =
(1 2 )arctanh()/ if > 0
2 =
(1 + 2 ) arctan()/ if < 0
(8.117)
3 = 0
1 +
4
4 =
1
4
(8.119)
4 1
5
1
arctanh()
if
1
6
4 1
5
1
arctan()
if 14 < 4 <
(8.118)
4 < 1
1
6
(8.120)
The parameter requires numerical solution of eq. (8.120), and the other parameters are
= 1
(8.121)
(8.122)
The Polynomial Density-Quantile4 distribution is symmetrical about and is quite similar to the Normal but exhibits heavier tails. Using the standard Normal for reference,
Hosking (2007a, p. 2883) reports that PDF and QDF functions [of the two distributions]
are very similar except in the extreme tails. In particular, the distributions differ by less
than 0.03 in the quantiles for 0.011 < F < 0.989. The tails of the Polynomial DensityQuantile4 are exponentially decreasing and the distribution could be useful in distributional analysis with data exhibiting similar tail characteristics.
254
DISTRIBUTION FUNCTIONS
The distribution functions of the Student t (3-parameter) having parameters (location),
( 21 + 12 )
(1 + t2 /)(+1)/2
1/2 ( 12 )( 21 )
(8.123)
t=
(x )
(8.124)
< x <
(8.125)
1 =
(8.126)
(8.127)
3 = 0
(8.128)
4 =
15
()
1
2 ( 2 )( 21 )
Z
0
dx
2
x
(8.129)
where Ix ( 12 , 21 ) is the CDF of the Beta distribution. Hosking (1999) does not provide
details as to the definition of Ix ( 21 , 12 ).1 In Hosking and Wallis (1997, p. 201), Ix (p, q)
is the incomplete Beta function ratio, which is eq. (8.92) of this dissertation; numerical
experiments, not presented here, seem to confirm that eq. (8.129) using the CDF of the
Beta distribution is correct.
The parameters require numerical methods. Hosking (1999) reports that a one-to-one
relation between 4 and exists and a table could be computed and found by linear
This is quite unusual for Jonathan and such ambiguity is surprising. This author (Asquith) is
a fan of Jonathans work and eagerly awaits the discovery of each new reference by him and
commends Jonathan for a long history of well written and documented articles that are especially
approachable for non-mathematicians.
255
= 1
=
(8.130)
2
264 1/2 (2 2)/[( 12 )]4
(8.131)
8.4 Summary
Three-parameter distributions often are preferable to two-parameter distributions in the
application of distributional analysis where the skewness of the data is expected to be
different from zero (asymmetrically distributed data about the mean or different from that
of other distributions). The 8 three-parameter distributions formally considered in this
chapter are fit to the first three L-moments of the data. Both the lmomco and lmom packages
provide support for many three-parameter distributions. The 22 examples demonstrate a
variety of applications and generally have expanded complexity relative to the examples
in Chapter 7. Further, additional comparisons between product moments and L-moments
to those in that chapter also are made.
The examples for the Generalized Extreme Value distribution consider the distribution of annual wind speed data reported by Hosking and Wallis (1997) in which the
parameters of the Generalized Extreme Value were already provided for three cities
in Texas. A table of selected quantiles of the three Generalized Extreme Value is provided. The examples also create a small application using the Generalized Extreme
Value to generate a quantile-quantile plot (expressed in annual recurrence interval) of
some annual peak streamflow data in Texas contained within the lmomco package.
The examples for the Generalized Logistic distribution consider the distribution of
1-hour annual maxima of rainfall for a county in Texas based on Generalized Logistic parameters provided by Asquith (1998). CDF and QDF plots are created and the
L-moments of the given parameters computed.
The examples for the Generalized Normal distribution create three representations of
the PDF for three ensembles of L-moments in order to demonstrate the effect of 3 on
2
This is a similar method of parameter estimation as the author (Asquith) has implemented for
the Rice distribution in the lmomco package.
256
the fitted distribution. The examples continue with a return to annual peak streamflow data considered in Chapter 2. The Generalized Normal and log-Normal are fit
to the L-moments (real space) and product moments (logarithms) of the annual peak
streamflow data and a QDF plot along with the sample data is created. The Generalized Normal provides a preferable fit. The examples continue with an exploration
of the sampling properties of the Generalized Normal for a log-Normal parent. The
statistical simulations show that the product moments might perform better than
L-moments when a parent is truly log-Normal. Finally, an example is provided comparing the Generalized Normal to the log-Normal3 and various lower limits of the
log-Normal3 are considered.
The examples for the Generalized Pareto distribution show manual computations of
the L-moments from a given set of parameters. The computations are shown because
the Generalized Pareto has some readily used analytical solutions for the parameters
but also are more complex than the elementary solutions for the Exponential distribution.
The examples for the Trimmed Generalized Pareto distribution compute some
TL-moments by analytical and numerical methods and equivalency is shown. The
robustness of the TL-moments in the presence of contrived contamination is explored
with the focus on the F = 0.99 quantile. The bias of the TL-moments for fitting
and estimation of the quantile is shown to be considerably less than that from use of
L-moments.
No examples for the Right-Censored Generalized Pareto distribution are provided in
this chapter.
The examples for the Pearson Type III distribution involve the exploration of the flowduration curve for some daily mean streamflow data in Nebraska. A comparison
between the fitted distribution and the data is made along with several plots. Finally,
example computations comparing the Pearson Type III to the Normal distribution are
made.
The examples for the Weibull distribution consider some income tax data for the
United States. PDFs of the Weibull and Generalized Extreme Value are created by
fitting to the L-moments and plotted. Finally, CDF plots are created by computation
of appropriate distribution ranges using selected nonexceedance probabilities and
257
QDF functions. The examples show that the Weibull is preferable to the Generalized
Extreme Value for these data.
Finally, the chapter concludes with a summary of selected three-parameter distributions
with existing L-moment derivations that are not yet (as of May 2011) implemented within
the lmomco package.
258
Chapter 9
L-moments of Four- and More Parameter Univariate
Distributions
9.1 Introduction
Distributions having four- and more parameters are described in this chapter. These distributions are less well-known than many of the other lower-order (lower-parameter) distributions described in the previous two chapters. However, it will be seen that four- and
more parameter distributions are very attractive for mimicking the geometry of heavytailed distributions.
The four- and more parameter distributions are fit to the mean, scale, shape (skewness),
and kurtosis (seen simply as a higher order measure of shape) of a data set. For sufficiently
large sample sizes (vagueness on how large is large is intentional), sample L-moments
can reliably estimate distribution shape through 4 and even distribution shape by the
259
fifth L-moment through 5 . For some types of distributional analyses, four- and more
parameter distributions are flexible and might provide useful fits that are not attainable
by lower-order distributions.
The flexibility is particularly useful in the study three-parameter distributions because
four- and more parameter distributions, being simultaneously fit to 3 , 4 , and higher, can
mimic the shapes of many three-parameter distributions. The flexibility does come at the
price of having to estimate additional moments at fourth or fifth order. It is important
to note that, as a general rule, parameter estimation for four- and more parameter distributions is considerably more complex than lower parameter distributionsnumerical
methods for minimization or root-solving generally are required.
Final notes about the source of material and in particular the mathematics of the fourand more parameter distributions is needed. Unless otherwise stated, the material is heavily based on Asquith (2007), Hosking (1996b), Hosking (1994), Hosking and Wallis (1997),
Karian and Dudewicz (2000), and Stedinger and others (1993). These and additional references are provided on a distribution-specific basis.
It seems that Hosking (1994) was the first to take up the mantle of four-parameter Kappa investigation with vigor.
2
Although not as large as the Generalized Lambda and Wakeby distributions described later in
this chapter.
260
many types of distributional analyses. Stress is needed that sample sizes should be sufficiently large for reliable estimation of 4 . Finally, the Kappa is attractive because parameter
estimation for the Kappa is much more straightforward than for the Generalized Lambda
distribution.
The Kappa distribution is of particular interest to L-moment practitioners because with
DISTRIBUTION FUNCTIONS
The distribution functions of the Kappa having parameters (location), (scale),
(shape1), h (shape2) subject to the constraint that h 0 and > 1 or if h < 0 and
1 Fh
x(F ) = +
1
(9.1)
(9.2)
(9.3)
+ (1 h )/ if h > 0
xL = + /
if h 0 and < 0
if h 0 and 0
+ / if > 0
xU =
if 0
261
(9.4)
(9.5)
1 = + (1 g1 )/
(9.6)
2 = (g1 g2 )/
(9.7)
(9.8)
(9.9)
where gr is
gr =
r (1 + ) (r/h)/[h1+ (1 + + r/h)]
if h > 0
(9.10)
(9.11)
262
Deng, 2003, p. 90), but use of L-moments is far simpler than entropy. Singh and Deng
conclude that the combinations of the two methods can further improve parameter estimation [for the Kappa].
Using R
Using R
The Kappa distribution is demonstrated on the annual peak streamflow data for
U.S. Geological Survey streamflow-gaging station 08190000 Nueces River near Laguna,
Texas. The data are available in the data set USGSsta08190000peaks. Example 91
produces, using algorithmic similarity to other examples with similar themes in this dissertation, the empirical distribution by Weibull plotting positions and, by the method of
L-moments, fits a Kappa distribution using the parkap() function. The quantiles of the
Kappa are computed by the quakap() function. The distributions are shown in figure 9.1.
A standard Normal tranformation (qnorm()) is used for the horizontal axis, and a log10 ()
transformation log10() is used for the vertical axis. These transformations increase the
linearity in the figure.
91
Some interpretations of the Kappa fit in figure 9.1 can be made. The empirical distribution has some interesting sinuous or seemingly distinguishable (steepness, curvature)
parts. The two hinge points appear near 0.55 and 0.10 standard deviations. For the
data from this particular location, values with about F < 0.29 ( pnorm(-0.55)) likely
represent drought-like conditions in which the annual peak streamflow does not represent
storm runoff. For values with the approximate range 0.29 < F < 0.54 ( pnorm(0.10)),
263
5.5
Kappa by Lmoments
5.0
4.5
3.0
3.5
4.0
2.0
2.5
LOG10(STREAMFLOW, IN FT^3/S)
Figure 9.1. Empirical distribution of annual peak streamflow for U.S. Geological Survey
streamflow-gaging station 08190000 Nueces River near Laguna, Texas and Kappa distribution
fit by the method of L-moments from example 91
the relatively flatter portion of the data could represent a flow regime during years for
which flows are relatively stable and do not represent periods (years) for which the flows
are not caused by full reaction of the approximately 737 square-mile watershed to large
rainfall events. From a perspective of distributional analysis of flood flows, the right-tail
portion of the distribution is of primary interest. The figure shows that the Kappa has an
acceptable fit to the general curvature of the empirical distribution.
The Kappa has an apparently acceptable fit in the right-tail of the empirical distribution
in figure 9.1. The Kappa distribution is compared to the log-Normal distribution, fit by
the method of moments, and the Generalized Normal distribution, fit by the method of
L-moments in example 92 . The results are shown in figure 9.2. The horizontal and vertical limits have been changed by the xlim and ylim arguments to the plot() function.
The variable F contains F values conveniently produced by the nonexceeds() function.
Finally for this example, the qlmomco() is used to create parallel syntax (see lines labeled
# Kappa and # GNO) for computation of Kappa and Generalized Normal quantiles.
264
5.5
6.0
5.0
LOG10(STREAMFLOW, IN FT^3/S)
3.5
4.0
4.5
Kappa by Lmoments
GNO by Lmoments
Lognormal by
product moments
3.0
2.5
Figure 9.2. Empirical distribution of annual peak streamflow for U.S. Geological Survey
streamflow-gaging station 08190000 Nueces River near Laguna, Texas and three selected
distributions from example 92
265
Dupuis and Winchester (2001) provide a study of the Kappa in the context of the methods of L-moments and maximum likelihood with a focus on infeasible parameters
glo
Kappa parameters are uncomputable. Their definition of infeasible is the same as that
on page 104 of this dissertation and treated by Chen and Balakrishnan (1995) for different distributions. Dupuis and Winchester conduct a more than 1,000 drawing simulation
study for n = 50 samples for sequences of and h parameters using = 0 and = 1
without a loss of generality. A select part of their study is reproduced by the code in
example 93 .
93
n <- 50; nsim <- 1000 # sample size and no. of simulation
Ks <- c(-0.4, -0.2, 0, 0.2, 0.4) # kappas
Hs <- c(-1.2, -0.8, -0.4, 0, 0.4, 0.8, 1.2) # hs
for(k in Ks) {
for(h in Hs) {
failed <- 0
infeas <- 0
#
#
#
#
266
The example reproduces the and h sequences used by Dupuis and Winchester (2001)
and then mimics the quadruple loop that the authors must of used by following their
written description of their algorithm. The example computes the percent of time that the
parameters are infeasible or uncomputable. Feasible means that the support of the fitted
distribution is inside the range of the observed (or simualted here) data. Readers are asked
to note the addition of the number of failed attempts in the denominator used to compute
the DWcom variable, which Dupuis and Winchester also are careful to point out. The last
line of the example shows the results for = 0.2 and h = 0.4, and for these parameters,
infeasible parameters were found 33.6 percent of the time and 13.3 percent of the time
glo
the parameters could not even be computed (4 is above the 4 of the Generalized Logistic distribution, see Chapter 10). These two percentages compare favorably with those in
Dupuis and Winchester (2001, p. 108), who report 36.6[12.4] compared to 33.6[13.3]
in example 93 . The remainder of the output (not shown) by example 93 also compares favorably with Dupuis and Winchester. This {3 , 4 }-parameter space restriction is
removed when using the Generalized Lambda distribution described in the next section.
But the parameter space expansion comes at the expensive of more complex parameter
estimation nuances.
267
DISTRIBUTION FUNCTIONS
The distribution functions of the Generalized Lambda having parameters (location),
1
[(F 1 ) h(1 F )h1 ]
(9.12)
(9.13)
The ranges of the distribution are listed below where ( or ) note exclusion of and the
brackets [ or ] note inclusion of the indicated limit:
Range
>0
h>0
[ , + ]
>0
h=0
[, + ]
=0
h>0
[ , ]
<0
h<0
(, )
<0
h=0
(, + ]
=0
h<0
[ , )
1
1
1 = +
+1 h+1
h
+
2 =
( + 2)( + 1) (h + 2)(h + 1)
h(h 1)
( 1)
3 =
( + 3)( + 2)( + 1) (h + 3)(h + 2)(h + 1)
(9.14)
(9.15)
(9.16)
( 2)( 1)
( + 4)( + 3)( + 2)( + 1)
h(h 2)(h 1)
=
(h + 4)(h + 3)(h + 2)(h + 1)
K 4 =
H4
4 = (K4 + H4 )
268
(9.17)
( 3)( 2)( 1)
( + 5)( + 4)( + 3)( + 2)( + 1)
h(h 3)(h 2)(h 1)
=
(h + 5)(h + 4)(h + 3)(h + 2)(h + 1)
K 5 =
H5
5 = (K5 H5 )
(9.18)
L = (h + 2)(h + 1) + h( + 2)( + 1)
(9.19)
(9.20)
(9.21)
(9.22)
Karvanen and Nuutinen (2008) provide a general equation for L-moment computation
for r 2
r1
X
r+j1
1
(1)r
rj1 r 1
r =
(1)
+
j
j
j
+
1
+
j+1+h
j=0
269
(9.23)
(9.24)
There are no simple expressions for the parameters in terms of the L-moments. Numerical methods must be employed and multiple solutions in different regions of {, h}-space
are common. Besides demonstration in the remainder of this section, the multiple solution
nature of the Generalized Lambda is considered extensively near the end of Section 11.2.
The distribution with gld = 0 is a form of the Generalized Pareto distribution.
Using R
Using R
The Generalized Lambda distribution is demonstrated using the annual peak streamflow data for U.S. Geological Survey streamflow-gaging station 08190000 Nueces River
near Laguna, Texas. The data are available in the data set USGSsta08190000peaks.
Example 94 , using algorithmic similarity to other examples, produces the empirical
distribution by Weibull plotting positions and by the method of L-moments fits a Generalized Lambda distribution using the pargld() function. The quantiles of the Generalized Lambda are computed by the quagld() function. For this example, two solutions
of the Generalized Lambda appear available for the tolerance on the minimization set
by eps=1e-2. The two Generalized Lambda fits are shown in figure 9.3 along with the
fit for the Kappa as a reference.
94
The textual output of the pargld() function has been suppressed in the example, but
two viable solutions exist.3 The parameters for one solution are shown in the vec2par()
3
The author has chosen a large tolerance to cause two solutions to be found for this example.
270
function. Because numerical methods are used, the precise numerical values for the parameters will be different in subsequent trials of the pargld() function.
As shown in example 94 , the Generalized Lambda has two solutions for the provided L-moments. The minimum least-squares solution on 3 and 4 that is computed
by pargld() is manually set into the PARgld2 variable, and the error is 1E9. The
first and primary solution in PARgld1 has a much larger 2E3. Refining interpretagld
PARgld1 and 5 0.11 for solution in PARgld2. Asquith (2007) and documentation
of lmomco provides further details of this algorithm. The preferable solution in PARgld1
is about GLD(58839, 54582, 59.23810, 0.414052). Example 95 plots both Generalized Lambda solutions and that for the Kappa. The author suggests that the preferred
solution in PARgld1 is visually more consistent with the empirical distribution for righttail, annual peak streamflow estimation, and this is the tail of interest here.
95
#pdf("nueces3.pdf")
plot(qnorm(PP),log10(Q),
xlab="STANDARD NORMAL DEVIATE",
ylab="LOG10(STREAMFLOW, IN FT^3/S)")
lines(qnorm(PP), log10(quagld(PP,PARgld1)), lwd=3)
lines(qnorm(PP), log10(quagld(PP,PARgld2)), lwd=1)
lines(qnorm(PP), log10(quakap(PP, PARkap)), lwd=1, lty=2)
legend(-2,5.5, c("GLD1(preferred)","GLD2","Kappa by L-moments"),
lwd=c(3,1,1), lty=c(1,1,2), box.lty=0, bty="n")
#dev.off()
Further solution justification beyond the authors visual assessment of the previous
paragraph is needed. The convergence error on 3 and 4 for PARgld2 is 1E9, which is
about 7 orders of magnitude better than that for PARgld1. The 5 performance however
is substantially better in PARgld1 than PARgld2. These statements are made to point out
that PARgld2 is numerically superior in terms of fit to the L-moments but lacks a visibly
appropriate fit. A QDF mixture might be an alternative model for analysis of these data.4
The author suggests that the choice of a general value for eps for the pargld() (and
parTLgld() by association) function is an open problem for additional research.
To conclude, the author recognizes the greater complexity and interpretation required
for parameter estimation and subsequent selection of a preferred fit for the distribution
4
Such a mixture could be constructed using the Intermediate Rule on page 35 in which two
distributions used and each fit to the upper and lower halves of the data. The weight factor for the
Intermediate Rule could be chosen to satisfy the overall mean.
271
5.5
4.5
4.0
3.5
3.0
2.0
2.5
LOG10(STREAMFLOW, IN FT^3/S)
5.0
GLD1(preferred)
GLD2
Kappa by Lmoments
Figure 9.3. Empirical distribution of annual peak streamflow for U.S. Geological Survey
streamflow-gaging station 08190000 Nueces River near Laguna, Texas and two Generalized
Lambda distributions and Kappa fit to sample L-moments from example 94
relative to the lack of analyst intervention needed for the Kappa. The author suggests that
the Generalized Lambda could be useful for circumstances in which 4 is greater than that
of the Generalized Logistic distribution and therefore the Kappa cannot be fit. Thus, the
Generalized Lambda thus can have a complementary role to the Kappa in circumstances
Su (2010) provides the GLDEX package for R to fit the Generalized Lambda distribution and small part of that package is parameter estimation by L-moments (see page 10
of this dissertation for more discussion). The L-moment functions provided by GLDEX
are Lmoments(), Lcoefs(), Lmomcov(), Lmoments_calc(), Lmomcov_calc(), and
t1lmoments(). These functions apparently are authored by Karvanen (2009) because
credit is given; the GLDEX does not require the library() loading of the Lmoments
package by Karvanen (2009).
Example 96 is derived from examples in the GLDEX package. The example simulates
n = 500 standard Normal values and then computes two parameter suites for the Gener272
alized Lambda. There are two parameterizations of the distribution by the package: RPRS
and RMFMKL and interest here is the former. The example ends by creating the gldex
variable, which holds the RPRS parameterization because this is most similar (nearly identical) to that shown in this dissertation (see eq. (9.13)). The fun.RPRS.lm() function and
inversion of its second returned parameter are of primary interest in the example.
96
library(GLDEX)
set.seed(1) # author would like others to mimic
fake.dat <- rnorm(500,0,1) # simulate 500 standard normals
fun.data.fit.lm(fake.dat) # GLDEX has TWO GLD parameterizations
#
RPRS
RMFMKL # manually commented out
#[1,] -4.645127e-04 0.01371437 # manually commented out
#[2,] -4.678373e-07 1.53954741 # manually commented out
#[3,] -2.593875e-07 0.10017806 # manually commented out
#[4,] -2.701999e-07 0.08378585 # manually commented out
# fun.RMFMKL.lm(fake.dat) # manually commented out
gldvec
<- fun.RPRS.lm(fake.dat) # "RPRS" is approx. lmomco
gldvec[2] <- 1/gldvec[2] # inversion of the 2nd parameter
gldex <- vec2par(gldvec, type="gld") # parameters for lmomco
7.0158, 0.0899, 0.0955). Close inspection shows that GLD(0.0782, 2.2597, 4.8869, 4.1421)
might also be appropriate because this fit also has the smallest error in {3 , 4 } space and
provides a solution that also is not much worse in terms of 5 . These two solutions are
set into the lmomco1 and lmomco2 variables of example 98 . Readers are asked to consult example 1120 on page 332 and associated discussion for more details concerning
multiple Generalized Lambda solutions.
97
273
$delTau5
[1] 0.009355544
$error
[1] 9.619003e-08
$source
[1] "pargld"
$rest
xi
alpha
kappa
h
delTau5
error
1 -0.011357 7.078270 0.088893 0.094619 0.009394 1.520184e-10
2 0.078243 2.259686 4.886910 4.142094 0.014976 6.740724e-11
3 0.078250 2.259649 4.886804 4.141916 0.014976 6.700292e-13
Example 98 , after setting the two solutions for the Generalized Lambda from the
lmomco package, creates a QDF plot shown in figure 9.4. The figure shows the simulated
data values and the preferred solution by the pargld() function in lmomco1 as the solid
thick line. The solid thin line is the alternative solution in lmomco2 appears slightly less
favorable. Finally, the solution from the fun.RPRS.lm() function is drawn as the dashed
line. The example demonstrates consistency between the lmomco and GLDEX packages.
98
J.
Example 99 shows for gld = 0 that the Generalized Lambda and Generalized Pareto
are equivalent.
99
qlmomco(c(0.25,0.75), vec2par(c(100,30,
0.4), type="gpa"))
[1] 108.1524 131.9238
qlmomco(c(0.25,0.75), vec2par(c(100,30/0.4,0,0.4), type="gld"))
[1] 108.1524 131.9238
J
274
1
0
2
QUANTILE
0.0
0.2
0.4
0.6
0.8
1.0
NONEXCEEDANCE PROBABILITY
Figure 9.4. Simulated standard Normal distribution for n = 500 and three fitted Generalized
Lambda distributions using algorithms of the GLDEX and lmomco packages from example 98.
The two solid lines are from lmomco and the dashed line is from GLDEX.
9.2.3 Trimmed Generalized Lambda Distribution
The Trimmed Generalized Lambda distribution (Asquith, 2007) is a trimmed version of
the Generalized Lambda presented in the previous section. The Trimmed Generalized
Lambda is defined by Asquith (2007) in terms of the symmetrically t = 1 trimmed
TL-moments. However, extension of the TL-moments to other and asymmetrical trimming
is made for this dissertation (see eq. (9.37)). Partial motivation for a Trimmed Generalized
Lambda is to provide a Generalized Lambda capable of reliably representing the Cauchy
and potentially useful for experimentation with TL-moments in general. A Generalized
Lambda fit to the TL-moments has been fit by the method of TL-moments.
DISTRIBUTION FUNCTIONS
The distribution functions of the Trimmed Generalized Lambda are the same as those
for the Generalized Lambda so reference to Section 9.2.2 is made. The extended listings of
275
the TL-moments are shown for t = 1 symmetrical trimming. The first two TL-moments
(1)
(1)
1
1
= + 6
( + 3)( + 2) (h + 3)(h + 2)
h
= 6
+
( + 4)( + 3)( + 2) (h + 4)(h + 3)(h + 2)
(1)
1
(1)
(9.25)
(9.26)
(1)
( 1)
3
( + 5)( + 4)( + 3)( + 2)
h(h 1)
H(1) =
3
(h + 5)(h + 4)(h + 3)(h + 2)
20
(1)
3 = (K(1) H(1) )
3
3
3
K(1) =
(9.27)
(1)
( 2)( 1)
4
( + 6)( + 5)( + 4)( + 3)( + 2)
h(h 2)(h 1)
H(1) =
4
(h + 6)(h + 5)(h + 4)(h + 3)(h + 2)
30
(1)
4 = (K(1) + H(1) )
4
4
4
K(1) =
(9.28)
(1)
( 3)( 2)( 1)
5
( + 7)( + 7)( + 6)( + 5)( + 4)( + 3)( + 2)
h(h 3)(h 2)(h 1)
H(1) =
5
(h + 7)(h + 6)(h + 5)(h + 4)(h + 3)(h + 2)
42
(1)
5 = (K(1) H(1) )
5
5
5
K(1) =
276
(9.29)
K(1) =
(9.30)
(9.31)
(9.32)
(9.33)
K2(1)
5
H1(1)
5
2
H (1)
5
(1)
5
(9.34)
K2(1)
6
1
H (1)
6
H2(1)
6
(9.35)
(9.36)
As with the Generalized Lambda distribution, there are no simple expressions for the
parameters in terms of the TL-moments. Numerical methods must be employed and multiple solutions in different regions of {, h}-space are common.
Finally, for this dissertation, the author has derived the following general expression (a
special situation for r = 1 exists) for the L-moments and TL-moments of the Generalized
Lambda. It is fitting to include it within this section.
r(t1 ,t2 )
r1
X
r 1 r + t1 + t2 1
= (r )(r + t1 + t2 )
(1)
j
r
+
t
1
1
j=0
( + r + t1 j)(t2 + j + 1) (r + t1 j)(h + t2 + j + 1)
(9.37)
( + r + t1 + t2 + 1)
(h + r + t1 + t2 + 1)
1
mean = + 1 1
(9.38)
Inspection of the ( ) arguments, which must be > 0, in eq. (9.37) shows that
278
(9.39)
Using R
Using R
and ex. 71 ) for the two distributions are respectively set in PARcau and PARgld by the
parcau() and parTLgld() functions.
910
myloc
<- 3000; myscal <- 40000; n <- 300
set.seed(10) # see comments about random seed in text
fake.dat <- rcauchy(n, location=myloc, scale=myscal)
TLlmr
<- TLmoms(fake.dat, trim=1)
PARcau
<- parcau(TLlmr)
PARgld
<- parTLgld(TLlmr, eps=1e-3, verbose=TRUE)
The demonstration continues in example 911 in which two vectors of quantiles for
each distribution are set in x.cau and x.gld by the quacau() and quagld() functions. The PDFs of the distributions are subsequently computed by the pdfcau() and
pdfgld() functions and are shown in figure 9.5.
911
The figure shows general mimicry of the Cauchy by the Generalized Lambda. However,
the scale of the extremely heavy-tailed Cauchy is large enough to cause solution difficulties with the Generalized Lambda. Readers are asked to repeat examples 910 and
example 911 with set.seed(1) and a substantial departure from the Cauchy will be
seen. Experimentation with the sample size n is also advised.
279
6e06
4e06
2e06
pdfcau(x.cau, PARcau)
8e06
1e+05
5e+04
0e+00
5e+04
1e+05
x.cau
Figure 9.5. Comparison of PDF of Cauchy and Generalized Lambda distributions fit to 300 random samples of CAU(3000, 40000) by method of TL-moments from example 911
9.2.4 Wakeby Distribution
The Wakeby distribution (Houghton, 1978; Landwehr and others, 1979a) is a wildly
flexible distribution because it has five parameters: (location), (scale1), (shape1),
(scale2), and (shape2). The distribution is attractive because it is fit to four or five
L-moments depending on whether is either known or unknown. The Wakeby distribution has the following properties as identified by Hosking and Wallis (1997, p. 205), which
make the Wakeby useful as a tool for advanced distributional analysis:
1. The Wakeby distribution, similarly to the Kappa, can mimic the shapes or even
subsume many of the skewed distributions described herein, including the
Generalized Extreme Value, Generalized Normal, and Pearson Type III;
2. The Wakeby distribution is particularly useful for simulation to study the properties of
simpler distributions and for the study of distribution-form sensitivity during the
study of a problem;
280
3. The Wakeby can acquire a very heavy upper tail, much like the Generalized Lambda
(greater 4 values than can be acquired by the Kappa) and thus can generate large
outliers; and
4. The parameter represents the lower bounds of the Wakeby. For some data sets,
imposition of a lower bound can be useful, but the Wakeby is readily solved if the
lower bounds is unknown.
The Hosking and Wallis (1997) algorithm for Wakeby parameter estimation, which is
used by the lmomco package, fits a Generalized Pareto distribution for some combinations
of L-moments that would otherwise provide parameters that are inconsistent with constraints listed below. Although the Wakeby is flexible, according to the authors experience
with hydrologic data sets, the Wakeby often cannot be fit in practice to a nontrivial number of data sets (well at least data sets of Texas hydrology). However, when pooled or
regional mean or weighted mean L-moments are used (see Section 11.1.2, ex. 117 ), such
L-moments generally can be used to estimate Wakeby parameters.
DISTRIBUTION FUNCTIONS
The distribution functions of the Wakeby having parameters (location), (scale1),
x(F ) = + [1 (1 F ) ] [1 (1 F ) ]
+ > 0 or = = = 0
if
= 0 then
=0
if
= 0 then
=0
0 and + 0
281
(9.40)
(9.41)
xU =
if 0 and > 0
(9.42)
+ / / if < 0 or = 0
+
(1 + ) (1 )
2 =
+
(1 + )(2 + ) (1 )(2 )
(1 )
(1 + )
3 =
+
(1 + )(2 + )(3 + ) (1 )(2 )(3 )
1 = +
(9.43)
(9.44)
(9.45)
(1 )(2 )
(1 + )(2 + )
+
(1 + )(2 + )(3 + )(4 + ) (1 )(2 )(3 )(4 )
(1 )(2 )(3 )
+
5 =
(1 + )(2 + )(3 + )(4 + )(5 + )
(1 + )(2 + )(3 + )
(1 )(2 )(3 )(4 )(5 )
4 =
(9.46)
(9.47)
The following algorithm can be used for computation of the parameters in terms of the
L-moments. If (lower bounds) is unknown, let
N1 = 32 253 + 324
(9.48)
N2 = 32 + 53 + 84
(9.49)
N3 = 32 + 53 + 24
(9.50)
and
(9.51)
C2 = 72 + 253 + 74 255
(9.52)
C3 = 72 + 53 74 55
(9.53)
The parameters and are the larger and smaller roots, respectively, of the quadratic
equation
282
(9.54)
and
= 1
(1 + ) (1 )
(9.55)
(9.56)
(9.57)
N1 = 41 112 + 93
(9.58)
N2 = 2 + 33
(9.59)
N3 = 2 + 3
(9.60)
and
(9.61)
C2 = 2 + 53 44
(9.62)
C 3 = 2 4
(9.63)
Then as before, and are the larger and smaller roots of eq. (9.54) and
(1 + )(2 + ) [1 (2 )2 ]
( + )
(9.64)
(1 )(2 ) [1 (2 + )2 ]
( + )
(9.65)
Using R
Using R
283
ops <- options(warn = -1) # save options, and turn warnings off
#pdf("wakskewness_sweep.pdf", version="1.4")
plot(c(),c(), xlim=c(-3,3), ylim=c(-5,5),
xlab="STANDARD NORMAL DEVIATE",
ylab="QUANTILE") # empty plot with good limits
for(t3 in T3) {
for(t5 in T5) {
lmr <- vec2lmom(c(L1,L2,t3,T4,t5)) # set the L-moments
if(! are.lmom.valid(lmr)) next # skip if they are invalid
wak <- parwak(lmr) # compute Wakeby parameters
cat(c("tau3 =", t3, " and tau5 =", t5, "\n"))
if(wak$ifail == 2) { # GPA fit instead, red lines
lines(qnorm(F),quawak(F,wak),
col=rgb(1,0,0,0.3), lwd=0.5, lty=2)
nogpa <- nogpa + 1 # count of Generalized Pareto fits
cat("
Generalized Pareto fit\n")
next
}
r <- 0
# change colors according to tau3 and tau5 vals
g <- (t3edge - t3)/t3range # less green, tau3 increasing
b <- (t5 - -t5edge)/t5range # more blue, tau5 increasing
284
lines(qnorm(F),quawak(F,wak), lwd=1,
col=rgb(r,g,b, 0.8))
nowak <- nowak + 1 # count of Wakeby fits
Wakeby fit\n")
cat("
Sys.sleep(1) # to pause before moving on to next tau5
}
Sys.sleep(2) # to pause before moving on to next tau3
}
legend(-3,4,c("Generalized Pareto distribution",
"Wakeby distribution"),
lwd=c(0.5,1), lty=c(2,1))
#dev.off()
options(ops) # restore the options, warnings turned back on
0
4
QUANTILE
Figure 9.6. Comparison of Wakeby distributions (and Generalized Pareto, if applicable, dashed
lines) for 1 , 2 , and 4 consistent with standard Normal distribution and 3 and 5 swept
through 0.7 and 0.1, respectively from example 913. Decreasing green is equivalent to
increasing 3 , and increasing blue is equivalent to 5 increasing.
285
The figure shows the substantial range in distribution geometry that can be represented
by the Wakeby as computed by the algorithm in parwak(). The color of each Wakeby
distribution changes according to the values for 3 and 5 . Unfortunately, the constraints
of grey-scale printing limit the effectiveness of the figure. Decreasing green is equivalent
to increasing 3 , and increasing blue is equivalent to 5 increasing. Finally, the counts of
Wakeby and Generalized Pareto fits are shown in the last line of example 913 .
The Wakeby distribution clearly has some complex shapes, and the PDF of the distribution aids in visualization. In example 914 , consistency with select L-moments of the
standard Normal distribution (1 = 0, 2 = 1/2 , and 4 = 0.1226) is set up as was done
in example 912 . Next, a function myWAK() is created to plot PDFs for values of 3 and
5 that are passed as arguments in t3 and t5, respectively. The function uses cdfwak(),
check.pdf(), and quawak() functions.
914
286
The myWAK() function is called six separate times in example 915 and the results
are shown in figures 9.79.12. The parameters of the Wakeby are returned with each call
to myWAK(), but these are not shown in the example. The thick dashed line on the PDF
(bottom plot) is the PDF of the Wakeby superimposed on the results of the check.pdf()
function. For these six figures, the Generalized Pareto is shown only in figure 9.11 because
the Wakeby could not be fit to 3 = 0.1 and 5 = 0.5.
915
myWAK(
0,
myWAK(-0.1,
myWAK( 0.1,
0);
0);
0.5);
myWAK( 0.1,
0)
myWAK( 0.1, 0.1)
myWAK(-0.2, -0.1)
287
0.4
0.0
0.8
Wakeby fit
0.4
0.2
0.0
probability density
Tau3= 0 Tau5= 0
0
x
Figure 9.7. Comparison of QDF and PDF of Wakeby distribution (or Generalized Pareto, if applicable) for 1 , 2 , and 4 consistent with standard Normal distribution and 3 = 0 and 5 = 0
from example 915
0.4
0.0
0.8
Wakeby fit
0.4
0.2
0.0
probability density
1
x
Figure 9.8. Comparison of QDF and PDF of Wakeby distribution (or Generalized Pareto, if applicable) for 1 , 2 , and 4 consistent with standard Normal distribution and 3 = 0.1 and 5 = 0
from example 915
288
0.4
0.0
0.8
Wakeby fit
0.4
0.2
0.0
probability density
0
x
Figure 9.9. Comparison of QDF and PDF of Wakeby distribution (or Generalized Pareto, if applicable) for 1 , 2 , and 4 consistent with standard Normal distribution and 3 = 0.1 and 5 = 0
from example 915
0.4
0.0
0.8
Wakeby fit
0.3
0.2
0.1
0.0
probability density
4
x
Figure 9.10. Comparison of QDF and PDF of Wakeby distribution (or Generalized Pareto, if applicable) for 1 , 2 , and 4 consistent with standard Normal distribution and 3 = 0.1 and
5 = 0.1 from example 915
289
0.4
0.0
0.8
0.2
0.3
0.4
0.1
probability density
Figure 9.11. Comparison of QDF and PDF of Wakeby distribution (or Generalized Pareto, if applicable) for 1 , 2 , and 4 consistent with standard Normal distribution and 3 = 0.1 and
5 = 0.5 from example 915
0.4
0.0
0.8
Wakeby fit
1.2
0.8
0.4
0.0
probability density
1
x
Figure 9.12. Comparison of QDF and PDF of Wakeby distribution (or Generalized Pareto, if applicable) for 1 , 2 , and 4 consistent with standard Normal distribution and 3 = 0.2 and
5 = 0.1 from example 915
290
determine the global end points of the quantiles so that for later plotting purposes the
horizontal axis for each PDF will have the same extent. Seven distributions are left off
the Cauchy because TL-moments are needed, the Generalized Lambda to avoid treatment
for multiple solutions, Kumaraswamy to avoid a nonconvergence error and log-Normal3,
Rayleigh, Reverse Gumbel, and Rice because four more distributions would simply compress the graphical output in figure 9.13 too much for effective presentation.
916
L1 <- 900; L2 <- 500; T3 <- 0.1; T4 <- -0.1; T5 <- 0.04
lmr <- vec2lmom(c(L1,L2,T3,T4,T5))
dist <- dist.list() # return list of dist. abbreviations
dist <- dist[dist != "cau" & dist != "gld"
&
dist != "kur" & dist != "ln3"
&
dist != "ray" & dist != "revgum" &
dist != "rice"]
F <- nonexceeds()
# convenient values
my.min <- Inf; my.max <- -Inf # for global end points
for(d in dist) { # used to find global end points
my.para <- lmom2par(lmr, type=d)
x <- qlmomco(F,my.para)
my.min <- min(x,my.min); my.max <- max(x,my.max)
}
The demonstration continues in example 917 with similar structure to example 916
but with the addition of plotting operations. The results are shown in figure 9.13. For
the example the qlmomco() and dlmomco() functions respectively provide the QDF
and PDF of the respectively distribution in the variable d. A previously not identified
function, prettydist(), returns the corresponding full name for the distribution so
that the individual plots can be labeled.
291
#pdf("alldist.pdf")
n <- length(dist) # how long is that list?
layout(matrix(1:n, ncol=n%/%4)) # at time of writing---three cols
for(d in dist) {
my.para <- lmom2par(lmr, type=d)
x <- qlmomco(F,my.para)
plot(x, dlmomco(x,my.para), type="l", ylab = "DENSITY",
xlim=c(my.min,my.max))
mtext(prettydist(d)) # place distribution name above plot
}
#dev.off()
Inspection of the figure suggests that the PDF of the Generalized Pareto and Wakeby
distributions are similar. Actually, they are identical. The Wakeby algorithm could not find
a solution and reverted to that for the Generalized Pareto. Therefore, the plot is technically
mislabeled in the figure. The Generalized Pareto looks so different from the other five
three-parameter distributions because at 3 = 0.1, the Generalized Pareto has much less
4 than the other distributions. Readers are guided to figure 10.6 in the context of 3 and 4
comparison. Finally, readers might find it informative to experiment with examples 916
and 917 by changing the 3 , 4 , and 5 values in T3, T4, and T5, respectively.
Now, considering 4 in more detail, the PDF for the Kappa distribution in figure 9.13 has
considerable distortion on the left and right tails because of extremely large probability
density on the edges (in the tails). Why does the PDF of the Kappa look so different from
the other examples?
Before answering the question, an alternative plot of the PDF is useful and created by
example 918 . The results are shown in figure 9.14. The figure clearly provides for better
resolution and shows that numerical singularities do not exist as the lower resolution of
figure 9.13 suggests.
918
#pdf("kappdf.pdf")
check.pdf(pdfkap,parkap(lmr), plot=TRUE,
plotlowerF=0.1, plotupperF=0.9)
#dev.off()
Similar plotting of narrower tails, such as provided by the options plotlowerF and
plotupperF to check.pdf(), occasionally is needed for this and other distributions
for effective graphical depiction of the PDF structure for specific combinations of parameters. The check.pdf() function thus provides a convenient interface for PDF plotting
purposes.
292
2000
4e04
Normal
0e+00
DENSITY
4e04
6000
2000
Gamma
Generalized Pareto
2000
2000
0e+00
1e04
6000
4e04
DENSITY
6000
2000
Gumbel
Wakeby
DENSITY
0e+00
DENSITY
6000
2000
6000
2000
Generalized Logistic
Kappa
Weibull
2000
6000
2000
6000
6000
0e+00
DENSITY
2
0
4e04
DENSITY
0e+00
5e04
2000
6000
1e04
5e04
4e04
6000
DENSITY
0.005
6000
0e+00
DENSITY
DENSITY
2000
0.000
DENSITY
Generalized Normal
0e+00
DENSITY
1e03
Exponential
0e+00
DENSITY
2000
6000
Figure 9.13. Comparison of PDF for twelve distributions fit to L-moments from example 917
Returning to the answer posed by the earlier question, for the example L-moments here,
the negative 4 used in the example produces anti-peaking. (There is no central peak or
mode.) This is the effect of 4 < 0. The other 11 (well 10, considering that the Generalized
Pareto is shown twice) in figure 9.13 all have less than four parameters. As a result, none of
the distributions is actually fit to the specified 4 . Each has its own 4 of course, but none
can acquire the condition of 4 < 0. Therefore, the anti-peaking distribution geometry of
293
the L-moments in variable lmr in example 916 is only mimickedthat is, seenby the
0.0025
0.0015
0.0005
probability density
0.0035
Kappa distribution.
500
1000
1500
2000
Figure 9.14. Alternative depiction of PDF of Kappa distribution shown in figure 9.13 from example 918
Finally, to end this section and again using the Kappa distribution, the influence of positive and negative 4 and the relation to the peakedness of the distribution is demonstrated.
#pdf("kappeak.pdf")
layout(matrix(1:2, ncol=1))
top <- vec2lmom(c(0,1/sqrt(pi),0, 0.01)) # positive L-kurtosis
bot <- vec2lmom(c(0,1/sqrt(pi),0,-0.01)) # negative L-kurtosis
check.pdf(pdfkap,parkap(top), plot=TRUE,
plotlowerF=0.1, plotupperF=0.9)
check.pdf(pdfkap,parkap(bot), plot=TRUE,
plotlowerF=0.1, plotupperF=0.9)
#dev.off()
294
The differences in the PDFs are striking, yet figure 9.15 has a pleasant sort of symmetry for
0.290
0.275
probability density
1.0
0.5
0.0
0.5
1.0
0.5
1.0
0.320
0.305
0.290
probability density
1.0
0.5
0.0
x
Figure 9.15. Comparison of symmetrical PDFs of two Kappa distributions having positive (top)
and negative (bottom) 4 values of equivalent magnitude from example example 919
9.4 Summary
Four- and more parameter distributions are substantially more flexible than are threeparameter distributions. The four- and more parameter distributions considered in this
chapter are fit to at least the first four L-moments of the data. Both the lmomco and lmom
packages provide support for the Kappa and Wakeby distributions. The lmomco package
in particular offers the addition of the Generalized Lambda distribution; the Generalized
Lambda can be problematic in practice because multiple solutions can exist. The additional flexibility of four- and more parameter distributions requires reliable estimation
of at least four L-moments and thus larger samples sizes are required than are needed
for lower-order distributions. The tail shapes of four- and more parameter distributions
295
might provide for more accurate quantile estimation in the far tails provided that sample
sizes are sufficiently large to support reliable 4 and 5 estimation. Conversely, these distributions might provide for substantially biased quantile estimates in circumstances in
which sample sizes are insufficient to make reliable estimation of distribution parameters.
The 19 examples repeat themes established previously in this dissertation, but some of
the Generalized Lambda and Wakeby examples demonstrate the considerable nuances
of these distributions in practice. Finally, Section 9.3 shows that the high-level functionality of the lmomco package facilitates experimentation with L-moments and distributional
form, and that section effectively closes the content of Chapters 7 and 8.
The examples for the Kappa distribution consider the distribution of annual peak
streamflow data for a location in Texas that are contained within the lmomco package.
The streamflow exhibits remarkable variability and skewness. The Kappa distribution is fit to the L-moments and plotted. The Kappa acceptably fits the right tail (the
flood-flow tail and tail of interest). Subsequent examples fit the Generalized Normal
distribution to the L-moments along with the log-Normal. Although not attaining the
quality of fit of the Kappa mostly because of having only three parameters, the Generalized Normal also mimics the geometry of the data. The log-Normal (two parameter)
does not have an acceptable fitthe data possess more curvature than this distribution can attain.
The examples for the Generalized Lambda distribution repeat consideration of the
distribution of annual peak streamflow data used for the Kappa examples. The Generalized Lambda is fit to the L-moments of the data and is plotted along side the
Kappa. The default Generalized Lambda solution returned by a function of lmomco
exhibits excessive flattening in the right tail (again the flood-flow tail and tail of interest). Therefore, a secondary solution is found that more closely matches the Kappa.
The difficulty in using the Generalized Lambda in practice thus is shown.
The examples for the Trimmed Generalized Lambda distribution demonstrate an
approximation to the Cauchy distribution.
The examples for the Wakeby distribution are extensive because of the complexity of
the five-parameter version of the Wakeby. Various QDF variations that are departures
from the 1 , 2 , and 4 of the standard Normal distribution are created by changing
the 3 and 5 of the distribution and all plotted on the same figure. The examples
also provide various PDF variations that are departures from an otherwise standard
296
Normal distribution. The PDF variations are created by changing the 3 and 5 values,
and these PDFs are separately plotted. For one of the PDFs, a Wakeby could not be
fit and the backup fit of the Generalized Pareto is shown instead. So the examples, do
show the fitting of a Generalized Pareto in circumstances in which the Wakeby is not
applicable.
297
Chapter 10
L-moment Ratio Diagrams
In this chapter, I present discussion of L-moment ratio diagrams. These diagrams are
extremely useful in application of L-moment statistics because they permit differentiating between many distributions. The diagrams permit visual description of distributionspecific interrelations between selected L-moment ratios. The diagrams are commonly
used for ad-hoc selection (a sort of goodness-of-fit) of a distribution from a ensemble of
candidate distributions. The diagrams are quite common in the L-moment literature and
are an important part of exploratory analysis. Compared to other chapters, this chapter
is the most similar to a conventional paper on the topic and should be especially accessible to many readers. This chapter is central to distributional analysis with L-moment
statistics using R.
10.1 Introduction
Probability distributions are distinguished by their formal mathematical definition,
moments, and respective parameter values. As a result, distributions have specific and
generally unique intra-relations (within distribution) between moments and parameters.
As seen in this chapter, the intra-moment relations of L-moments are a convenient and
powerful tool for discriminating between distributional form. The intra-moment relations
also provide a means for ad hoc, yet reliable, judgement of goodness-of-fit, and hence,
the relations guide the process of distribution evaluation and selection from a suite of
candidate distributions.
As a means to guide the selection of a distribution, a convenient graphical construct,
which is termed a moment ratio diagram, provides a visualization of intra-moment relations. The moment ratio diagram often is used to depict the relation between relative vari298
axis). Although perhaps obtuse at first introduction, the diagram has numerous components that will be familiar by the end of this chapter.
The diagrams are effective tools for visualizing the relations between the pair {3 , 4 } of
a distribution and the locations of the {
3 , 4 } from samples. The relations or spatial differences on the diagram help guide the analyst in the selection of distributions. An example
of a well-typeset L-moment ratio diagram, which is derived from Asquith and others
(2006), is shown in figure 10.1. The diagram shows the intra-moment relation between
3 and 4 for selected distributions as well as hundreds of samples from two phenomena
types. Several interpretations of the contents of the figure are possible as shown by the
following discussion.
Two-parameter distributions, when possessing location and scale parameters, have
constant values for both 3 and 4 regardless of the values for 1 and 2 , and such twoparameter distributions plot as special points on the diagram. For example, the Normal
distribution, which is not plotted in the figure because of the selected horizontal axis
scale, has 3nor = 0 and 4nor 0.123 (see Section 7.2.1). Whereas the Exponential distribuexp
exp
tion, which is shown in figure 10.1, has {3 , 4 } = {0.333, 0.167}. The two-parameter
Gamma distribution is different because the distribution lacks a location parameter and
does not have constant values for 3 and 4 . Instead, the Gamma exists along the line of
the Pearson Type III distribution. The Gamma is further discussed later in this chapter.
In contrast to two-parameter distributions, three-parameter distributions, when possessing location, scale, and shape parameters, trace a unique trajectory or curvilinear path
through the {3 , 4 }-parameter space of the diagram. The trajectories of four selected
three-parameter distributions are shown in figure 10.1: the Generalized Extreme Value,
Generalized Logistic, Generalized Pareto, and Pearson Type III distributions.
In contrast to three-parameter distributions, distributions with more than one shape
parametergenerally distributions with four or more parameterscover or occupy a
region or regions of the diagram. The Kappa distribution is such an example, and, for
a given 3 , the Kappa occupies the region below the 4 of the Generalized Logistic and
above the 4 of the theoretical limits of the L-moments. The bottom graph in figure 10.1
shows the range of the Kappa by the extent of the line with arrows on both ends. The
Generalized Lambda (Karvanen and Nuutinen, 2008) and Wakeby (Hosking and Wallis,
1997) distributions have more complex parameter spaces and are not easily illustrated.
The L-moment ratio diagram in figure 10.1 also shows individual 3 and 4 values
(the two circle types) computed from real-world data. The L-moment ratio diagram was
300
L-KURTOSIS, DIMENSIONLESS
A.
0.6
0.4
Box represents
boundaries of
plot B.
0.2
0
-0.2
-0.3
0.1
0.2
0.3
0.5
0.5
0.6
0.7
0.8
0.9
B.
L-KURTOSIS, DIMENSIONLESS
0.4
L-SKEW, DIMENSIONLESS
0.4
0.3
0.2
Distribution names
stic
Logi
e
lized
Valu
a
r
e
me
Gen
xtre
E
ized
eral
Exponential
Ge n
Ty
Pearson
0.1
a li z
ner
Ge
Th
pe III
ed
eto
Par
re
eo
L
al
tic
im
it s
0
0.2
0.3
0.4
0.5
L-SKEW, DIMENSIONLESS
0.6
0.65
Figure 10.1. High-quality L-moment ratio diagram showing L-skew and L-kurtosis of selected distribuions and sample values for storm depth and storm duration from Asquith and others (2006)
developed as part of a large-scale study of the statistics of storms throughout eastern New
Mexico, Oklahoma, and Texas (Asquith and others, 2006). For each of 774 locations with
hourly raingages, literally thousands of storms per location were extracted, and the sample
L-moments of storm depth and the sample L-moments of storm volume for each location
were computed. The 3 and 4 for storm depth (total depth of rainfall) are plotted in the
figure as open circles, and the 3 and 4 for storm duration are plotted as grey circles.
301
Several interpretive observations of the data shown in the diagram (fig. 10.1) can be
made:
1. The top graph shows that both rainfall phenomena have positive skewness and mild
kurtosis;
2. The data have a strong tendency to plot in a relatively restricted portion of the
L-moment ratio diagram. It is important to note that the locations of the raingages
are distributed throughout a large geographic region (on the order of 370,000 square
miles); and
3. The central tendency of 3 and 4 is important. The 3 and 4 for either storm phenomena (storm depth and storm duration) cluster around {
3 , 4 } = {0.50, 0.27} for
storm depth and {
3 , 4 } = {0.48, 0.23} for storm duration. These two pairs of 3 and
4 are derived from Asquith and others (2006, tables 5 and 6). The overlap of the data
clouds and general numerical similarity of the 3 and 4 of the two phenomena suggests that the general asymmetry and shape of the two unknown parent distributions
of distinct phenomena are similar.
Continuing with interpretations of figure 10.1, the Pearson Type III distribution curve
passes close to the {3 , 4 } pairings for both storm depth and storm duration. Hence, a
conclusion is, should a three-parameter distribution be selected, that the Pearson Type III
would provide a favorable choice for generalized modeling of these rainfall phenomena.
For additional interpretation, the 3 and 4 values are almost universally below the lines
for the Generalized Extreme Value and Generalized Logistic distributions, and the sample
sizes are large enough to judge that 3 and 4 are reliably estimated. Both the Generalized
Extreme Value and Generalized Logistic distributions would be poor choices from the
perspective of the regional (geographic) form of the parent distribution. The Generalized
Pareto, although a better choice than either the Generalized Extreme Value or Generalized
gpa
the Pearson Type III would be the four-parameter Kappa distribution because the Kappa
could match the record-length weighted mean values of 3 and 4 . Asquith and others
(2006) concluded that the Kappa distribution is preferable to model the unknown parent
distribution of rainfall depth and duration in their study area.
302
Using R
Using R
To further illustrate interpretations of L-moment ratio diagrams, numerical experiments are performed using functions from the lmomco package. The demonstration begins
in example 101 by specifying the first four L-moments using the vec2lmom() function.
For later reference, primary interest concerns the values for {3 , 4 } = {0.4, 0.4}. Next,
the parameters are computed using the parXXX() functions (see table 7.4 for a listing)
for three selected distributions: Gamma (gam), Generalized Logistic (glo), and Pearson
Type III (pe3) by the parglo(), parpe3(), and pargam() functions, respectively.
101
Continuing in example 102 , two vectors are created to store sample values 3 and 4 .
These vectors are used for subsequent plotting operations in later examples.
102
Example 103 establishes an arbitrary sample size of n = 20 and performs 50 simulations of three independent n = 20 drawings from the three distributions by the
rlmomco() function. The nsim=50 simulation size is too small for rigorous numerical
study but is sufficiently large for effective demonstration of key concepts of L-moment
ratio diagrams. The rlmomco() function dispatches n random F values to the appropriate quaXXX() functions (see table 7.3 for a listing). Following each sample drawing for
each distribution, the L-moments are computed by the lmoms() function, and the 3 and
303
The results of the simulation are plotted finally in figure 10.2 using example 104 . In
the example, the plot is initiated, and the {
3 , 4 } values for Gamma, Generalized Logistic,
and Pearson Type III distributions are plotted as open squares (pch=0), open triangles
(pch=2), and filled circles (pch=16), respectively. For each of the three distributions, the
mean values of the 50 values of 3 and 4 are plotted as the large symbol shapes. The
intersection of the horizontal and vertical lines in the interior of the plot, which are drawn
by the segments() function, cross at the location of the 3 and 4 of the population.
104
#pdf("lmr1.pdf")
plot(t3pe3,t4pe3, ylim=c(0,0.7), xlim=c(0,0.8), type="n",
xlab="L-SKEW", ylab="L-KURTOSIS")
points(t3gam,t4gam, pch=0)
points(t3glo,t4glo, pch=2)
points(t3pe3,t4pe3, pch=16, col=rgb(0.6,0.6,0.6))
points(mean(t3gam),mean(t4gam),pch=22,bg=rgb(1,1,1),
cex=3)
points(mean(t3glo),mean(t4glo),pch=24,bg=rgb(1,1,1),
cex=3)
points(mean(t3pe3),mean(t4pe3),pch=21,bg=rgb(.6,.6,.6),cex=3)
segments(t3,-1, t3,1); segments(-1,t4, 1,t4)
#dev.off()
To further illustrate the interpretation of L-moment ratio diagrams, the sample size is
increased by an order of magnitude to n = 200, and examples 103 and 104 rerun. The
results are shown in figure 10.3. The larger sample size reduces sample variability, and
therefore, the data points in figure 10.3 define more visually distinct or separable regions
that have more consistency with the trajectory of each parent distribution. These regions
are identifiable as separatethis is a major feature of the diagrams. The regions show that
the three distributions (and others) are readily distinguished on L-moment ratio diagrams
of 3 and 4 . The diagrams hence can guide analysts towards a distribution that might be
304
Pearson Type III distributions are closely related distributions. It is not a coincidence that
the large square plots in the region where it does because the Gamma distribution exists
pe3
pe3
along the Pearson Type III trajectory of {3 , 4 }. Both the Gamma and Pearson Type
III distributions are further discussed in the next section.
4 =
8
X
Aj 3 j
(10.1)
j=0
where the coefficients Aj for selected three parameter distributions are listed in table 10.1.
Hosking and Wallis (1997, p. 208) also report that the approximations produce 4 values
305
0.6
0.7
0.4
0.3
0.2
LKURTOSIS
0.5
0.0
0.0
0.1
0.2
0.4
0.6
0.8
LSKEW
Figure 10.2. L-moment ratio diagram showing 50 sample simulations of L-skew and L-kurtosis for
n = 20 samples drawn from three distributions from example 104
within 0.0005 over the range 0.9 3 0.9, except for the Generalized Extreme Value
distribution, for which the 0.0005 accuracy is available only when 0.6 3 0.9.
Using R
Using R
306
0.4
0.3
0.0
0.1
0.2
LKURTOSIS
0.5
0.6
0.7
0.0
0.2
0.4
0.6
0.8
LSKEW
Figure 10.3. L-moment ratio diagram showing 50 sample simulations of L-skew and L-kurtosis for
n = 200 samples drawn from three distributions based on examples 103 and 104
Table 10.1. Coefficients for polynomial approximations of L-kurtosis as a function of L-skew for
selected distributions
[ GEV, Generalized Extreme Value distribution; GLO, Generalized Logistic distribution; GNO,
Generalized Normal distribution; PE3, Pearson Type III distribution; --, implies a coefficient of
zero ]
A0
A1
A2
A3
A4
A5
A6
A7
A8
GEV
GLO
GNO
GPA
PE3
0.10701
.11090
.84838
.06669
.00567
.04208
.03763
0.16667
0.12282
0.12240
--
--
0.
.20196
.95924
.20096
.04061
---
.83333
-------
.77518
--
.12279
--
.13638
--
.11368
307
-----
--
.30115
--
.95812
--
.57488
--
.19383
gum
distribution.
Considering again figure 10.3 and the examples from the previous section, if the following three lines in example 106 are added to the end of example 104 and executed
after examples 101 103 , then the trajectories of 3 and 4 for the Pearson Type III and
the Generalized Logistic distributions become superimposed on the plot. The results are
shown in figure 10.4. The Generalized Logistic is shown by the thin line and the Pearson
Type III by the thick line.
106
The Gamma distribution is closely related to the Pearson Type III; the Gamma can
acquire the same 3 and 4 combinations as the Pearson Type III. However, a fitted Gamma
distribution will not plot at the same 3 and 4 values as a fitted Pearson Type III for a
given data set (L-moment combination)the two distributions are different. The Gamma
has two parameters and the Pearson Type III has three. The large square (the mean of the
gam
gam
{3 , 4 } loci) in figure 10.4 thus is plotted effectively on the Pearson Type III curve
and will plot on the curve for sufficiently large sample sizes.
The general construction of an L-moment ratio diagram is made in example 107 . The
resulting diagram is shown in figure 10.5. The plotlmrdia() function provides a highlevel interface for plotting L-moment ratio diagrams. The diagram shown in figure 10.5 is
a full perspective diagram because the entire range of 3 and 4 is depicted. The range
of 3 is 1 < 3 < 1 (eq. (6.28)), and the Theoretical limits line demarks the base of the
1
(53 2
4
1) 4 < 1 relation (eq. (6.29)). The figure is generated with selected colors for
308
0.4
0.3
0.0
0.1
0.2
LKURTOSIS
0.5
0.6
0.7
0.0
0.2
0.4
0.6
0.8
LSKEW
Figure 10.4. L-moment ratio diagram showing 50 sample simulations of L-skew and L-kurtosis
values for n = 200 samples drawn from three distributions with superimposed theoretical lines
for the Generalized Logistic distribution (thin line) and Pearson Type III distribution (thick line)
from examples 104 and 106
107
The lmrdia() function returns an R list containing matrices of the 3 and 4 values for
selected distributions. The plotlmrdia() function accepts (expects) the list returned by
lmrdia(). The plotlmrdia() function has a variety of named arguments to configure
the diagram. Example 107 show the autogeneration of a distribution legend with the
origin of the legend at {3 , 4 } = {0, 1}.
The distributions depicted in figure 10.5 plot as either points or lines. Some largeparameter distributions such as the Generalized Lambda (four parameter), Wakeby (five
parameter), and quantile mixtures (see Karvanen, 2009) occupy difficult to depict regions
309
kap
of the diagram. The region of {3 , 4 } for the Kappa distribution was shown by anno-
0.8
1.0
0.4
0.2
LKURTOSIS
0.6
Theoretical limits
GEV
GLO
GNO
GPA
PE3
EXP
NOR
GUM
RAY
UNI
0.2
0.0
1.0
0.5
0.0
0.5
1.0
LSKEW
Figure 10.5. Default L-moment ratio diagram provided by package lmomco from example 107
Natural phenomena often are generated from random variables that are strictly positive.
As a result, it is common for sample distributions to be positively skewed. A particularly
useful L-moment ratio diagram for studying such distributions is shown in figure 10.6,
which was produced by example 108 . The diagram encompasses generally positive, but
not strictly positive 3 , to accommodate vagaries of sampling. An L-moment ratio diagram
with the limits as shown in the figure will often provide an appropriate base figure for
many situations of distributional analysis of natural phenomena.
108
#pdf("lmr5.pdf")
plotlmrdia(lmrdia(), autolegend=TRUE, nopoints=TRUE,
xleg=0.1, yleg=0.41,
xlim=c(-0.1,0.5), ylim=c(-0.1,0.4))
#dev.off()
J
310
0.4
0.2
0.1
0.1
0.0
LKURTOSIS
0.3
Theoretical limits
GEV
GLO
GNO
GPA
PE3
0.1
0.0
0.1
0.2
0.3
0.4
0.5
LSKEW
Figure 10.6. More typical L-moment ratio diagram for generally positively skewed phenomena
provided by package lmomco from example 108
In example 109 , some arbitrary population L-moment values are selected (1 =
10000, 2 = 7500, 3 = 0.3, and 4 = 0.2). A sample size of n = 30 and the number
of simulations to demonstrate nsim are set. The vec2lmom() and parkap() functions
are used to set the L-moments and compute the Kappa parameters. Two temporary vectors t3 and t4 also are created. These vectors are filled within the for() loop with values
of 3 and 4 from simulated Kappa quantiles computed by the rlmomco() function that
are then passed to the lmoms() function. After the t3 and t4 vectors are populated, each
vector is plotted on an L-moment ratio diagram in figure 10.7. The lines of code containing
the two points() functions show how the plotting operations were made for the figure.
109
311
0.4
0.3
0.2
0.1
LKURTOSIS
Theoretical limits
GEV
GLO
GNO
GPA
PE3
0.1
0.0
0.1
0.0
0.1
0.2
0.3
0.4
0.5
LSKEW
Figure 10.7. L-moment ratio diagram shown distribution of 50 sample simulations of of L-skew
and L-kurtosis for n = 30 samples drawn from a KAP(10000, 7500, 0.3, 0.2) distribution from
example 109
The diagram also shows the intersection of the population {3 , 4 } values by the horizontal and vertical crossing lines, and the large filled circle is plotted at the mean()
values of the t3 and t4 vectors. The diagram shows, like the simulations that produced
312
10.4 Summary
In this chapter, L-moment ratio diagrams are introduced and specifically diagrams of 3
and 4 are described. Such diagrams are useful for distinguishing between distributional
form because specific intra-momentthat is conceptually uniquerelations exist for each
distribution. Detailed description of the general interpretation of the diagrams is provided.
The 9 examples in the chapter demonstrate how sampling variability affects graphical
interpretation and demonstrate the construction of L-moment ratio diagrams using the
lmomco package.
There are other forms of L-moment ratio diagrams in use including diagrams of 2
versus 3 (Vogel and others, 2008) and 4 versus 6 (Hosking and others, 2000; Hosking,
2007b). The former are useful for evaluation of two-parameter distributions, whereas the
latter are useful for evaluation of distribution form for generally symmetrical distributions.
Neither of these diagrams are otherwise discussed in this dissertation.
313
Chapter 11
Short Studies of Statistical Regionalization
In this chapter, I present two short studies concerning original distributional analysis of
hydrologic data using L-moment statistics. This chapter is intended to provide a look
and feel of distributional analysis using L-moments and the lmomco package for decidedly non-Normal data and provide guidance into regionalization of hydrometeorological data. This chapter is dependent on many concepts and functions described and
demonstrated in previous chapters, and general familiarity with L-moments, distributions, and L-moment ratio diagrams is assumed. Several nuances of distribution fit and
solution choice are described. This chapter could be especially useful to some less experienced readers expecting to conduct their own distributional analysis. Therefore, this
chapter in a way blue prints a simple form distributional analysis with L-moment
statistics using R.
Specifically, the largest total rainfall for 7 consecutive days per year.
314
ima in the study area. Hosking and Wallis (1993; 1997) describe an extensive L-momentbased regionalization method based partly on this assumption, and other studies using
this assumption are readily found in the literature of this discipline.
The analysis begins by loading seven individual data sets that are provided in the
lmomco package. Each data set is identified in example 111 and represents a time series of
annual 7-day rainfall maxima. The communities are Amarillo, Canyon, Claude, Hereford,
Tulia, and Vega. The tulia6Eprecip location is about 6 miles east of Tulia. Collectively,
these communities represent an area of approximately 1,400 square miles.
111
data(amarilloprecip)
data(canyonprecip)
data(claudeprecip)
data(herefordprecip)
data(tuliaprecip)
data(tulia6Eprecip)
data(vegaprecip)
The loading of the data in example 112 is followed by placing the DEPTHs into
variables with abbreviated names of the community. A sort() operation also is made
because only sorted data are needed for the analysis; no evaluation of climatic cycles or
trends is made and an assumption of stationarity is implicitly made.
112
AMAR
CANY
CLAU
HERF
TULA
TUL6
VEGA
<<<<<<<-
sort(amarilloprecip$DEPTH)
sort(canyonprecip$DEPTH)
sort(claudeprecip$DEPTH)
sort(herefordprecip$DEPTH)
sort(tuliaprecip$DEPTH)
sort(tulia6Eprecip$DEPTH)
sort(vegaprecip$DEPTH)
The distributional analysis initiates with a graphical review using box plots of the distribution of the rainfall data for each community. The box plots are shown in figure 11.1,
which was created by example 113 . In the example, the lengths of the record are computed and set into the w variable. These lengths are used as weights for a weighted-mean
computation in a subsequent example.
316
8
6
4
2
0
10
AMAR
CANY
CLAU
HERF
TULA
TUL6
VEGA
Figure 11.1. Box plots of the distributions of 7-day annual maxima rainfall for seven communities
in the north-central Texas Panhandle from example 113
The box plots show that the typical location or central tendency of the seven distributions is about 3.75 inches. The individual interquartile range or IQRs of the seven distributions also are similar. Although exhibiting apparent differences in the distal-tail regions,
the data clearly have positive 3 . For the analysis here, it is assumed that the observed differences in distribution geometry represent vagaries of sampling from a common parent
distribution.
317
Additional variations on box plots exist to assess distributional geometry. The R packages beanplot by Kampstra (2008a) and vioplot by Adler (2005) provide functions of the
respective names that produce bean plots and violin plots. These two plot types can be
used to depict the probability density of the data in a style that is unattainable by the
conventional box plot. Kampstra (2008b) provides additional description of bean plots.
Example 114 demonstrates the application of these plots and the results are shown in
figure 11.2.
114
library("beanplot"); library("vioplot")
rng <- sapply(x, range) # x from previous example
ylim <- c(min(rng[1,]), max(rng[2,]))
#pdf("texas_panhandle_beanvio.pdf");
par(mfrow=c(2,1), mai=c(0.5,1,0.5,0.5) )
beanplot(x, ll=0.04, main="BEAN PLOT: beanplot()", log="",
ylim=ylim, ylab="7-DAY ANNUAL MAX RAINFALL,\n IN INCHES",
overallline="median")
cities <- names(x); data <- x # get names and make a copy
names(data)[1] <- "x" # modify the copy
do.call("vioplot",c(data, list(ylim=ylim, names=cities,
col="white")))
title(main="VIOLIN PLOT: vioplot()",
ylab="7-DAY ANNUAL MAX RAINFALL,\n IN INCHES")
#dev.off()
The bean plots show the density as the curved hull around the individual data points
(beans or kernels). The beanplot() function also depicts that overall median of the
seven data groups as the dotted horizontal line. The violin plots also show the density,
but truncate the density at the minimum and maximum values. Inside each violin is a
more-or-less conventional box plot. Both beanplot() and vioplot() functions each
have numerous configuration options.
Continuing with the analysis, the Weibull plotting-positions and sample L-moments of
the rainfall data are computed in example 115 , and set into 14 concise variable names.
The plotting positions are used in subsequent plotting operations, and the L-moments are
used to fit probability distributions using the method of L-moments.
115
AMAR.pp
CLAU.pp
TULA.pp
VEGA.pp
<<<<-
pp(AMAR);
pp(CLAU);
pp(TULA);
pp(VEGA)
318
10
8
6
4
2
0
AMAR
CANY
CLAU
HERF
TULA
TUL6
VEGA
10
8
6
4
HERF
TULA
AMAR
CANY
CLAU
TUL6
VEGA
Figure 11.2. Bean and violin plots of the distributions of 7-day annual maxima rainfall for seven
communities in the north-central Texas Panhandle from example 114
AMAR.lmr
CLAU.lmr
TULA.lmr
VEGA.lmr
<<<<-
lmoms(AMAR);
lmoms(CLAU);
lmoms(TULA);
lmoms(VEGA)
As part of the analysis, weighted-mean values of the sample L-moments are needed.
To simplify later code, it is useful to have the sample L-moments collected into individual
variables. This is done in example 116 by long-hand placement into the variable L1 for
, and using a convenience function named afunc() for , , and , in variables T2,
1
2 3
4
to account for
T3, and T4, respectively. The example shows the multiplication of 1.018
1
a recording bias attributable to a 7-day interval as developed by Weiss (1964) and used by
Asquith (1998, table 1).
319
Regional values for the sample L-moments (regional L-moments) are computed in
example 117 using the weighted.mean() function using the weights in w from example 113 . The example continues with the selection of the Kappa distribution for modeling.
The Kappa distribution often is a highly suitable distribution to model hydrometeorological data sets provided that 4 values are less than those of the Generalized Logistic
distribution (see Chapter 10).
117
reg.L1
reg.T3
reg.lmr
reg.kap
<<<<-
320
[1] "parkap"
$ifail
[1] 0
$ifailtext
[1] "Successful parameter estimation."
Example 117 shows that the Kappa is successfully fit to the regional L-moments and
forms a regional Kappa distribution, and the fitted distribution is
0.9135
1 F 0.5674
P7-day (F ) = 3.414 +
1
0.1390
0.5674
(11.1)
where P7-day is the 7-day annual maximum rainfall in inches for F (nonexceedance probability).
The L-moment ratio diagram is created in example 118 and shown in figure 11.3. The
diagram shows that the regional value (filled circle) for 4 (and generally the 4 for each
community) is larger than that for all the three-parameter distributions with the exception
of the Generalized Logistic. In fact, the regional value for 4 is almost as large as that for
the Generalized Logistic; in this circumstance the Kappa distribution can just barely be
fit.
118
#pdf("texas_panhandle_lmrdia.pdf")
lmrdia <- lmrdia()
plotlmrdia(lmrdia,autolegend=TRUE, nopoints=TRUE,
nolimits=TRUE, xlim=c(0,0.3), ylim=c(-0.1,0.4),
xleg=0.05, yleg=0.3)
points(T3,T4)
points(reg.T3,reg.T4, pch=16, cex=2)
#dev.off()
321
0.2
GEV
GLO
GNO
GPA
PE3
0.1
0.1
0.0
LKURTOSIS
0.3
0.4
0.00
0.05
0.10
0.15
0.20
0.25
0.30
LSKEW
Figure 11.3. L-moment ratio diagram showing 3 and 4 of 7-day annual maximum rainfall for
seven communities in Texas Panhandle (open circles) and weighted mean value (filled circle)
from example 118
119
322
8
6
4
0
10
12
0.0
0.2
0.4
0.6
0.8
1.0
NONEXCEEDANCE PROBABILITY
Figure 11.4. Empirical distribution of 7-day annual maxima rainfall for seven communities in the
Texas PanhandleDashed lines show intersection of 100-year event from regional Kappa distribution (thick line) from example 119.
The purpose of the distributional analysis here is to estimate the 100-year, 7-day annual
maximum rainfall depth. In the example, the T2prob() function is used to compute the F
of the 100-year event (F = 0.99). The dashed lines in figure 11.4 indicate the solution. The
analysis is completed by outputting the 100-year event in variable PT in example 1110 .
The output shows that the estimated 100-year, 7-day rainfall depth is about 9.29 inches.
1110
print(PT)
[1] 9.293368
Asquith and Roussel (2004, p. 82) report that the 100-year, 7-day annual maximum rainfall for the approximate geographic center of the seven communities is about 9.3 inches.
Their analysis was based on regionalized parameters of a Generalized Extreme Value
distribution fit by the method of L-moments to each station (the 7 here and another 858
across Texas) by Asquith (1998).The two rainfall depths of 9.29 and 9.3 inches compare
favorably. The computational reliability of some of the lmomco algorithms (circa 2008) com-
323
pared to algorithms implemented by the author in the period 199698 using the FORTRAN
algorithms of Hosking (1996b) is demonstrated.
Table 11.1. Summary of selected U.S. Geological Survey streamflow-gaging stations for distributional analysis using L-moments
Station number
01515000
02366500
08151500
09442000
14321000
Station name
Drainage area
(square miles)
4,773
4,384
4,203
4,010
3,683
respective streamflow-gaging stations. The example also shows that the Streamflow
data are placed into five concise variable names.
1111
data(USGSsta01515000peaks)
data(USGSsta02366500peaks)
data(USGSsta08151500peaks)
data(USGSsta09442000peaks)
data(USGSsta14321000peaks)
susque.Q
chocta.Q
llano.Q
gila.Q
umpqua.Q
<<<<<-
USGSsta01515000peaks$Streamflow
USGSsta02366500peaks$Streamflow
USGSsta08151500peaks$Streamflow
USGSsta09442000peaks$Streamflow
USGSsta14321000peaks$Streamflow
# concise names
# .. ditto ..
# .. ditto ..
# .. ditto ..
# .. ditto ..
As in Section 11.1.2, the distributional analysis begins with a graphical review using
box plots of the distribution of the data for each community. The box plots are shown in
figure 11.5, which was created by example 1112 .
1112
#pdf("usrivers_boxplot.pdf")
allQ <- list(Susque=susque.Q, Chocta=chocta.Q,
Llano=llano.Q,
Gila=gila.Q,
Umpqua=umpqua.Q)
boxplot(allQ, ylab="PEAK STREAMFLOW, IN CFS", range=0)
#dev.off()
The Weibull plotting positions and sample L-moments of the streamflow data are computed in example 1113 and set into 10 concise variable names. The plotting positions
are used in subsequent plotting operations, and the L-moments are used to fit probability
distributions using the method of L-moments.
325
200000
150000
100000
50000
0
250000
Susque
Chocta
Llano
Gila
Umpqua
Figure 11.5. Box plots of empirical distribution of annual peak streamflow for five selected river
basins in the United States from example 1112
1113
Following the custom of the authors preference for initial forays into distributional
analysis of hydrologic data, a Kappa distribution is fit to the L-moments in example 1114 .
Inspection of the Kappa parameters using the print() or str() functions (results not
shown) in the five variables shows that the distribution cannot be fit to the Choctawhatchee
River data because the data are too L-kurtotic. So for site-to-site comparison of a common
fitted distribution, the Kappa is not optimal in this circumstance.
1114
326
An L-moment ratio diagram with the sample L-moments of the five rivers is created
and plotted in example 1115 and shown in figure 11.6. The open-circle symbol for each
river is scaled somewhat according to the magnitude of 5 , and the first letter of each river
name is superimposed on the open circles.
1115
Stau
Ctau
Ltau
Gtau
Utau
<<<<<-
c(susque.lmr$ratios[3], susque.lmr$ratios[4])
c(chocta.lmr$ratios[3], chocta.lmr$ratios[4])
c( llano.lmr$ratios[3], llano.lmr$ratios[4])
c( gila.lmr$ratios[3],
gila.lmr$ratios[4])
c(umpqua.lmr$ratios[3], umpqua.lmr$ratios[4])
#pdf("usrivers_lmrdia.pdf", version="1.4")
lmrdiastuff <- lmrdia()
plotlmrdia(lmrdiastuff, autolegend=TRUE, xleg=0, yleg=0.6,
xlim=c(-0.2,0.6), ylim=c(-0.2,0.6))
# plot first letter of the river over the circle
points(Stau[1], Stau[2], cex=1.5, pch="S")
points(Ctau[1], Ctau[2], cex=1.5, pch="C")
points(Ltau[1], Ltau[2], cex=1.5, pch="L")
points(Gtau[1], Gtau[2], cex=1.5, pch="G")
points(Utau[1], Utau[2], cex=1.5, pch="U")
mycol <- rgb(0, 0, 0, 0.75)
# plot circle with diameter scaled somewhat with Tau5
points(Stau[1], Stau[2], cex=1+2*susque.lmr$ratios[5],
points(Ctau[1], Ctau[2], cex=1+2*chocta.lmr$ratios[5],
points(Ltau[1], Ltau[2], cex=1+2* llano.lmr$ratios[5],
points(Gtau[1], Gtau[2], cex=1+2* gila.lmr$ratios[5],
points(Utau[1], Utau[2], cex=1+2*umpqua.lmr$ratios[5],
col=mycol)
col=mycol)
col=mycol)
col=mycol)
col=mycol)
legend(0.2,0.6,
Susquehanna River, New York",
c("S
Choctawhatchee River, Florida",
"C
"L
Llano River, Texas",
"G
Gila River, Arizona",
"U
Umpqua River, Oregon"), box.lty=0, bty="n")
#dev.off()
It is obvious that the Choctawhatchee River plots in figure 11.6 above the trajectory of
the Generalized Logistic distribution on the diagram, and hence, as already mentioned, a
Kappa distribution cannot be fit to the sample L-moments of the Choctawhatchee River
data. The analyst could choose to fall back to the Generalized Logistic distribution at the
expense of the distribution not being L-kurtotic enough, but other distributions such as
the Wakeby or Generalized Lambda could also be consulted.
327
S
C
L
G
U
0.2
Theoretical limits
GEV
GLO
GNO
GPA
PE3
EXP
NOR
GUM
UNI
0.2
0.0
LKURTOSIS
0.4
0.6
0.2
0.0
0.2
0.4
0.6
LSKEW
Figure 11.6. L-moment ratio diagram showing 3 and 4 of annual peak streamflow data for five
selected river basins in the United States from example 1115. The size of the open circles is
scaled somewhat in proportion with 5 .
In example 1116 , the Wakeby distribution is fit. Inspection of the Wakeby parameters
in the five variables shows that the distribution could be fit. The Susquehanna and Gila
Rivers require that = 0 in order for the Wakeby to be fit but the remaining three do not.
1116
susque.wak
chocta.wak
llano.wak
gila.wak
umpqua.wak
<<<<<-
parwak(susque.lmr)
parwak(chocta.lmr)
parwak(llano.lmr)
parwak(gila.lmr)
parwak(umpqua.lmr)
Before continuing with rather complex examples, a few useful variables are set in example 1117 , which are related to F values (F and qF) for pending horizontal axis and vertical axis limits (mymin and mymax). The qnorm() function is used to transform F into
standard normal deviates.
1117
F <- nonexceeds()
qF <- qnorm(F)
328
mymin <- 0
mymax <- 300000
Plots of the QDF of the fitted Wakeby distribution are laid out and created in example 1118 . The five plots are shown in figure 11.7. The QDFs are superimposed on the
actual data values.
1118
#pdf("usrivers_qdf.pdf")
layout(matrix(1:6, ncol=2))
qpp <- qnorm(susque.pp); Q <- sort(susque.Q)
plot(qpp,Q, ylim=c(mymin,mymax), xlim=c(-2,3),
xlab="STANDARD NORMAL DEVIATE",
ylab="STREAMFLOW, IN CFS")
lines(qF,par2qua(F,susque.wak), col=2)
mtext("Susquehanna River, New York")
lines(c(qnorm(0.99),qnorm(0.99)), c(1,1000000), lty=2)
qpp <- qnorm(chocta.pp); Q <- sort(chocta.Q)
plot(qpp,Q, ylim=c(mymin,mymax), xlim=c(-2,3),
xlab="STANDARD NORMAL DEVIATE",
ylab="STREAMFLOW, IN CFS")
lines(qF,par2qua(F,chocta.wak),col=2)
mtext("Choctawhatchee River, Florida")
lines(c(qnorm(0.99),qnorm(0.99)), c(1,1000000), lty=2)
qpp <- qnorm(llano.pp); Q <- sort(llano.Q)
plot(qpp,Q, ylim=c(mymin,mymax), xlim=c(-2,3),
xlab="STANDARD NORMAL DEVIATE",
ylab="STREAMFLOW, IN CFS")
lines(qF,par2qua(F,llano.wak), col=2)
mtext("Llano River, Texas")
lines(c(qnorm(0.99),qnorm(0.99)), c(1,1000000), lty=2)
qpp <- qnorm(gila.pp); Q <- sort(gila.Q)
plot(qpp,Q, ylim=c(mymin,mymax), xlim=c(-2,3),
xlab="STANDARD NORMAL DEVIATE",
ylab="STREAMFLOW, IN CFS")
lines(qF,par2qua(F,gila.wak), col=2)
mtext("Gila River, Arizona")
lines(c(qnorm(0.99),qnorm(0.99)), c(1,1000000), lty=2)
qpp <- qnorm(umpqua.pp); Q <- sort(umpqua.Q)
plot(qpp,Q, ylim=c(mymin,mymax), xlim=c(-2,3),
xlab="STANDARD NORMAL DEVIATE",
ylab="STREAMFLOW, IN CFS")
lines(qF,par2qua(F,umpqua.wak), col=2)
mtext("Umpqua River, Oregon")
329
150000
STREAMFLOW, IN CFS
150000
STREAMFLOW, IN CFS
150000
STREAMFLOW, IN CFS
STREAMFLOW, IN CFS
150000
STREAMFLOW, IN CFS
Figure 11.7. Plots of QDF of fitted Wakeby distribution of annual peak streamflow and empirical
distribution for five selected river basins in the United States from example 1118
Next, plots of the PDF of the data are created using the function check.pdf() in example 1119 and the results are shown in figure 11.8. The PDFs each have their own unique
geometry (shape); however, as also seen in figure 11.5, the fitted Wakeby distributions
are clearly right-tail heavy (positive skewness). The fit for the Umpqua River shows the
beginnings of asymmetric behavior towards in figure 11.7 and more clearly in figure 11.8. Truncation of this fit to a zero lower bound could be made following the material
in Section 12.6 but is not made here.
330
#pdf("usrivers_pdf.pdf")
layout(matrix(1:6, ncol=2))
check.pdf(pdfwak,susque.wak, plot=TRUE)
mtext("Susquehanna River, New York")
check.pdf(pdfwak,chocta.wak, plot=TRUE)
mtext("Choctawhatchee River, Florida")
check.pdf(pdfwak,llano.wak, plot=TRUE)
mtext("Llano River, Texas")
check.pdf(pdfwak,gila.wak, plot=TRUE)
mtext("Gila River, Arizona")
check.pdf(pdfwak,umpqua.wak, plot=TRUE)
mtext("Umpqua River, Oregon")
#dev.off()
J
Interest in the distribution of annual peak streamflow is primarily in the right tail
because the design of that water-related (drainage) infrastructure is dependent on highmagnitude events. Focused attention, therefore, is made on the fit in the right tail. Inspection of figure 11.7 suggests that the Wakeby distribution can mimic the empirical distribution of the data. However, there are concerns about underestimation of peak-streamflow
magnitude for large standard normal deviates for the Choctawhatchee and Llano Rivers
because the fitted distribution plots to the right of the two (Chocatawhatchee) and three
(Llano) largest values. The lack of apparent tail fit for the Choctawhatchee is especially
troublesome and more investigation is warranted.
The Chocatawhatchee River distribution is further considered using the Generalized
Lambda distribution (see Section 9.2.2) in example 1120 . In the example, the parameter
solution, which has an acceptable least-square error (, see eq. (11.3)) for 3 and 4 and 5
(see eq. (11.2)), is returned from 14 optimization attempts by the pargld() function. Each
attempt is started differing combinations of Generalized Lambda parameter space (see
Karian and Dudewicz, 2000). The values for chocta.gld1 are shown by the print()
function. The output also shows the contents of chocta.gld4$rest, which shows other
solutions. These are collectively treated in a later example.
331
50000
100000
0.00015
0 20000
60000
100000
140000
2e+05
3e+05
4e+05
0.0e+00
1e+05
1.0e05
probability density
2.0e05
0e+00
1e+05
0e+00
1e+05
2e+05
3e+05
4e05
0e+00
probability density
probability density
150000
0.00000
3e05
0.0e+00
0e+00
probability density
probability density
0e+00
1e+05
2e+05
3e+05
Figure 11.8. Plots of PDF of fitted Wakeby distribution of annual peak streamflow for five selected
river basins in the United States from example 1119
1120
332
$rest
xi
alpha
kappa
h
delTau5
error
1 26140 -22019 -0.144155 -0.439496 -0.01103901 4.872965e-09
2 26131 -22049 -0.143872 -0.439247 -0.01109174 5.873891e-09
3 -87708 -101009 5.848814 -0.289431 0.09507022 3.123230e-10
4 -87713 -101014 5.848653 -0.289428 0.09507910 6.235505e-10
5 26841 120943 7.315955 70.672263 -0.24461201 2.798407e-06
6 26855 120648 7.298149 70.072798 -0.24552523 3.524567e-09
The values under the delTau5 and error headings represent the following quantities
(i)
5 = (i) 5 5
gld
(i)
(i) gld
(11.2)
= ( 3 3 )2 + ( 4 4 )2
gld
(i) gld
(11.3)
Lambda and r represent sample values. The 5 represents the difference between 5
of the fitted distribution and that of the data. This difference is not explicitly minimized
by the algorithm in the pargld() function, but this difference can be used to judge the
merit of a given solution for the Generalized Lambda. On the other hand, the values do
represent minimizations performed by the optim() function that is repetitively called
by the pargld() function.
Example 1120 shows that four different solutions exist that could be acceptable.
A solution is represented by attempts (1 and 14). In example 1121 , the three additional
Generalized Lambda solutions are set into descriptive variable names.
1121
333
(11.4)
(11.5)
(11.6)
(11.7)
5 0.002, < 10
#pdf("usrivers_gld.pdf")
xs <- qnorm(chocta.pp)
layout(1) # Previous layouts are matrices, so this might be
# needed to reset things following earlier examples
plot(qnorm(chocta.pp), log10(sort(chocta.Q)),
xlab="STANDARD NORMAL DEVIATE",
ylab="LOG10(STREAMFLOW, IN CFS)")
lines(xs, log10(par2qua(chocta.pp,chocta.wak)), lwd=0.7,
lines(xs, log10(par2qua(chocta.pp,chocta.gld1)), lwd=1,
lines(xs, log10(par2qua(chocta.pp,chocta.gld2)), lwd=2,
lines(xs, log10(par2qua(chocta.pp,chocta.gld3)), lwd=3,
lines(xs, log10(par2qua(chocta.pp,chocta.gld4)), lwd=3,
334
lty=2)
lty=1)
lty=3)
lty=4)
lty=1)
5.0
Wakeby
GLD: chocta.gld1
GLD: chocta.gld2
GLD: chocta.gld3
GLD: chocta.gld4
4.5
LOG10(STREAMFLOW, IN CFS)
4.0
Figure 11.9. Empirical distribution of annual peak streamflow data for U.S. Geological Survey
streamflow-gagin station 02366500 Choctawhatchee River near Bruce, Florida and Wakeby and
four Generalized Lambda distributions fit by method of L-moments from example 1122
Inspection of the figure suggests that the solution chocta.gld3 clearly has a poor fit,
which is consistent with the large 5 0. 0.245. Also solution chocta.gld2 has a
questionable fit; although the 3 and 4 match that of the data, the 5 0.095 is not
small compared to chocta.gld1 and chocta.gld4.
The two solutions, chocta.gld1 and chocta.gld4, both have potentially acceptable
fits depending on how the analyst interprets the diagnostics. If the analyst is interested in
distributional analysis for the right tail of the distribution as in the case of assessment of
flood risk to drainage infrastructure (say a bridge), then the fit of chocta.gld4 might be
preferable. However, this solution diverges from the data in the left tail. If the objective of
335
distributional analysis is to generally mimic the full spectrum of the flood potential, then
solution chocta.gld1 might be preferable.
In conclusion, the choice between different distributions or multiple solutions for a
distribution is not a trivial one and serious reflection on the topic is needed in many realworld circumstances. Ambiguity never-the-less often remains or is intrinsically expected
in distributional analysis of hydrometeorological data or other non-Normal data with
small sample sizes. Whereas goodness-of-fit tests, which are outside the scope here, or
L-moment ratio diagrams provide guidance, it can be difficult to separate the purity of
statistical computations from the context to model building process of the distributional
11.3 Summary
In this chapter, 22 examples for two short studies of distributional characteristics involving
annual maximum rainfall, and annual peak streamflow data are presented. In the former
study, the rainfall data from the observation network are assumed to be drawn from a
common parent distribution and the sample L-moments could be pooled together by
weighted-mean values to estimate a regional Kappa distribution. This distribution is used
to estimate a 100-year rainfall event that is similar to one derived from a previous study.
In the later study, the streamflow data from the observation network represent distinct
distributions that reflect the unique climatic and physiographic characteristics of five
widely dispersed river basins. The Wakeby distribution is used, but concerns over fit for
one river basin in particular led to a detailed presentation of the use of the Generalized
Lambda distribution.
336
Chapter 12
Advanced Topics
In this chapter, I present many generally distinct topics on advanced topics of distributional analysis using L-moments and probability-weighted moments. Inclusion of this
material in earlier chapters would, in my opinion, unnecessarily detract from the central
theme up until this point in the narrative. Familiarity L-moments and ancillary statistics and their support in the lmomco package is now assumed. Primary contributions
of this chapter are detailed treatment of both left- and right-tail censoring, conditional
probability adjustment, and multivariate L-moments. Secondary contributions are an
exploration of quantile uncertainty by simulation and journal article like comparison
of product moments and L-moments, which are each applied real- and logarithmic space,
for the Pearson Type III distribution. This chapter demonstrates a significant expansion
of capabilities for distributional analysis with L-moment statistics using R.
12.1 Introduction
Several generally more advanced L-moment-related topics are discussed in this chapter.
These topics do not pigeon-hole well into other portions of this dissertation, but these topics never-the-less contribute to distributional analysis with L-moment statistics. The use
of L-moments and probability-weighted moments for right-tail censoring is described
in Section 12.2. Following in parallel, the use of L-moments and probability-weighted
moments for left-tail censoring is described in Section 12.3. The censoring discussion
subsequently expands in Sections 12.4 and 12.5 to include censoring by indicator variable
and detailed discussion of a method known as flipping to support left-tail censoring
from right-tail censoring operators.
337
Following the censoring material, conditional probability adjustment for zero values is shown through blipped-distribution modeling, which is followed by an exploration of quantile uncertainty in the context of sampling error and model-selection
error (error attributable to distribution selection). An extensive comparison between
product moments and L-moments for the Pearson Type III distribution follows. Finally,
L-comoments, which are multivariate extensions of L-moments, are described in the last
section of this chapter and thus appropriately conclude this dissertation.
T is known and m values are less than this value and n m values are greater than or
equal to T . For right-tail type II censoring, only the m smallest values are observed and
338
the n m values are censored above the threshold Xm:n , which is the largest noncensored
order statistic.
The right-tail censoring fraction ( ) is a convenient parameter to accommodate data
censoring in probability-weighted moment computations. The censoring fraction satisfies
the relation = F (T ) for the CDF of random variable X with a QDF of x(F ). Differences between type I and type II censoring exist by definition and in sampling properties.
These differences become less important as sample size becomes large. Values for can
be estimated by = m/n; this is not necessarily an optimal choice, but for convenience,
it is all that is considered by Hosking (1995) as well as in this dissertation and the lmomco
package.
Zafirakou-Koulouris and others (1998, p. 1246) provide additional discussion of type I
and type II censoring: Since the censoring threshold T is fixed in type I censoring, m is
a random variable with a binomial distribution. Otherwise, type II censoring results, and
< Xm:n < T = Xm+1:n = Xm+2:n = = Xn:n , where the censoring threshold
remains denoted as T , are now defined.
The definition requires a conceptualization of two sample types. Consider first the
uncensored values of random sample of size m has a QDF expressed as
y A (F ) = x(F )
(12.1)
Whereas second, the complete random sample of size n has a QDF expressed as
x(F )
B
y (F ) =
x() = T
339
Using the two definitions for QDF, Hosking (1995) shows that the probability-weighted
moments for moment order r for r 0, for the respective QDF are
rA
F r y A (F ) dF
0
Z
1
= r+1
F r x(F ) dF
0
Z T
1
[F (x)]r x dF (x)
=
[F (T )]r+1
=
(12.3)
rB
F r y B (F ) dF
0
Z
1 r+1
= x()
+
F r x(F ) dF
r+1
0
Z
r+1
1
F r x(F ) dF
=T
+
r+1
0
Z T
1 [F (T )]r+1
=T
[F (x)]r x dF (x)
+
r+1
(12.4)
for the B-type probability-weighted moments. Finally, the relation between A- and Btype probability-weighted moments is
1
B
A
r1
= [r r r1
+ (1 r )T ]
r
(12.5)
where x() is the value of the QDF at nonexceedance probability F = . In other words,
is the right-tail censoring fraction or the probability Pr[] that x is less than the quantile at
nonexceedance probability: (Pr[x < X()]). The choice of A- and B-type in derivations
of probability-weighted moments or L-moments for censored distributions can be made
by mathematical convenience according discussion by Hosking (1995).
340
= xn:n , where the censoring threshold is denoted as T . The data possess m values that
are observed (noncensored, < T ) out of a total of n samples. The ratio of m to n is defined
as = m/n, which plays an important role in parameter estimation. The is interpreted
as the probability that x is less than the QDF at F = : Pr[x < x()]. The sample A-type
probability-weighted moments are defined by
rA
1 X
m
j1
1 m1
xj:n
=
m
r
r
j=1
(12.6)
which, to reiterate the definition, are the already familiar probability-weighted moments
of the uncensored sample of Chapter 5 for m observed values.
The sample B-type probability-weighted moments conversely are computed from the
complete sample, in which the n m censored values are replaced by the T right-tail
censoring threshold. The B-type probability-weighted moments are defined by
rB
1 X
m
n
X
1 n1
j1
j1
=
xj:n +
T
n
r
r
r
j=1
j=m+1
(12.7)
When there are more than a few censored values, the rA and rB are readily estimated
by computing the rA and using the expression
where
1Z
T
rB = ZrA +
r+1
(12.8)
m m1
n1
Z=
/
n
r
r
(12.9)
341
Using R
Using R
As identified by Hosking (1995), Hamada (1995, table 9.3) provides a table of lifetime-tobreakage measured in cycles for drill bits used for producing small holes in printed circuit
boards. The data are originally credited to an F. Montmarquet. The data were collected
under various control and noise factors to perform reliability assessment to maximize
bit reliability with minimization of hole diameter. Smaller holes permit higher density of
placed circuitry, and thus small holes are economically attractive.
The lifetime-to-breakage testing was completed at 3,000 cyclesthe right-tail censoring
threshold or T = 3,000. For purposes of demonstration of right-tail censoring using Aand B-type probability-weighted moments, these data have been merged into a single
sample in data DrillbitLifetime of the lmomco package.
Beginning in example 121 , the drill-bit lifetime data are set into X and the Weibull
plotting positions computed by the pp() function. The right-tail censored probabilityweighted moments are computed for the sample using the pwmRC() function. Subsequently, the parameters for the Generalized Pareto and Right-Censored Generalized
Pareto distributions are computed by the pargpa() (usual L-moments and probabilityweighted moments) and pargpaRC() functions, respectively.
121
The demonstration continues in example 122 , and the results are shown in figure 12.1.
The fits of the two Generalized Pareto distributions differ considerably. With special attention to the approximate interval F : [0.7, 0.9], it is obvious that the Right-Censored Generalized Pareto provides a preferable fit over the Generalized Pareto. The Generalized Pareto
fit is swung too far to the right because this fit improperly feels the many values equal
to, that is censored, to the value of 3,000.
122
#pdf("lifetime.pdf")
plot(1-PP,qlmomco(1-PP,paragpaRC), type="l", lwd=3,
xlab="EXCEEDANCE PROBABILITY", ylim=c(0,4000),
# thick line
ylab="LIFE TIME, CYCLES")
lines(1-PP,qlmomco(1-PP,paragpa)) # thin line
points(1-PP,sort(X, decreasing=TRUE))
342
4000
2000
1000
3000
0.0
0.2
0.4
0.6
0.8
1.0
EXCEEDANCE PROBABILITY
Figure 12.1. Comparison of Right-Censored Generalized Pareto distribution fit to right-tail censored probability-weighted moments (thick line) and Generalized Pareto fit to whole sample
probability-weighted moments (thin line) from example 122. The thick line represents the preferable fit to the data.
censoring is discussed in Section 12.5. Much of the material in this section is drawn from
Zafirakou-Koulouris and others (1998).
It is common in studies of hydrologic or environmental data (particularly water quality
or chemistry) to be left-tail censored. Specifically, the sample of size n is not fully measured
on the low-magnitude portion of the distribution. This is known as the detection limit
problem. Two types of left-tail censoring are recognized. For left-tail type I censoring, a
left-tail censoring threshold T is known and nm values are greater than this value and
m values are smaller than or equal to T . For left-tail type II censoring, only the n m
largest values are observed and the m values are censored below the threshold Xm:n ,
which is the smallest noncensored order statistic.
The left-tail censoring fraction ( ) is a convenient parameter to accommodate data
censoring in probability-weighted moment computations. The censoring fraction satisfies
the relation = F (T ) for the CDF of random variable X with a QDF of x(F ). Differences
between type I and type II censoring exist by definition and in sampling properties. These
differences become less important as sample size becomes large. Values for can be estimated by = m/n; this is not necessarily an optimal choice, but for convenience, it is all
that is considered by Zafirakou-Koulouris and others (1998) as well as in this dissertation
and the lmomco package.
y A (F ) = x[(1 )F + ]
Whereas second, the complete random sample of size n has a QDF expressed as
344
(12.10)
y B (F ) =
x() = T
for 0 < F
(12.11)
x(F )
Using the two definitions for QDF, Zafirakou-Koulouris and others (1998) show that
the probability-weighted moments for moment order r for r 0, for the respective QDF
are
0
rA
F r y A (F ) dF
0
Z 1
1
=
(F )r x(F ) dF
(1 )r+1
Z
1
[F (x) F (T )]r x dF (x)
=
r+1
(1 [F (T )])
T
=
(12.12)
F r y B (F ) dF
0
Z 1
r+1
+
F r x(F ) dF
= x()
r+1
Z 1
r+1
=T
F r x(F ) dF
+
r+1
Z
r+1
[F (T )]
=T
+
[F (x)]r x dF (x)
r+1
T
=
(12.13)
< xn:n , where the censoring threshold is denoted as T . The data possess n m values
that are observed (noncensored, > T ) out of a total of n samples. The ratio of m to n is
defined as = m/n, which plays an important role in parameter estimation. The is
interpreted as the probability that x is greater than the QDF at F = : Pr[x > x()]. The
sample A-type probability-weighted moments are defined by
345
1 X
n
nm1
jm1
1
xj:n
nm
r
r
j=m+1
(12.14)
which, to reiterate the definition, are the already familiar probability-weighted moments
of the uncensored sample of Chapter 5 for k observed values.
The sample B-type probability-weighted moments conversely are computed from the
complete sample, in which the n m censored values are replaced by the T left-tail
censoring threshold. The B-type probability-weighted moments are defined by
0
rB
1 X
m
n
X
1 n1
j1
j1
=
T+
xj:n
n
r
r
r
j=1
j=m+1
(12.15)
Using R
Using R
Hosking (1995, table 29.2, p. 551) provides some right-tail censored data, which has
prior use in the literature, for the lifetimes in weeks of 33 transistors.1 These data are
reproduced in example 123 in which the three values of 52 weeks are right-censored
and the value 51.9999 is a numerical hack so that a threshold of 52 can be used in the
function pwmRC() to compute the A- and B-type probability-weighted moments. The data
are converted to left-tail censored by flipping and set into the LC variable (see Section 12.5
for full description of variable flipping). The example ends by reporting the right-censored
L-moments. These can be compared to back-flipped, left-censored L-moments shown in
the next example.
123
346
$lambdas
[1] 15.666663 6.202296 2.499668 1.513826 0.377672
$ratios
[1]
NA 0.39589129 0.40302308 0.24407516 0.06089229
pwm2lmom(vec2pwm(RCpwm$Bbetas)) # B-type PWM --> B,L-moments
$lambdas
[1] 18.9696939 8.2064369 3.0736178 1.0279813 -0.5654883
$ratios
[1]
NA 0.4326078 0.3745374 0.1252652 -0.0689079
The left-censored L-moments for the data in LC are computed in example 124 by
the pwmLC() function, which implements eqs. (12.14) and (12.15). The fliplmoms()
function provides the back flipping of the L-moments.
124
Examples 123 and 124 show the A- and B-type L-moments and back-flipped A- and
B-type L-moments, respectively. These are congruent as judged by the equality of the
moments on upon one-to-one comparison. The reliability of the pwmLC() function is
demonstrated.
(2010) thoroughly describe a method to estimate L-moments based on a right-tail censoring indicator, which has application in survival or failure analysis.2 For each of the
sample order statistics x1:n x2:n xn:n of random variable X , it is known
that xj = min(Xj , T ) for a noninformative T (Wang and others, 2010). The noninformative nature of the censoring is very important and salient discussion is provided by
Helsel (2005, pp. 3033). The censoring threshold is unknown, is not explicitly needed,
and T is itself possibly a random variable generated along side each realization of X :
xj = min(Xj , Tj ). For the sample order statistics, let j:n be indicators of right-tail censoring: j:n = 0 indicates that xj:n is uncensored, whereas, j:n = 1 indicates that xj:n
is right-tail censored. Censoring that requires an indicator variable might occur as (1)
right-tail censoring by patients leaving (no longer participating in) survival studies after
medical procedures or as (2) left-tail censoring when multiple detection limits are used,
which is common with environmental quality (chemical) data.
Wang and others (2010) describe an L-moment estimation method, which relies on the
empirical survival function to determine weight factors on the observed (noncensored) values of the order statistics. These weight factors converge to those of the usual L-moments
as the number of censored values goes to zero. The empirical survival function is defined
as
Q
Sj:n (x) =
Xj:n x
1j:n
(12.16)
x Xn:n
Using eq. (12.16) as the survival function in the role of a complemented3 plotting position,
the sample L-moments are computed by
n
X
wj:n (r)Xj:n
(12.17)
j=1
Wang and others (2010) consider survival data, which is strictly greater than or equal to zero,
but such a restriction is lifted here.
3
Plotting positions are defined in this dissertation as nonexceedance probabilities. The survival
function for the definitions in this section is an expression of exceedance probability; therefore,
the complement is needed. The complement is seen in the 1 S in eqs. (12.19) and (12.20).
348
r1
1X
k r1
wj:n (r) =
(B ? B? )
(1)
r k=0
k
(12.18)
where B is the CDF of the Beta distribution B(q, a, b) for quantile q and parameters a and
(12.19)
(12.20)
for parameters r k and k + 1. Readers are asked to note that the j 1 term in eq. (12.20)
takes on the value 0 for the first order statistic (j = 1). There obviously is no zeroth
order statistic. Wang and others (2010) suggest X0:n = 0, but such a condition, implies
that X 0. The result of X0:n = 0 yields S = 1. Therefore, the special condition in
eq. (12.16) by the author (Asquith) has the same effect when B? is computed for the first
order statistic. The special condition lifts the X 0 restriction and extends X to the
real-number line R.
Wang and others (2010) conduct, with an Exponential distribution censoring Tj , a simulation study of Generalized Extreme Value and two Weibull distributions and report
that L-moment ratio diagrams still provide fair separation of 3 and 4 . Wang and others
also show that the method of L-moments generally performs better than the method of
maximum likelihood for the Weibull distribution and strongly suggest use of L-moments
for samples sizes less than 50 and less than 55 percent of right-tail censored data.
Helsel (2005, p. 77) recommends (quote follows) that the Kaplan-Meier method by
Kaplan and Meier (1958) be used to compute summary statistics of right-tail censored
data for data with up to 50 [percent] censoring because of its predominant use in
[nonenvironmental] disciplines and well-developed theory. Part of the Wang and others (2010) method is based on the Kaplan-Meier method. Helsel (2005, p. 67) reports that
estimates of standard deviation are even of less interest than the mean in traditional survival analysis [because of] the skewness found in most survival [and environmental4 ]
data. The author of this dissertation advocates that such a statement should no longer be
as applicable because of the support for L-moment computation on censored data because
of the developments of Wang and others (2010).
4
The author (Asquith) has added environmental as this data type is most certainly implied by
Helsel.
349
Using R
Using R
Efron <c(7,0, 34,0, 42,0, 63,0, 64,0, 74,1, 83,0, 84,0, 91,0,
108,0, 112,0, 129,0, 133,0, 133,0, 139,0, 140,0, 140,0,
146,0, 149,0, 154,0, 157,0, 160,0, 160,0, 165,0, 173,0,
176,0, 185,1, 218,0, 225,0, 241,0, 248,0, 273,0, 277,0,
279,1, 297,0, 319,1, 405,0, 417,0, 420,0, 440,0, 523,1,
523,0, 583,0, 594,0, 1101,0, 1116,1, 1146,0, 1226,1,
1349,1, 1412,1, 1417,1)
# Break up the data,censor pairs into two vectors
ix <- seq(1,length(Efron), by=2) # create indexing variable
Efron.data
<- Efron[ix] # try repeating with a negation
Efron.rcmark <- Efron[(ix+1)]
# Ensure sorting and make sure to resort the indicator
# in case reader is experimenting with negation of the data
ix <- sort(Efron.data, index.return=TRUE)$ix
Efron.data
<- Efron.data[ix]
Efron.rcmark <- Efron.rcmark[ix]
# Distinguish between the data when graphing
# by changing the plotting character
my.pch <- Efron.rcmark
my.pch[Efron.rcmark == 0] <- 1 # open circle
my.pch[Efron.rcmark == 1] <- 16 # solid circle
ub
noRC
RC
PP
<<<<-
350
The example computes three estimates of the sample L-moments: (1) the usual unbiased; (2) those by eq. (12.17), but ignoring the right-tail censoring indicator; and (3) those
by eq. (12.17) using the right-tail censoring indicator. The Kappa distribution is fit to all
three L-moment sets. The results are plotted on figure 12.2. The censored data are distinguished as solid circles. The two solid lines show very similar Kappa fits from uniquely
different L-moment estimating functionsthe reliability of the lmomsRCmark() function
(for uncensored data) is demonstrated. (The reliability of lmomsRCmark() for censored
data is evaluated in Section 12.5.) The Kappa distribution (dotted line) fit to the censored
L-moments plots considerably to the left as anticipated. The censored values have dotted
lines extending to the top of the plot from each in order to represent the interval in which
the actual data value resides. This plotting style for censored data follows that of Helsel
(2005, p. 52).
For a demonstration of the generality of eq. (12.16) for < X < compared to the
restriction by Wang and others (2010) that X 0, readers are encouraged to repeat exam-
351
1500
DATA
1000
500
0.0
0.2
0.4
0.6
0.8
1.0
NONEXCEEDANCE PROBABILIY
Figure 12.2. Comparison of three Kappa distribution fits to right-tail censored survival data (dotted
lines extended from reported limit) from example 125
ple 125 with negated Efron.data by using the operation Efron.data <-Efron[ix
y i = M xi
352
(12.21)
where yi are the right-tail censored values and xi are the original and left-tail censored.
Statistical analysis, including computation L-moments, is made on the yi . Location estimates of yi such as mean, median, and quantiles must be retransformed back (Helsel,
2005, p. 65) by back flipping through subtraction of the constant M that was used to flip
the data. Helsel (2005) and Lee (2009) provide arsenic concentration data in a data set
called Oahu. These data are used here and results of L-moment computation compared,
when possible, to parallel results from Helsel (2005, p. 65) or to the algorithms in the
NADA package by Lee (2009) that have no connection to those in lmomco.
Using R
Using R
Example 126 loads the Oahu dataset and provides a summary of the data values along
with an indicator variable AsCen, which identifies, by a logical variable, those data that are
left censored. For example, the second observation is <1.0, whereas the third observation
is 1.7. The Kaplan-Meier nonparametric method is used in NADA to compute conventional
summary statistics. These are computed and set into the NADAfit variable. The results
show that the computed mean is about 0.949 milligrams per liter. The example ends
with an output of selected quantiles of the data. The flipping of the data was performed
automatically and retransformation (back flipping) is applied as necessary. These features
of the NADA package will be more formally defined when L-moments are explained in a
subsequent example (ex. 127 ).
126
library(NADA) # load
data(Oahu) # load in
print(as.list(Oahu))
$As
[1] 1.0 1.0 1.7 1.0
[11] 2.0 2.0 2.0 2.0
[21] 0.5 0.7 0.6 1.5
$AsCen
[1] TRUE TRUE FALSE TRUE
[11] TRUE TRUE TRUE TRUE
[21] FALSE FALSE FALSE FALSE
353
NADAfit <- cenfit(Cen(A, Ac)) # cenfit and Cen from NADA package
print(NADAfit) # show the mean and standard deviation
n
n.cen
median
mean
sd
24.0000000 13.0000000 0.7000000 0.9489583 0.8068068
quantile(NADAfit) # show some quantiles to be compared later
5% 10% 25% 50% 75% 90% 95%
0.5 0.5 0.5 0.7 0.9 1.7 2.8
Example 127 continues to use the arsenic data in variable A and left-tail censoring
indicator in variable Ac. The example opens with two uses of the lmomsRCmark() function to compute the L-moments by (1) ignoring the left-tail censoring and (2) using the
left-tail censoring indicator. The example continues in parallel by fitting two Generalized
Normal distributions by the pargno() function. For the remainder of the discussion,
the censored L-moments in lmr.cen and the Generalized Normal fit in lmomcofit.
cen are of interest. The purpose of showing how to ignore the censoring (not setting
rcmark in lmomsRCmark()) is to provide a starting point for readers interested in fur-
ther self study.5 Although the flip was specified (M = 5 milligrams per liter), the flip used
by the lmomsRCmark() function is explicitly extracted so as to hint that lmomsRCmark()
also can automatically choose a flip for the user. The left-censored mean is set into mean
and outputted. The result is 0.949, which precisely matches the left-censored mean computed by the independent algorithms of Lee (2009), which is shown in example 126 .
127
lmr
lmr.cen
lmomcofit
<- pargno(lmr) # fit GNO dist to lmr
lmomcofit.cen <- pargno(lmr.cen) # fit the censored
# note, the L-moments and the GNO fit are RIGHT-TAIL CENSORED
# get the flip, in case not set in argument to lmomsRCmark()
flip <- lmr.cen$flip
mean <- flip - lmr.cen$lambdas[1] # back-flip
cat("# Mean is",mean,"\n") # this value matches earlier
# Mean is 0.9489583
The quantiles for the Oahu arsenic data were estimated nonparametrically in example 126 . Example 128 estimates the quantiles via the distributional assumption and
5
In other words, the author is trying to provide subtle details so as to show other twists to the
distributional analysis that he thought would be neat to try for edification about censoring but
decided not further explore in this dissertation. These data are left-censored; the remainder of the
analysis is thus focused.
354
fit of the Generalized Normal made in example 127 . The results in example 128 show
that the estimated quantiles for the selected F (nonexceedance probability) are quite similar6 to those in example 126 . This example of Generalized Normal quantiles is explicitly
chosen so as to show how the F must be mapped to S (exceedance probability, survival
probability, or S , see page 27) then used in the QDF by the qlmomco() function and the
result retransformed by back flipping (-qlmomco(1-F) , see Reflection Rule on page 36).
The previous two examples thus show the mechanics of fitting a distribution in the usual
fashion to the L-moments of left-censored data. The application to right-tail censored data
is more straightforward because the F 7 S mapping and back flipping is not required.
128
Equality is not anticipated, but if the fitted distribution is reasonable, then the computed nonparametric and estimated quantiles should be similar.
7
The author calls special attention to these two operations for treatment of left-tail censoring as
more-than-cursory review of Helsel (2005) and Lee (2009) did not provide sufficient guidance and
several iterations were needed before the figure looked and was correct.
355
#pdf("rcindicatorNADA.pdf")
plot(NADAfit) # creates plot with thin and dashed lines
lines(X, F, lwd=3)
#dev.off()
0.6
0.4
0.0
0.2
Probability
0.8
1.0
0.5
1.0
1.5
2.0
2.5
3.0
Value
Figure 12.3. Empirical survival function (thin line and dashed 95-percent confidence bands) by
Kaplan-Meier method from the NADA package to left-tail censored arsenic concentration in
Oahu dataset compared to fit of Generalized Normal distribution (thick line) by flipped and
right-censored L-moments by indicator variable from example 129
The flipping of the mean was shown in example 127 . However, additional adjustments to the ensemble of L-moments are needed for higher-order distributional fit than
two-parameter distributions. Odd-order L-moments, such as 3 and 5 require, a change of
356
mal distribution fit and the nonparametric method in the NADA package is shown in
example 1210 .
1210
The example simulated n = 10,000 values of a log-Normal distribution for which 5,000
of the values are subject to a T = 2 left-tail censoring threshold and 5,000 are subject to a
T = 1 left-tail censoring threshold. The output shows close agreement between selected
nonparametric quantiles of the NADA package to corresponding parametric quantiles of
the fitted Generalized Normal distribution. The distribution is fit to the L-moments in the
lmr.backflipped variable, which is derived from coupling the lmomsRCmark() and
fliplmoms() functions for left-tail censored distributional analysis. Further, because
357
the LMRqua mimic those of the independent and non-L-moment algorithms of the NADA
0
if x 0
F (x) =
p + (1 p)G(x) if x > 0
and
x(F ) =
(12.22)
if 0 F p
(12.23)
That is, the zero values are left in the sample when the L-moments are computed.
358
the zero for x in eqs. (12.22) and (12.23) can be other constant lower bounds. For the
discussion here, the focus is on a zero lower bound without a loss of generality. The value
for p can be estimated from a sample as the ratio of the number of zero values to the total
sample size.
Using R
Using R
The conditional adjustment for zero values is demonstrated by the sequence of examples and concomitant discussion that follow. To begin, example 1211 generates an x > 0
sample of size n = 30 and an arbitrary fraction of zero values tp=0.20 (20 percent) to
control the number of zero values synthetically added to the sample. The Generalized
Pareto is selected for the example because the distribution has readily set lower bounds.
The parameters of the true GPA(150, 700, 0.03) are set by vec2par() and a random
sample fake.dat.nz of size n from this Generalized Pareto is drawn and sorted by
rlmomco() and sort() functions, respectively. The sapply() function truncates the
fake.dat.nz sample to positive values if any are present. However, for the example, the
PP <- pp(fake.dat)
lmr
<- lmoms(fake.dat)
lmr.nz <- lmoms(fake.dat.nz)
359
The discussion continues in example 1213 with the estimation of Generalized Pareto
parameters from the sample L-moments using the pargpa() function for both the complete sample L-moments in lmr and the sample L-moments for the partial sample of
values greater than zero in lmr.nz. Finally, the fraction of zero values for the sample is
computed and set into the p variable.
1213
Based on the previous three examples ( 1211 1213 ), a visual representation of the
blipped Generalized Pareto distribution is produced in example 1214 and shown in figure 12.4. The plotting position values in PP of the complete sample provide values for F .
These values also will be used for drawing QDFs of the distributions. The quagpa() function returns the Generalized Pareto quantiles, and the z.par2qua() function adheres
to eq. (12.23) and performs as a blipped-distribution implementation of the par2qua()
function. The par2qua() function internally dispatches the parameter lists PARgpa or
PARgpa.nz to the quagpa() function to compute Generalized Pareto quantiles.
1214
#pdf("zero1.pdf")
plot(qnorm(PP), fake.dat,
xlab="STANDARD NORMAL DEVIATE", ylab="QUANTILE")
lines(qnorm(PP),quagpa(PP,PARgpa), lty=2) # dashed line
F <- PP # set nonexceedances to those in PP
Q <- z.par2qua(F,p,PARgpa.nz)
lines(qnorm(F),Q, lwd=2) # solid and thicker line
legend(-1.5, 1500, lty=c(2,1),
c("GPA by complete sample",
"GPA by blipped distribution"))
#dev.off()
360
2000
1000
QUANTILE
1500
500
Figure 12.4. Conditional adjustment for zero values by blipped-distribution modeling of the Generalized Pareto from example 1214
361
sections should provide readers with a look and feel of how much is unknown (uncertain) in distal tail estimates of distributions fit to samples. For purposes here, the distal tail
begins at about a standard-normal quantile (deviate) or qnorm(pnorm(1)) or F 0.84.
#pdf("llano1.pdf")
data(USGSsta08151500peaks) # from lmomco package
Qdat <- USGSsta08151500peaks$Streamflow # a smaller variable name
plot(Qdat, xlab="YEAR NUMBER", ylab="PEAK STREAMFLOW, IN CFS")
#dev.off()
Next, in example 1216 , the data are sorted into the variable Qs, the Weibull plotting
positions are computed by pp(), the sample L-moments are computed by lmoms(), and
Wakeby distribution parameters by parwak() are placed into the variable PARwak. The
str() function is used to report the L-moments and Wakeby parameters. The results are
Table 12.1. L-moments of annual peak streamflows for Llano River at Llano, Texas (19402006)
and Wakeby distribution parameters
1
51, 160
2
28, 900
3
4
5
1.616
81, 800
0.09491
200000
150000
100000
50000
250000
10
20
30
40
50
60
YEAR NUMBER
Figure 12.5. Time series of annual peak streamflows for Llano River at Llano, Texas (19402006)
from example 1215
The data have a nearly 2.5-order of magnitude range, yet the distribution is fit in the
untransformed units of the datalogarithmic transformation is not used in the analysis.
1217
#pdf("llano2.pdf")
plot(qnorm(PP),log10(Qs),
xlab="STANDARD NORMAL DEVIATE",
ylab="LOG10 STREAMFLOW, IN FT^3/S")
lines(qnorm(PP),log10(quawak(PP,PARwak)), lwd=3, lty=1)
legend(-2,5.5, c("Wakeby by L-moments"),
lwd=c(3), lty=c(1), box.lty=0, bty="n")
#dev.off()
J
The gen.freq.curves() function is a high-level function that drives simulation by
the genci() function (called internally) for a specified sample size and a given parent
distribution. The distribution is specified by an lmomco parameter list (see page 163 and
ex. 71 ). The gen.freq.curves() function collects intermediate results and provides
363
5.5
3.5
4.0
4.5
5.0
3.0
Wakeby by Lmoments
Figure 12.6. Empirical distribution and fitted Wakeby distribution to annual peak streamflows for
Llano River at Llano, Texas from example 1217
options for graphical visualization. The number of simulations and other features that
generally control graphical output are set by named arguments.
Example 1218 demonstrates the gen.freq.curves() function using a sample size
of n=67 for 100 distinct simulations (nsim=100) from the Wakeby parent. With each
drawing, the sample L-moments and estimated Wakeby parameters of the simulated sample are computed and each resulting ith Wakeby for 1 i nsim is depicted on the plot
in figure 12.7. The nonexceeds() function is used to generate a convenient vector of F
values for drawing of the Wakeby parent by the quawak() function. The example ends by
superimposing the true parent (dashed line) on the 100 simulated Wakeby distributions.
1218
F <- nonexceeds()
n <- length(Qdat) # 67 years of record
#pdf("llano3.pdf", version="1.4")
gen.freq.curves(n, PARwak, nsim=100,
asprob=TRUE, col=rgb(0,0,0,0.08))
lines(qnorm(F), quawak(F,PARwak), lty=2, lwd=3)
364
350000
150000
0
50000
QUANTILE
250000
Wakeby by Lmoments
Figure 12.7. Study of 100 simulations of sample size of n = 67 for indicated Wakeby parent from
example 1218
Example 1218 makes use of semi-transparency, which can be provided by the portable
document format (PDF) device pdf(). The transparency is accessed through specification
of a fourth parameter to the rgb() color function. The fuzziness or grayness of the
simulated distributions in figure 12.8 is a graphical depiction of sampling error.
For a demonstration of the influence of sample size, it is informative to repeat the example 1218 in 1219 for a sample size of n = 20 (fig. 12.8) and then again in example 1220
for n = 200 (fig. 12.9). The dramatic increase in variability at a given F in the distribution
of the simulated distributions between figures 12.8 and 12.9 exist because of the different
sample sizes. In fact at n = 20, radically different curvatures of a few simulated distributions compared to the curvature of the Wakeby parent distribution are visible. Some
distributions have upper limits much less, and conversely much larger, than the parent
365
distribution. It must be remarked that the algorithm used to fit the Wakeby includes three
solution styles: (1) the parameter is estimated, (2) the parameter is set to = 0, or (3) a
Generalized Pareto distribution is fit instead if either of the other two solutions are not
viable.
1219
350000
#pdf("llano4.pdf", version="1.4")
gen.freq.curves(20, PARwak, nsim=100,
asprob=TRUE, col=rgb(0,0,0,0.08))
lines(qnorm(F), quawak(F,PARwak), lty=2, lwd=3)
legend(-2.5,350000, c("Wakeby by L-moments"),
lwd=c(3), lty=c(2), box.lty=0, bty="n")
#dev.off()
150000
0
50000
QUANTILE
250000
Wakeby by Lmoments
Figure 12.8. Study of 100 simulations of sample size n = 20 for indicated Wakeby parent from
example 1219
1220
#pdf("llano5.pdf", version="1.4")
gen.freq.curves(200, PARwak, nsim=100,
asprob=TRUE, col=rgb(0,0,0,0.08))
lines(qnorm(F), quawak(F,PARwak), lty=2, lwd=3)
legend(-2.5, 350000, c("Wakeby by L-moments"),
366
350000
150000
0
50000
QUANTILE
250000
Wakeby by Lmoments
Figure 12.9. Study of 100 simulations of sample size n = 200 for indicated Wakeby parent from
example 1220
For examples 1218 1220 , the emphasis is on visualization of sampling error as a
function of sample size. It might be more useful to acquire an actual metric of sampling
error for a range of sample sizes for a given quantile. These quantile sampling error metrics,
367
The 2 = 0.116 for x0.99 will be used again in the next section.
,
, , , and for each station were computed by Asquith
homa and Louisiana. The
5
1
2 3 4
= 1 and
= , a dimensionless Wakeby distribution
and Roussel (2009). By taking
1
2
2
or regional growth curve for the study area can be estimated from weighted.mean()
values for the sample L-moments. The number of years of record or data for each station constitute weight factors as also done in example 117 within a different context.
Although intermediate computations are not shown, the regional L-moments and corresponding parameters of the Wakeby are listed in table 12.2 in which the listed parameter
values are computed in example 1222 .
1222
L <- vec2lmom(c(1,0.505,0.394,0.250,0.159))
W <- parwak(L) # compute Wakeby parameters
Table 12.2. Regional L-moments and equivalent Wakeby parameters for dimensionless distribution
of annual peak streamflow in Texas
1
2
3
4
5
The primary purpose of the genci() function is to estimate, for a specified distribution
and sample size, the lower and upper limits of a specified confidence interval for specific
quantile values using simulation. These computations are shown in example 1224 .
1224
genci(W,n=16,nsim=200,F=(16/(16+1)))
nonexceed_prob
lower
true
upper
lscale
lcv
1
0.9411765 1.039137 2.816574 3.33673 0.3940406 0.1399006
and values.
In the example and by default, the genci() function also returns the
2
2
The quantile values are specified by a vector of F values. Although in the example, only a
single F = 0.941 is used. The parameters of the parent distribution (the Wakeby distribution in this case) are provided as the first argument. The genci() function is a wrapper
on qua2ci() function, which is not shown in the example. The returned contents of the
genci() function are shown in the last line of example 1224 .
1225
0.30
0.25
0.20
0.15
0.05
40
20
0.10
60
80
100
SAMPLE SIZE
Figure 12.10. Comparison of simulated 2 values for 50th (open circles) and 90th (closed circles)
percentiles of regional Wakeby parent using 20 simulations for indicated sample size from example 1225
ever, this bias can be quite difficult to assess in most circumstances because the parent
distribution is unknown. If multiple distributions, which could each arguably be appropriate, are fit, then it is possible to compute measures of variability from the multiple fits
at each x(F ) of interest. This variability subsequently can be compared to the sampling
variability. The variability of x(0.99) is the subject of this section.
Wallis (1988, pp. 304305) refers to the topic of this section differences in x(F ) as a function of choice of distribution. Wallis proceeds to summarize a study of the T = 106 year
annual maximum wind speed event for Corpus Chrisi, Texas in which the Extreme Value
Type I (EV I, Gumbel in this dissertation) and Extreme Value Type II (EV II, Frchet, which
is special case of Generalized Extreme Value in this dissertation) distributions are each
used. Wallis states The EV I estimate for T = 106 event equals the commonly observed
maximum wind speed for large hurricanes, while the comparable value for the EV II distribution is almost half the velocity needed to escape from the Earths field of gravity! (The
explanation point is Wallis.) Wallis concludes that neither estimate appears particularly
reasonable, and other analysis could be done. The author of this dissertation cites this
370
0.25
0.20
0.15
20
0.10
40
60
80
100
SAMPLE SIZE
Figure 12.11. Comparison of simulated 2 values for 50th (open circles) and 90th (closed circles)
percentiles of regional Wakeby parent using 2,000 simulations for indicated sample size from
repeating of examples 1223 and 1225 using nsim=2000
example as a case where two reasonably chosen distributions yield radically divergent
far-tail quantile estimates.
In example 1226 , an exploration of model-selection error is made using the five threeparameter distributions supported by lmomco. The data chosen are the annual peak streamflow for for U.S. Geological Survey streamflow-gaging station 08151500 Llano River at
Llano, Texas are computed. These data are shown in figures 12.5 and 12.6.
Example 1226 begins by the computation of the sample L-moments, computation of
Weibull plotting positions, and creation of a list of distribution abbreviations in variable
dist. The example continues with creation of a grv() function to compute Gumbel
Reduced Variates and setting of a familiar sequence of F . The Gumbel Reduced Variates
are used to dilate the horizontal axis. A five-element vector QsG is initialized for the five
distributions to store estimates of the 99th-percentile annual peak streamflow.
1226
371
lmr
dist
G
<- 0.99 # for dotted vertical line in a plot
grv <- function(x) return(-log(-log(x))) # Gumbel RV
F
<- nonexceeds()
QsG <- vector(mode="numeric", length=length(dist))
#pdf("modelselection.pdf")
plot(grv(weibullpp), sort(Qdat), log="y",
xlim=c(0,5), ylim=c(1e4,4e5),
xlab="GUMBEL REDUCED VARIATE, -log(-log(F))",
ylab="STREAMFLOW, CFS")
for(i in 1:length(dist)) {
ifelse(dist[i] == "gpa", lty <- 1, lty <- 2)
QDF <- qlmomco(F, lmom2par(lmr, type=dist[i]))
lines(grv(F), QDF, lty=lty)
QsG[i] <- QDF[F == G]
}
lines(c(grv(G),grv(G)), c(1e4,4e5), lty=3)
#dev.off()
The example continues by plotting the data and the five fitted distributions as shown
in figure 12.12. The fitted distributions are shown as dashed lines and a solid line
(the Generalized Pareto). The Generalized Pareto distribution is plotted differently
because the L-moment ratio diagram (but not shown here), but which can be created
by the nested functions plotlmrdia(lmrdia()) and points(lmr$ratios[3], lmr
suggest that the standard error of the x(0.99) estimate, which is attributed to choice of an
unknown, but three-parameter, distribution model, is about 17,000 cubic feet per second.
The example ends with the reporting of 2 model = 0.034, which is an expression of the
relative error.
372
2e+05
5e+04
STREAMFLOW, CFS
1e+05
1e+04
2e+04
Figure 12.12. Empirical distribution and five fitted distributions to annual peak streamflows for
Llano River at Llano, Texas from example 1226. The dotted vertical line is drawn at F = 0.99
(the 100-year recurrence interval).
1227
print(summary(Qs))
Min. 1st Qu. Median
279400 292700 305600
Max.
319400
J
Finally, in example 1221 , the relative sampling variability of the five-parameter
Wakeby distribution, based on limited simulations, is reported as 2 sampling = 0.116. This
can be compared and combined with 2 model = 0.034. Comparing the two, it is seen
373
that the relative variation because of sampling in the x(0.99) estimate is about 3.4 times
larger than the relative variation from deciding amongst the 5 three-parameter distributions. Combining the two variations, the relative variation in the x(0.99) estimate is about
2 =
p
(0.116)2 + (0.034)2 = 0.121.
If the best estimate of the analyst doing magnitude and frequency work for this river,
including the distributional work in this section and Section 12.7.1 along with other engineering analyses (perhaps interpretations of a rainfall and runoff model), is say 300,000
cubic feet per second, then the estimated uncertainty in the context of the more familiar
standard deviation is = 300,000 0.121
60, and 100 are used. The results show that L-moments outperform, in a Pearson Type III
context, the product moments in terms of bias.
374
moment usage. A common practice, therefore, is for the analyst to logarithmically transform (log10 transform) the phenomena being investigated and fit the log-Pearson Type III
using product moments.
375
When log10 transformation is used, analysis of data containing zero or negative values
becomes more complicated. A more philosophical drawback is that analysis is based in
log10 space, but real-world implementation of statistical results, such as flood volume or
rainfall magnitude, is needed in linear space. The philosophical topic of transformation
is briefly discussed by Vogel and Fennessey (1993, p. 1750) in the context of goodnessof-fit of probability distributions and L-moment ratio diagrams. Their discussion can be
summarized by this author (Asquith), why transform if transformation is not needed
or does logarithmic transformation obscure otherwise salient features of the data? A
benefit of log10 transformation, however, is that logarithmic transformation can simplify
analysis of strictly positive data as untransformation of a distribution of logarithms does
not produce negative values. However, the blipped distribution modeling described in
Section 12.6 could mitigate for negative values as well as zero values.
1,
2,
3 ) were comsample product moments (
pm ,
pm , pm ) and sample L-moments (
puted. The sample L-moments then were converted to Pearson Type III parameters to form
L-moment-based product moments (
,
, ). The computation of
pm ,
pm , pm and
,
, for each and pairing was repeated 10,000 times. The mean value for the
10,000 values of each of the six statistics were computed. These mean values provide the
coordinates necessary to render the arrows in figure 12.1312.16.9
1228
376
nsim
<- 10000 # number of simulations
pm.est.sd <- vector(mode = "numeric") # pm estimated sigma
pm.est.g <- vector(mode = "numeric") # pm estimated gamma
lm.est.sd <- vector(mode = "numeric") # L-moment estimated sigma
lm.est.g <- vector(mode = "numeric") # L-moment estimated gamma
for(i in seq(1,nsim)) { # loop the number of simulations
Q
<- quape3(runif(n),pe3pars) # draw n samples from parent
lmr <- lmoms(Q) # compute L-moments
pmr <- pmoms(Q) # compute product moments
estpars <- parpe3(lmr,checklmom=FALSE) # est. PE3 parameters
# store the four sample values into the vectors
pm.est.sd[i] <- pmr$sd
pm.est.g[i] <- pmr$skew
lm.est.sd[i] <- estpars$para[2]
lm.est.g[i] <- estpars$para[3]
}
# compute sample means of the sample statistics
pm.sd <- mean(pm.est.sd); pm.g <- mean(pm.est.g)
lm.sd <- mean(lm.est.sd); lm.g <- mean(lm.est.g)
# display the results
cat(c("SD =",10," pmSD =",pm.sd," lmSD =",lm.sd,"\n"))
cat(c(" G =",5, "
pmG =",pm.g, "
lmG =",lm.g,"\n"))
# The authors computer, after rounding, produces:
SD = 10
pm.estSD = 7.64
lm.estSD = 12.27
G = 5
pm.estG = 2.18
lm.estG = 6.03
Figures 12.1312.16 depict the simulated and parameter space, and each figure represents a different sample size. The graph on the left of each figure represents the results
using product moments and the right graph represents the results using L-moments. The
arrows lead from the population values to the means of the 10,000 sample statistics. The
arrow lengths (arrow head plus shaft) represent bias; long arrows represent large bias
and short line segments represent small bias. For a given estimation technique (product
moment or L-moment), the arrow lengths systematically shorten as sample size increases.
If the length is less than the arrow-head length, then the arrow head is not shown; for this
dissertation then the condition of unbiased is represented by the absence of the arrow
head.
Drawing attention to the left graph of figure 12.13 for n = 10, and by generality, the
product moment (left) graphs in figures 12.1412.16, the arrows are oriented in the
direction (horizontal to the left) and increasingly angled toward the left as increases. The
left graphs show that is reliably estimated for small and , but is substantially underestimated by the product moments as increases. The arrows are symmetrically oriented
377
toward zero in the direction (vertical), which shows that is systematically underestimated by the product moments. The opposite situation is shown for the L-moment case.
The arrow lengths for the L-moments indicate that the magnitude of and are overestimated. However, the arrow lengths for the L-moments generally are much shorter, which
demonstrates superior small sample performance of the sample L-moments.
For n = 10 (fig. 12.13), use of either product moments or L-moments can be questioned,
except in the near symmetrical situation ( = 0) for product moments and approximately
8 and || < 3 for the L-moments. By n = 20 (fig. 12.14), the L-moments provide
essentially unbiased estimation of Pearson Type III parameters for approximately 9
and || < 4. Only in the central region (|| close to 0) do the product moments perform
well. By n = 40 (fig. 12.15), the sample L-moments are effectively unbiased for much of
the parameter space. However, the sample product moments continue to be substantially
biased for approximately || > 2. By n = 100 (fig. 12.16), which often would be considered a large sample size in many hydrologic data sets, the product moments continue to
show substantial bias.
Several observations are made for the and parameter space. L-moments for Pearson Type III parameter estimation appear superior to product moments. The author
acknowledges that this conclusion is not a particularly new contribution in the sense
that L-moments already are documented to have more robust sampling properties than
the product moments. However, the simulations, in particular, dramatically demonstrate
that the skewness of the data in a Pearson Type III context is more reliably estimated
using L-moments. As a general judgement, sample sizes of at least 40 (60 would be better) are sufficient for reliable estimation of the variability and skewness for Pearson Type
III-distributed data. The sample size judgement compares favorably with Guttman (1994)
3 = 0.452. These L-moments were derived from data recorded by 533 rainfall stations
378
1
SKEW
SKEW
-1
-1
-2
-2
-3
-3
-4
-4
-5
-5
-6
-6
-7
-7
0
10
11
12
13
STANDARD DEVIATION
10
11
12
13
STANDARD DEVIATION
1
SKEW
SKEW
Figure 12.13. Bias of sample standard deviation and skew statistics for a Pearson Type III parent
and sample size 10. Left graph is for product moment estimation. Right graph is for L-moment
estimation. Arrows lead from the population values to the means of 10,000 sample statistics.
-1
-1
-2
-2
-3
-3
-4
-4
-5
-5
-6
-6
-7
-7
0
10
11
12
13
STANDARD DEVIATION
10
11
12
13
STANDARD DEVIATION
Figure 12.14. Bias of sample standard deviation and skew statistics for a Pearson Type III parent
and sample size 20. Left graph is for product moment estimation. Right graph is for L-moment
estimation. Arrows lead from the population values to the means of 10,000 sample statistics.
379
1
SKEW
SKEW
-1
-1
-2
-2
-3
-3
-4
-4
-5
-5
-6
-6
-7
-7
0
10
11
12
13
STANDARD DEVIATION
10
11
12
13
STANDARD DEVIATION
1
SKEW
SKEW
Figure 12.15. Bias of sample standard deviation and skew statistics for a Pearson Type III parent
and sample size 40. Left graph is for product moment estimation. Right graph is for L-moment
estimation. Arrows lead from the population values to the means of 10,000 sample statistics.
-1
-1
-2
-2
-3
-3
-4
-4
-5
-5
-6
-6
-7
-7
0
10
11
12
13
STANDARD DEVIATION
10
11
12
13
STANDARD DEVIATION
Figure 12.16. Bias of sample standard deviation and skew statistics for a Pearson Type III parent
and sample size 100. Left graph is for product moment estimation. Right graph is for L-moment
estimation. Arrows lead from the population values to the means of 10,000 sample statistics.
380
throughout Texas with a combined data record in excess of 1.03 million values. The equivalent Pearson Type III parameters for these L-moments are = 24.5 mm, = 31.2 mm,
and = 2.75.
These parameters define a PE30 parent, PE30 (24.5 mm, 31.2 mm, 2.75), of storm depth.
A random sample of n = 20 was drawn from this parent to represent somewhat heavytailed hydrologic data for example purposes. The random sample is shown in figure 12.17
along with the parent PE30 distribution.10 The sample product moments are
pm = 29.0,
pm = 35.0, pm = 1.89, and the sample L-moments, expressed as Pearson Type III
parameters, are
= 29.0,
= 38.4, = 2.70. These two Pearson Type III distributions [PE3pm (29.0, 35.0, 1.89) and PE3 (29.0, 38.4, 2.70)] are shown in figure 12.17 by
the black curves.
The parent distribution is heavy tailed with = 2.75. The results in Section 12.8.2
show that the sample product moments have considerable bias for data having this much
skew. Therefore, following a step that a practitioner might (should?) do, and to facilitate comparison purposes, log10 transformation of the data was made, the sample product moments and L-moments again were computed, and log-Pearson Type III fit to both
moment types. The two log-Pearson Type III distributions [LP3pm (1.13, 0.599, 0.103)
and LP3 (1.13, 0.623, 0.157)] are shown in figure 12.17 by the thin grey curves.
Several observations of the two sample Pearson Type III and two sample log-Pearson
Type III curves are made. PE3pm is truncated at about F < 0.2 (horizontal axis), which
reflects negative quantiles. In general, the focus of distributional analysis is on the right
or high magnitude tail (F 0.5) of the distribution. For the remainder of this discussion,
therefore, indifference to the left tail is made, and the presence of negative quantiles is
ignored.
From the figure, an immediately apparent difference between the two Pearson Type III
and two log-Pearson Type III for the sample is that the log-Pearson Type III curves are
straighter (less skewed) in the logarithmic axis than the Pearson Type III curves. As a result,
the quantiles for F > 0.90 relative to the parent are overestimated by the log-Pearson
Type IIIas judged by the thin lines plotting above the thick grey line of the parent. The
overestimation is considerable. Whether or not this observation is a vagary of sampling can
be explored by simulation. Natural questions are: (1) on average, does log-Pearson Type
III overestimate (to clarify, the use of an log-Pearson Type III distribution) for F > 0.90
10
This figure was generated by the authors TKG2 graphics package and annotated in Adobe
Illustrator CS3.
381
as hinted at by the figure or (2) does log-Pearson Type III underestimate for F > 0.90?
These questions and several others are explored in the next section.
400
300
200
100
70
50
30
20
10
7
5
3
2
1
0.7
0.5
1
10
15 20
30
40
50
60
70
80 85
90
95
98
99
EXPLANATION
PEARSON TYPE III PARENT
Figure 12.17. Comparison of product moment and L-moment fits of Pearson Type III and log Pearson Type III to 20 samples drawn from a Pearson Type III parent
382
F = nonexceedance probability
200
direction of overestimation
F = 0.99
F = 0.98
100
80
direction of overestimation
F = 0.96
60
50
40
F = 0.90
30
Interpretation Example:
Bias if a PE3 is fit by
product moments and
parent distribution is LP3.
F = 0.80
20
F = 0.70
F = 0.5
10
10
F = 0.60
20
30
40
50 60
80
100
QUANTILE, IN MILLIMETERS
200
300
400
EXPLANATION
PEARSON TYPE III (PE3) USING PRODUCT MOMENTS
PEARSON TYPE III (PE3) USING L-MOMENTS
LOG PEARSON TYPE III (LP3) USING PRODUCT MOMENTS
LOG PEARSON TYPE III (LP3) USING L-MOMENTS
Figure 12.18. Comparison of product moment and L-moment estimation of the 0.99 quantile of
Pearson Type III and log-Pearson Type III parents using both nontransformed and log10 transformed data for a sample size of 20. Arrows lead from the population value to the means of
10,000 sample statistics.
should the fitted log-Pearson Type III or Pearson Type III be preferred and how should
either be estimated?
The
value of the sample is greater than about 1.5, which from the left graph in figure 12.14 suggests that skew is large enough that log10 transformation might be warranted
to increase the effectiveness of the product moments. The left graph in figure 12.14 shows
that the sample product moments are expected to underestimate and in fact
< .
The right graph in the figure shows that the L-moment estimate of is unbiased. Based
on visual or graphical comparison of the data points to the fitted distributions shown in
figure 12.17, one might conclude that the log-Pearson Type III is appropriate; however,
much caution is advised in judging fit for such a small sample in this way.
When analyzing a sample such as in figure 12.17, the analyst has a serious quandary.
Which of the four fitted curves to the n = 20 data given application of a Pearson Type III
383
family is most appropriate? (For this thought experiment, the fact that the actual parent
is Pearson Type III is not known.) The quandary is that four options exist, and collectively,
these options are termed the four methods and are:
1. Compute sample product moments and fit the Pearson Type III, which is abbreviated
as PE3pm ;
2. Compute sample L-moments and fit the Pearson Type III, which is abbreviated as
PE3 ;
3. Perform log10 transform, compute sample product moments, and fit the log-Pearson
Type III, which is abbreviated as LP3pm ; and
4. Perform log10 transform, compute sample L-moments, and fit the log-Pearson Type
III, which is abbreviated as LP3 .
The PE30 parent is in real space. As will become evident, a somewhat equivalent version
of PE30 as a log-Pearson Type III parent (LP30 ) will be useful. A giant sample size of
n = 1,000,000 was drawn from PE30 , the L-moments of log10 transformed values were
computed, and the log-Pearson Type III parameters estimated. The estimated LP30 is
LP30 (1.0929, 0.3021, 0.01935).
The PE30 and LP30 distributions are used in a simulation experiment involving selected
quantiles X(F ) for F = (0.5, 0.6, 0.7, 0.8, 0.9, 0.96, 0.98, 0.99). The results of the experiment are shown in figure 12.18. Similar to earlier figures, the arrows lead from the population value to the sample values for each quantile, more precisely for figure 12.18 alone,
because of limitations of the interactive-graphical editing software,11 the arrow-head centers are at the coordinates of the sample values. (This rendering is in contrast to the arrow
heads in figs. 12.1312.16.)
For each of the selected F values, the eight true values PE30 (F ) and LP30 (F ) were
computed. These values are identified in figure 12.18 at the nexus of the arrow clusters
and the corresponding F value label. The horizontal axis represents the PE30 (F ) values,
and the vertical axis represents the LP30 (F ) values.
The simulation experiment was conducted as follows. In a process that was repeated
10,000 times for each F value, samples n = 20 were drawn from PE30 (24.5, 31.2, 2.75)
and separately from LP30 (1.0929, 0.3021, 0.01935). For each sample,
pm ,
pm , and pm
log
log
log
were computed and
pm ,
pm , and pm of a log10 transformation of the sample. Using
11
384
these values, the quantiles of the fitted PE3pm and LP3pm were computed. Finally, the
means of the 10,000 quantiles of fitted PE3pm and LP3pm for each F were computed.
These sixteen mean values provide the coordinates at the center of the magenta and black
arrow heads in figure 12.18.
Similarly, for the same n = 20 samples, the L-moments were computed and converted
log
log , log ). Again, using these values, the quantiles of the fitted PE3 and LP3 were
computed. Finally, the means of the 10,000 quantiles of fitted PE3 and LP3 for each F
were computed. These 16 mean values provide the coordinates at the center of the cyan
and green arrow heads infigure 12.18.
The lengths of the arrows in the figure represent bias. The choice of log10 for both axis
scales is intentional so relative bias for each F is represented. Arrows oriented toward
the right indicate that overestimation of PE3 occurs, and arrows oriented toward the top
indicate that overestimation of LP3 occurs. The cyan arrows (estimation by L-moments
without log10 transformation of the data) are almost all systematically shorter than the others. This indicates that use of a Pearson Type III fitted by L-moments is preferred whether
the parent is Pearson Type III or log-Pearson Type III. The magenta arrows (estimation
by PE3pm ) are generally the longest, which indicates the poorest performance of the four
methods.
The description of the LP3pm and LP3 methods is more complex. Each method apparently outperforms PE3pm for F 0.90 but appears to dramatically underperform for
F > 0.90. The LP3pm and LP3 perform similarly and for a given F are oriented in the
same direction (unlike PE3pm and PE3 ). As F increases above F 0.96, LP3 appears
to dramatically underperform and, in particular, underperforms (by overestimation) for
PE30 . This implies that use of L-moments on log10 transformed data, whether the true
parent form was PE30 or LP30 , provides little and perhaps even a harmful parameter estimation benefit for large F .
ness of the Pearson Type III parent becomes large; the product moments underestimate
both variability and skewness. Under conditions of near zero skewness, sample product
moments and L-moments have similar performance. The use of any moment statistic for
small samples requires caution. The L-moments overestimate the variability and skewness for the Pearson Type III for small samples, but by a sample size of 40, the sample
L-moments can be considered reasonably unbiased.
Logarithmic transformation of the data decreases skewness and is a useful and important tool for increasing the performance of product moments. The comparison of Pearson
Type III and log-Pearson Type III parameter estimation for a hypothetical right-tail heavy
sample of size 20 suggests that a PE3 performs better whether the actual parent distribution is either Pearson Type III or log-Pearson Type III. Finally, the author concludes that
PE3 estimation generally should be preferred over PE3pm estimation in applied circumstances. This conclusion is complementary to that of Wallis (1988, p. 311) who concludes
at a minimum that LP3 should be preferred over LP3pm .
[2]
[1]
values of X [2] , Serfling and Xiao refer to the element of {Xi , , Xn } that is paired
[2]
[12]
[2]
with Xj:n the concomitant Xj:n of Xj:n . The authors Serfling and Xiao show that the
[12]
r
r1
1X
[12]
j r1
=
E[Xrj:n ]
(1)
r j=0
j
(12.24)
Serfling and Xiao, using (12.24), subsequently provide an unbiased sample estimator
n
X (r) [12]
b[12] = 1
w X
r
n j=1 j:n j:n
(12.25)
(r)
b[12]
where the weights wj:n are computed as in eq. (6.50) and
is defined as the rth
r
L-comoment of X [1] with respect to X [2] . Likewise the respective estimator for the rth
L-comoment of X [2] with respect to X [1] is
n
X (r) [21]
b[21] = 1
w X
r
n j=1 j:n j:n
(12.26)
b[21]
6=
or the expected co-movements of X [1] with respect
r
are not necessarily the same as the expected co-movements of X [2] with respect
br
usually are not), that is,
to X [2]
to X [1] . Like Serfling and Xiao, the author embraces the asymmetry as a feature of these
statistics. The asymmetry is counter to the symmetry defined into conventional measures
of association (Nelson, 2006, p. 169), such as the measures of concordance statistics of
Kendalls Tau and Spearmans Rho (see help(cor)).
[12]
[12]
[1]
[21]
[21]
[2]
Using R
Using R
The L-comoments are readily demonstrated with several functions of the lmomco package. Starting in example 1229 , a bivariate random sample of n = 500 for a standard
Normal distributed X with Y being computed as shown along with a standard Normal
error term. The bivariate sample is stored in the data frame D. The example continues by
plotting the simulated data in figure 12.19 along with the two rug plots, which are created
387
by the rug() function in a semi-transparent red color. The rug plots show the marginal
distribution of each variable or drape the values onto the respective axis of the variable.
1229
The plot in figure 12.19 shows that the bivariate sample has a somewhat complex dependency structure between X and Y. The horizontal-axis rug plot shows symmetrically distributed values with tapering tails and is obviously standard Normal. The distribution
of Y that is shown on the vertical-axis rug plot shows that the distribution has positive
10
Figure 12.19. Simulated bivariate data for computation of L-comoments from example 1229
Example 1230 continues the discussion by computing the first L-comoment using
the Lcomoment.matrix() function for k=1. The results are shown. In particular, the
388
content of the $matrix attribute holds the L-comoment matrix of order 1. This matrix
contains each arithmetic mean as the subsequent call to the mean() function confirms at
the end of the example.
1230
Lcomoment.matrix(D,k=1)
$type
[1] "Lcomoment.matrix"
$order
[1] 1
$matrix
[,1]
[,2]
[1,] 0.07685957
NA
[2,]
NA 1.122278
J
Continuing with the bivariate random sample in variable D from example 1229 , the
L-comoment-matrix of order 2 is computed in example 1231 and set into variable L2.
Using the second order matrix, the L-correlation between the two variables is computed
by the Lcomoment.correlation() function, and the results are shown.
1231
[21]
= 0.117 and 2
= 0.122.
These are small values, so the association between the variables (note the lack of numerical
389
equality in the statistics) is weak. This conclusion is confirmed using the cor() function to
compute a Spearmans Rho of about 0.115 as shown in example 1231 . Many measures of
association, such as Kendalls Tau and Spearmans Rho, are symmetric statistics (Nelson,
2006, p. 169), that is, the equality cor(X,Y)=cor(Y,X) exists. This is not true of the
L-comoments.
Continuing the presentation and using the bivariate random sample in variable D from
example 1229 , the L-comoment-matrix of order 3 is computed in example 1232 and
set into variable L3. For subsequent comparison, the familiar L-moments of variable X
(contained in D$X) are computed by the lmoms() function and set into variable LMRx.
The third L-moment is 3 = 0.0086 as shown in example 1232 .
1232
Example 1232 continues by computing the L-coskew between the two variables using
the Lcomoment.coefficients() function. This function requires the L-comoment
matrix of order 2 (L2) from example 1231 as the second argument. The results show
[12]
that 3
[21]
= 0.06 and 3
= 0.64.
390
The two sample L-coskews attain different values. Can the differences (0.06 0.64)
[12]
be interpreted? The 3
In the output, 3
and
[31]
3
= 0.63. Readers are asked to notice that these two L-coskew values are of
similar magnitude as anticipated but differ in sign because of the negation of Z relative
to Y.
Example 1233 shows that the L-comoments are readily computed for >2-dimensional
data using the Lcomoment.coefficients() function. Because bivariate data are so
common, the lmomco package provides the lcomoms2() function (the 2 in the function
name reflects 2 dimensional) to provide potentially more accessible L-comoment data
structures.
Some setup of new mathematics is needed before the lcomoms2() function is used for
an example of multivariate distributional analysis.
Nelson (2006) provides a comprehensive introduction to copulas, which are special multivariate distributions having marginal distributions that are Uniform. The copula C(u, v)
(bivariate) is the expression of the joint nonexceedance probability of random variable U
and random variable V . The quantities u and v are the respective nonexceedance probabilities.
391
Solely for the purpose of illustration, the Marshall-Olkin copula is used. The copula is
set by parameters and , and the copula possesses some interesting L-comoments. The
Marshall-Olkin copula is
C(u, v) = min(vu1 , uv 1 )
(12.27)
and this bivariate copula is created in example 1234 by the MOcop() function. The
function receives the two probabilities u and v and a vector of parameters in the para
argument.
1234
The method of conditional simulation (Nelson, 2006, pp. 4042) can be used to create
random pairs u and v as jointly distributed by a copula. The method requires a function to
compute the inverse of the derivative of a copula. In example 1235 , the derCOPinv()
function is created to numerically compute the inverse of the derivative of a copula for a
given u.
1235
Finally, in example 1237 , the Marshall-Olkin copula of eq. (12.27) is simulated for
n = 1,000, and the results are shown in figure 12.20. The figure shows a complex and
asymmetrically dependent joint distribution that also has both continuous and singular
components. By inspection of the plot, the data have positive association, and therefore,
the data should have positive L-correlation. The asymmetry of the plot suggests that the
data should have non-zero L-coskew.
1237
393
$T3
[,1]
[,2]
[1,] 0.02575336 0.19724727
[2,] -0.02013093 0.01465324
$T4
0.2
0.4
0.6
0.8
0.0
1.0
[,1]
[,2]
[1,] -0.004583203 0.014791149
[2,] 0.051722854 -0.001361602
0.0
0.2
0.4
0.6
0.8
1.0
Figure 12.20. Simulated bivariate data from Marshall-Olkin copula = 0.4 and = 0.9 (open
circles) from example 1237
Example 1237 continues after the plotting operations by computing the first four
L-comoments using the lcomoms2() function. The L-moments (the matrix diagonals)
and L-comoments (the off diagonals) for U and V for the low moment orders (r = 1, 2)
are the two matrices
394
"
b[1,2] =
0.482
--
0.490
"
#
0.169 0.085
means
(12.28)
(12.29)
--
b[12] =
0.086 0.168
"
[12]
b2
#
0.506
0.511
L-correlations
(12.30)
and for the higher moment orders (r = 3, 4), the L-moments and L-comoments are the
two matrices
"
[12]
b3
=
"
[12]
b4
0.026
#
0.197
0.020
0.015
#
0.015
0.005
0.052 0.001
(12.31)
(12.32)
To summarize the part of the notation, the quantity [12] implies the row-major order of
matrix entries of {[1], [12], [21], [2]}.
The preceding example involves the Marshall-Olkin copula with = 0.4 and = 0.9
and shows that the L-comoments are capable of measuring asymetrical skew (L-coskew).
[21]
[21]
[12]
0.20. Now, the parameters of the Marshall-Olkin copula are reversed in example 1238 ,
and an n = 1,000 simulation is performed. The results are set into variable simB. Finally,
the simulated copula from example 1237 again is plotted in figure 12.21 with the new
simulated copula superimposed.
It is seen in figure 12.21 that the two copulas are stochastically-reflected images of each
other. Therefore, there is the expectation that the L-coskew values will have different signs
than those seen in example 1237 . In fact, example 1238 shows this to be the case.
1238
395
Example 1238 continues by using the lcomoms2() function to compute the first four
[12]
[12]
b3
0.016 0.081
= z }| { | {z } Marshall-Olkin copula (=0.9, =0.4)
0.191 0.001
[12]
b3
0.026
=
0.020
| {z }
(12.33)
z }| {
0.197
Marshall-Olkin copula (=0.4, =0.9)
0.015
(12.34)
}|
and underbrace
| {z }. The paired values are effectively the same, but differ in position within
[12]
the b3
L-comoment matrix.
396
0.2
0.4
0.6
0.8
0.0
1.0
0.0
0.2
0.4
0.6
0.8
1.0
Figure 12.21. Simulated bivariate data from Marshall-Olkin copulas with = 0.4 and = 0.9
(open circles) and = 0.9 and = 0.4 (filled circles) from example 1238
To further examine this observation, the two Marshall-Oklin copulas have the same
parameters that only are exchanged with each other. Either copula has the same Spearmans Rho because Rho is defined for the Marshall-Olkin copula as
Spearmans Rho =
(12.35)
This formula obviously results in the same numerical value for exchanged parameter
values. Yet figure 12.21 clearly shows that the associative structure of the two bivariate distributions are distinct. The L-comoments quantify the asymmetry in the bivariate relation,
whereas Spearmans Rho is incapable of capturing such asymmetry.
In conclusion, L-comoments have obvious applications in evaluation of multivariate
dependency structure and for parameter estimation for multivariate distributions, including parameter estimation for copulas. However, further elucidation and pursuit of a
method of L-comoments for parameter estimation of copulas is beyond the scope of this
dissertation.
397
12.10 Summary
This chapter presents more advanced demonstrations of L-moment-based distributional
analysis than seen in the other chapters. The 38 examples provided readily followed and
extendable examples of right-tail and left-tail censoring distributional analysis. The former
is common in survival and lifetime analysis, whereas, the later is common in hydrologic
or environmental data involving detection limits. Subsequently, the censoring discussion
expands to include right-tail censoring by indicator variable and left-tail censoring by indicator variable through variable flipping. Following the censoring material, conditional
probability adjustment for the presence of zero values by blipped-distribution modeling is shown. Although zero values are likely the most common application, the examples should be readily extendable to other lower thresholds. An extended discussion and
demonstration of quantile uncertainty involving simulated sampling error (error related
to sample size) and model-selection error (error related to choice of distribution) is provided. An extensive comparison of the performance of product moments and L-moments
for parameter estimation for a wide range of skewness within Pearson Type III and logPearson Type III distributions is made. The results show that L-moments can significantly
outperform product moments in terms of bias and that L-moments are preferred whether
the parent distribution is Pearson Type III or log-Pearson Type III. Finally, this chapter and
this dissertation ends with an introduction to multivariate L-moments or L-comoments,
their sample computation, and applications that they might have in the context of applied
statistical analysis using copulas.
398
Epilogue
This dissertation concerns distributional analysis with L-moment statistics using R. The
breadth of the text is ambitious, complex, and encompasses the background, mathematics, algorithms, techniques, interpretations, references, and indexing needed for thorough
documentation of L-moments and related statistics for the R environment for statistical computing. These elements are needed by beginners and many are useful to experts
involved in distributional analysis of Normal to non-Normal, symmetrical to asymmetrical, and thin to heavy-tailed distributions. A wide range of disciplines are anticipated to
be, or are already, impacted by material in this dissertation, the lmomco package, and other
L-moment-related packages for R. Such judgement is made because statistical analysis of
distributions touches investigations and research in all scientific, engineering, medical,
and financial endeavors. It therefore is fitting to end this dissertation with a summary of
the impact of the lmomco package (Asquith, 2011) and commentary on where to go from
here.
Impact of the lmomco Package
Close to the date of publication of this dissertation, there are several recognizable citations of the lmomco package that are found through Internet searches:
General Statistical ProgrammingCohen and Cohen (2008) provide a substantial
book on statistical programming using R that references the lmomco package, although a
traditional citation (end of chapter or end of text) to Asquith (2011) seems to be missing.
The lmomco package is suggested for initial parameter guessing of a distribution for
handoff into the numerical methods of the method of maximum likelihood.
AgricultureLiou and others (2007) cite the lmomco package; although the authors
identify the author of lmomco as William, H.A. The article appears in a Chinese agricul399
tural engineering journal; however, the abstract (only part in English) suggests that the
authors purpose (seemingly more general than agriculture engineering) is to evaluate
the power of a goodness-of-fit test concerning L-moment ratio diagrams to established
goodness-of-fit tests (Komogorov-Smirnov and Chi-squared).
BiologyThe asbio package (Aho, 2010) in R reverse suggests the lmomco package.
BioinformaticsThe L-moment ratio diagram functions of lmomco are used to produce
figures in Thomas and others (2010, p. 6); although the authors identify the package as
lmomc.
FinanceThe lmomco and Lmoments (Karvanen, 2009) packages are used by Kerstens
and others (2010) for computation of L-moments.
GeophysicsThompson and others (2007, p. 3) use lmomco to compute at least the
L-moments. Although distributions are used and in particular the Gumbel is used, the
authors do not seem to identify the algorithmic source for their distributional support.
HydrologyMany hydrologic articles and reports on water resources with emphasis
towards regionalization of floods or streamflow exist for which reference to lmomco is
made (Cobo and Verbist, 2010; Neykov and others, 2007; Rustomji, 2009, 2010; Rustomji
and others, 2009; Roudier and Mahe, 2009; van Nooijen and Kolechkina, 2010a,b). In
particular, Rustomji and others (2009) credit lmomco in their Acknowledgements, Statistical analyses were undertaken using the lmomco package.
MeteorologyMorgan and others (2011) use lmomco support of the Wakeby distribution in research into the distributions of offshore wind speed.
The author personally thanks these investigators and researchers for crediting the
lmomco package.
Extensions of L-moments and the lmomco Package
It is natural for this epilogue to consider or suggest extensions to L-moment theory, in
general, and the lmomco package, in particular. Extension of the L-comoments into leftand right-tail censored multivariate data would be fascinating. The author has dabbled in
parameter estimation of copulas (bivariate versions) using the L-comoments and promise
is shown for the particular problem of fitting copulas that model particularly asymmetric
multivariate probabilities. Extension of the L-moments to simultaneous left- and rightcensoring by indicator variable might be useful in some disciplines.
400
The lmomco package is an open-ended library available to the global community. The
author would like to see audits and enhancements to the lmomco users manual (Asquith,
2011) to bring the manual, as needed, into concordance with this dissertation. Invitation
is extended to readers to communicate with the author suggestions and contributions in
pursuit of continual enhancement and extension of both documents (or their derivatives).
Specific enhancements to lmomco are now identified.
The author would like additional distributions, such as the L-moments of the asymmetric exponential power distribution by Delicado and Goria (2008), added to lmomco as
well as the distributions of Section 8.3. Another example is the truncated exponential distribution that is considered by Vogel and others (2008) in the application of L-moments
for distributional analysis and goodness-of-fit of species extinction time based on sightings. Other distributions most certainly exist in which the L-moments (or equivalently the
probability-weighted moments) have been or will be derived in the future. It would be
exciting to have these added to lmomco.
The lmomco package would be substantially enhanced by the inclusion of the A- and
B-type probability-weighted moments and the A- and B-type probability-weighted
moments for more distributions than just the Reverse Gumbel as currently (May 2011)
implemented. Hosking (1995) provides the A- for the Weibull distribution and B- for the
Generalized Pareto and Gamma distributions. These three apparently are not yet implemented in any R package.
As of May 2011, the lmomco package has a heavily procedural language structure
with hints of object-oriented design. Perhaps one day, a fully object-oriented version will
emerge and new features and flexibility will result. An object-oriented code base might
facilitate the adaption of quantile function algebra and parameter estimation into the package. The incorporation of quantile function algebra would facilitate the construction of
even more complex distributions than those shown in this dissertation.
401
References
The author refrains from providing a padded bibliography in the age of readily available topical
and bibliographical searches on the Internet. Bibliographic entries with a right justified on the
terminal line are those which were not acquired by the author, although abstracts or summaries
may have been consulted, prior to completion of this dissertation. Their citation in the text is
sourced by one or more other entries. In most cases, the -entry should be understood to have
historical significance to L-moments or provide additional topical context for which citation might
be useful to some readers. All other entries have been acquired and reviewed at various times by
the author during the period 19952011.
Adler, D., 2005, vioplotViolin plot: R package version 0.2, dated October 29, 2005, initial package release July 16, 2004, http://www.cran.r-project.org/package=
vioplot.
Adler, J., 2010, R in a nutshell: Sebastopol, California, Florida, OReilly Media, Inc.,
ISBN 9780596801700, 611 p.
Aho, K., 2010, asbioA collection of statistical tools for biologists: R package version
0.3-28, dated December 09, 2010, initial package release July 16, 2004, http://www.
cran.r-project.org/package=asbio.
Alkasasbeh, M.R., and Raqab, M.Z., 2008, Estimation of the generalized logistic distribution parametersComparative study: Statistical Methodology, v. 6, pp. 262279.
Ahmad, U.M., Shabri, A., and Zakaria, Z.A., 2011, Flood frequency analysis of annual
maximum stream flows using L-moments and TL-moments: Applied Mathematical
Sciences, v. 5, no. 5, pp. 243253.
Asquith, W.H., 1998, Depth-duration frequency of precipitation for Texas: U.S. Geological Survey Water-Resources Investigations Report 984044, 107 p.
Asquith, W.H., 2001, Effects of regulation on L-moments of annual peak streamflow in
Texas: U.S. Geological Survey Water-Resources Investigations Report 014243, 66 p.
402
Chambers, J.M., Cleveland, W.S., Kleiner, B., and Tukey, P.A., 1983, Graphical methods
for data analysis: Pacific Grove, California, Wadsworth and Brooks/Cole, ISBN 0
871504138, 395 p.
404
Dingman S.L., 2002, Physical hydrology, 2nd ed.: Upper Saddle River, New Jersey,
Prentice-Hall, ISBN 0130996955, 646 p.
Delicado, P., and Goria, M.N., 2008, A small sample comparison of maximum likelihood, moments, and L-moments methods for the asymmetric exponential power
distribution: Computational Statistics and Data Analysis, v. 52, pp. 16611673.
Dupuis, D.J., and Winchester, C., 2001, More on the four-parameter kappa distribution:
Journal of Statistical Computation and Simulation, v. 71, no. 2, pp. 99113.
Durrans, S.R., 1992, Distributions of fractional order statistics in hydrology: Water
Resources Research, v. 28, no. 6, pp. 16491655.
Efron, B., 1988, Logistic regression, survival analysis, and the Kaplan-Meier curve: Journal of the American Statistical Association, v. 83, no. 402, pp. 414425.
Elamir, E.A.H, and Seheult, A.H., 2003, Trimmed L-moments: Computational Statistics
and Data Analysis, v. 43, pp. 299314.
Elamir, E.A.H, and Seheult, A.H., 2004, Exact variance structure of sample L-moments:
Journal of Statistical Planning and Inference, v. 124, pp. 337359.
Evans, M., Hastings, N.A.J., and Peacock, B.J., 2000, Statistical distributions, 3rd ed.:
New York, John Wiley, ISBN 0471371246, 221 p.
Everitt, B.S., 2005, An R and S-PLUS companion to multivariate analysis: London,
Springer, ISBN 1852338822, 221 p.
Everitt, B.S., and Hothorn, T., 2005, A handbook of statistical analyses using R: Boca
Raton, Florida, Chapman and Hall/CRC, ISBN 1584885394, 275 p.
Faraway, J.J., 2005, Linear models with R: Boca Raton, Florida, Chapman and Hall/CRC,
ISBN 1584884258, 229 p.
Faraway, J.J., 2006, Extending the linear model with RGeneralized linear, mixed
effects and nonparametric regression models: Boca Raton, Florida, Chapman and
Hall/CRC, ISBN 158488424X, 301 p.
Gilchrist, W.G., 2000, Statistical modelling with quantile functions: Boca Raton, Florida,
Chapman and Hall/CRC, ISBN 1584881747, 320 p.
Gilleland, E., Katz, R., and Young, G., 2010, extRemesExtreme value toolkit: R
package version 1.62, dated April 25, 2010, initial package release March 19, 2004,
http://www.cran.r-project.org/package=extRemes.
405
Gini, C., 1912, Variabilit e mutabilit, contributo allo studio delle distribuzioni e delle
relazione statistiche: Studi Economico-Giuridici della Reale Universit di Cagliari,
v. 3, pp. 3159.
Greenwood, J.A., Landwehr, J.M., Matalas, N.C., and Wallis, J.R., 1979, Probability
weighted momentsDefinition and relation to parameters of several distributions
expressible in inverse form: Water Resources Research, v. 15, pp. 10491054.
Guttman, N.B., 1993, The use of L-moments in the determination of regional precipitation climates: Journal of Climate, v. 6, no. 12, pp. 23092325.
Guttman, N.B., 1994, On the sensitivity of sample L moments to sample size: Journal of
Climate, v. 7, pp. 10261029.
Guttman, N.B., Hosking, J.R.M., and Wallis, J.R., 1993, Regional precipitation quantile values for the continental United States computed from L-moments: Journal of
Climate, v. 6, no. 12, pp. 23092325.
Haktanir, T., 1997, Self-determined probability-weighted moments method and its
application to various distributions: Journal of Hydrology, v. 194, pp. 180200.
Hald, A., 1998, A history of mathematical statistics from 1750 to 1930: New York, John
Wiley, ISBN 0471179124, 795 p.
Hamada, M., 1995, Analysis of experiments for reliability improvement and robust reliability: in Balakrishnan, N. (ed.) Recent Advances in Life-Testing and Reliability: Boca
Raton, Florida, CRC Press, ISBN 0849389720, pp. 155172.
Hansen, W.R., 1991, Suggestions to authors of the reports of the United States Geological Survey: U.S. Government Printing Office, Washington, D.C., 7th ed., 289 p.
Heiberger, R.M., and Holland, B., 2005, Statistical analysis and data displayAn intermediate course with examples in S-Plus, R, and SAS: New York, Springer, ISBN 0
387402705, 729 p.
Helmert, F.R., 1876, Die Berechnung des wahrscheinlichen Beobachtungsfehlers aus den
ersten Potenzen der Differenzen gleichgenauer director Beobachtungen: Astronomische Nachrichten, v. 88, pp. 127132. [citation by David (1981), but Wiley Interscience reports:
Helmert, 1876, Die Genauigkeit der Formel von Peters zur Berechnung des wahrscheinlichen Beobachtungsfehlers directer Beobachtungen gleicher Genauigkeit: Astronomische
Nachrichten, v. 88, no. 89, pp. 113131.]
Helsel, D.R., 2005, Nondetects and data analysisStatistics for censored environmental
data: Hoboken, New Jersey, John Wiley, ISBN 0471671738, 250 p.
406
Helsel, D.R., and Hirsch, R.M., 1992, Statistical methods in water resources: New York,
Elsevier, ISBN 0444885285, 529 p.
Helsel, D.R., and Hirsch, R.M., 2002, Statistical methods in water resources: U.S. Geological Survey Techniques of Water-Resources Investigations, book 4, chap. A3, 510 p.,
http://pubs.usgs.gov/twri/twri4a3/
Hershfield, D.B., 1961, Rainfall frequency atlas of the United States for durations from
30 minutes to 24 hours and return periods from 1 to 100 years: Washington, D.C.,
U.S. Weather Bureau Technical Paper 40, 61 p.
Hollander, M., and Wolfe, D.A., 1973, Nonparametric statistics: New York, John Wiley,
ISBN 047140635X, 503 p.
Hosking, J.R.M., 1985, Maximum-likelihood estimation of the parameters of the generalized extreme-value distribution: Applied Statistics, v. 34, pp. 30110.
Hosking, J.R.M., 1986, The theory of probability weighted moments: Research Report
RC12210, IBM Research Division, Yorktown Heights, New York, reissued with corrections April 1989, 160 p.
Hosking, J.R.M., 1990, L-momentsAnalysis and estimation of distributions using linear combinations or order statistics: Journal of Royal Statistical Society, series B, v. 52,
no. 1, pp. 105124.
Hosking, J.R.M., 1992, Moments or L moments?An example comparing two measures
of distributional shape: American Statistician, v. 46, no. 3, pp. 186189.
Hosking, J.R.M., 1994, The four-parameter kappa distribution: IBM Journal of Research
and Development, Yorktown Heights, New York, v. 38, pp. 251258.
Hosking, J.R.M., 1995, The use of L-moments in the analysis of censored data: in Balakrishnan, N. (ed.) Recent Advances in Life-Testing and Reliability: Boca Raton, Florida,
CRC Press, ISBN 0849389720, pp. 545564.
Hosking, J.R.M., 1996a, Some theoretical results concerning L-moments: Research
Report RC14492, IBM Research Division, T.J. Watson Research Center, Yorktown
Heights, New York.
Hosking, J.R.M., 1996b, FORTRAN routines for use with the method of L-moments,
version 3: Research Report RC20525, IBM Research Division, T.J. Watson Research
Center, Yorktown Heights, New York.
Hosking, J.R.M., 1998, L-moments, in Kotz, S., Read, D.L., (eds.): Encyclopedia of Statistical Sciences, v. 2, John Wiley, New York, pp. 357362.
407
Hosking, J.R.M., 1999, L-moments and their applications in the analysis of financial
data: Research Report RC21466, IBM Research Division, T.J. Watson Research Center,
Yorktown Heights, New York.
Hosking, J.R.M., 2000, Maximum-entropy characterization of the logistic distribution
using L-moments: Research Report RC21691, IBM Research Division, T.J. Watson
Research Center, Yorktown Heights, New York.
Hosking, J.R.M., 2006, On the characterization of distributions by their L-moments: Journal of Statistical Planning and Inference, v. 136, no. 1, pp. 193198.
Hosking, J.R.M., 2007a, Distributions with maximum entropy subject to constraints
on their L-moments or expected order statistics: Journal of Statistical Planning and
Inference, v. 137, no. 9, pp. 28702891.
Hosking, J.R.M., 2007b, Some theory and practical uses of trimmed L-moments: Journal
of Statistical Planning and Inference, v. 137, no. 9, pp. 30243039.
Hosking, J.R.M., 2007c, Supplement to Distributions with maximum entropy subject to
constraints on their L-moments: Research Report RC24177, IBM Research Division,
T.J. Watson Research Center, Yorktown Heights, New York.
Hosking, J.R.M., 2009a, lmomL-moments: R package version 1.5, dated November 29,
2009, initial package release July 3, 2008, http://www.cran.r-project.org/
package=lmom.
Hosking, J.R.M., 2009b, lmomRFARegional frequency analysis using L-moments: R
package version 2.3, dated August 22, 2010, initial package release March 3, 2009,
http://www.cran.r-project.org/package=lmomRFA.
Hosking, J.R.M., Bonti, G., and Siegel, D., 2000, Beyond the lognormalAccurate
estimation of the frequency of rare events in VaR calculations: Risk, v. 13, no. 5,
pp. 5962.
Hosking, J.R.M., and Wallis, J.R., 1987, Parameter and quantile estimation for the generalized Pareto distribution: Technometrics, v. 29, pp. 339349.
Hosking, J.R.M., and Wallis, J.R., 1993, Some statistics useful in regional frequency
analysis: Water Resources Research, v. 29, no. 2, pp. 271281.
Hosking, J.R.M., and Wallis, J.R., 1995, A comparison of unbiased and plotting-position
estimators of L moments: Water Resources Research, v. 31, no. 8, pp. 20192025.
Hosking, J.R.M., and Wallis, J.R., 1997, Regional frequency analysisAn approach
based on L-moments: Cambridge, Cambridge University Press, ISBN 0521430453,
224 p.
408
Hosking, J.R.M., Wallis, J.R., and Wood, E.F., 1985, Estimation of the generalized
extreme-value distribution by the method of probability-weighted moments: Technometrics, v. 27, pp. 251261.
Houghton, J.C., 1978, Birth of a parentThe Wakeby distribution for modeling flood
flows: Water Resources Research, v. 15, pp. 10551064.
Huber, P.J., 1981, Robust statistics: New York, John Wiley, ISBN 0471418056, 308 p.
Hyndman, R.J., and Fan, Y., 1996, Sample quantiles in statistical packages, American
Statistician, v. 50, pp. 361365.
Jeffrey, A., 2004, Handbook of mathematical formulas and integrals, 3rd ed.: Amsterdam, Elsevier, ISBN 0123822564, 453 p.
Jensen, J.L., Lake, L.W., Corbett, P.W.M., and Goggin, D.J., 1997, Statistics for petroleum
engineers and geoscientists: Upper Saddle River, New Jersey, Prentice Hall, ISBN 0
131318551, 390 p.
Jones, M.C., 2002, Students simplest distribution: Journal of the Royal Statistical Society,
series D (The Statistician), v. 51, no. 1, pp. 4149.
Jones, M.C., 2004, On some expressions for variance, covariance, skewness and
L-moments: Journal of Statistical Planning and Inference, v. 126, pp. 97106.
Jones, M.C., 2009, Kumaraswamys distributionA beta-type distribution with some
tractability advantages: Statistical Methodology, v. 6, pp. 7081.
Jurczenko, E.F., Maillet, B.B., and Merlin, P.M., 2008, Efficient frontier for robust
higher-order moment portfolio selection: Documents de Travail du Centre
d'Economie de la Sorbonne, Centre National de La Recherche Scientifique Working
Papers 2008.62, ISSN 1955611X, 68 p.
Jurekov, J., and Picek, J., 2006, Robust statistical methods with R: Boca Raton, Florida,
Chapman and Hall/CRC, ISBN 1584884541, 197 p.
Kaigh, W.C., and Driscoll, M.F., 1987, Numerical and graphical data summary using
O-statistics: American Statistician, v. 41, no. 1, pp. 2532.
Kampstra, P., 2008a, beanplotVisualization via beanplots: R package version 1.1, dated
November 6, 2008, http://www.cran.r-project.org/package=beanplot.
Kampstra, P., 2008b, BeanplotA boxplot alternative for visual comparison of distributions: Journal of Statistical Software, Code Snippets, v. 28, no. 1, pp. 19, http:
//www.jstatsoft.org/v28/c01/.
409
Kaplan, E.L., and Meier, P., 1958, Nonparametric estimation of incomplete observations:
Journal of the American Statistical Association, v. 53, pp. 457481.
Kroll, C.N., and Stedinger, J.R., 1996, Estimation of moments and quantiles using censored data: Water Resources Research, v. 32, no. 4, pp. 10051012.
Kumaraswamy, P., 1980, A generalized probability density function for double-bounded
random processes: Journal of Hydrology, v. 46, pp. 7988.
Landwehr J.M., Matalas, N.C., and Wallis, J.R., 1979a, Estimation of parameters and
quantiles of Wakeby distributions: Water Resources Research, v. 15, no. 5, pp. 1362
1379.
Landwehr, J.M., Matalas, N.C., and Wallis, J.R., 1979b, Probability weighted moments
compared with some traditional techniques in estimating Gumbel parameters and
quantiles: Water Resources Research, v. 15, no. 5, pp. 10551064.
Landwehr, J.M., Matalas, N.C., and Wallis, J.R., 1980, Quantile estimation with more
or less floodlike distributions: Water Resources Research, v. 16, no. 3, pp. 547555.
Lee, L., 2009, NADANondetects and data analysis for environmental data: R package
version 1.5-3, dated December 22, 2010, initial package release June 24, 2004, http:
//www.cran.r-project.org/package=NADA.
Liou, Jun-Jih, Wu, Yii-Chen, Chiang, Jie-Lun, and Cheng, Ke-Sheng, 2007, Assessing
power of test for goodness-of-fit test using L-moment-ratios diagram: Journal of Chinese Agricultural Engineering, v. 53, no. 4, pp. 8091.
Liou, Jun-Jih, Wu, Yii-Chen, and Cheng, Ke-Sheng, 2008, Establishing acceptance
regions for L-moments based goodness-of-fit tests by stochastic simulation: Journal of
Hydrology, v. 355, pp. 4962.
Maindonald, J.H., and Braun, J., 2003, Data analysis and graphics using RAn
example-based approach: Cambridge, Cambridge University Press, ISBN 0521
813360, 362 p.
Mays, L.W., 2005, Water resources engineering: Hoboken, New Jersey, John Wiley,
ISBN 0471705241, 842 p.
Mercy, J., and Kumaran, M., 2010, Estimation of the generalized lambda distribution from censored data: Brazilian Journal of Probability and Statistics, v. 24, no. 1,
pp. 4256.
Mielke, P.W., 1973, Another family of distributions describing and analyzing precipitation data: Journal of Applied Meteorology, v. 12, no. 1, pp. 275280.
Morgan, E.C., Lackner, M., Vogel, R.M., and Baise, L.G., 2011, Probability distributions for offshore wind speeds: Energy Conversion and Management, v. 52, no. 1,
pp. 1526.
411
Murrell, P., 2006, R graphics: Boca Raton, Florida, Chapman and Hall/CRC, ISBN 1
58488486X, 301 p.
Nelson, R.B., 2006, An introduction to copulas: New York, Springer, ISBN 038728659
4, 269 p.
Neykov, N.M., Neytchev, P.N., Van Gelder, P.H.A.J.M., Todorov, V.K., 2007, Robust
detection of discordant sites in regional frequency analysis: Water Resources
Research, v. 43, W06417, 10 p.
Parida, B.P., 1999, Modeling of Indian summer monsoon rainfall using a four-parameter
kappa distribution: International Journal of Climatology, v. 19, pp. 13891398.
Park, J.S., and Park, B.J., 2002, Maximum likelihood estimation of the four-parameter
kappa distribution using the penalty method: Computers and Geosciences, v. 28,
pp. 6568.
Peel, M., Wang, Q.J., Vogel, R.M., and McMahon, T.A., 2001, The utility of L-moment
ratio diagrams for selecting a regional probability distribution: Hydrological Sciences,
v. 46, no. 1, pp. 147155.
Qian, S.S., 2010, Environmental and ecological statistics with R: Boca Raton, Florida,
Chapman and Hall/CRC, ISBN 9781420062069, 421 p.
R Development Core Team, 2009, Writing R Extensions: R Foundation for Statistical
Computing, Vienna, Austria, version 2.10.1 (2009-12-14), http://www.R-project.
org, PDF file R-exts.pdf.
R Development Core Team, 2010, RA language and environment for statistical computing: R Foundation for Statistical Computing, Vienna, Austria, version 2.12.2 (201012-16), ISBN 3900051070, http://www.R-project.org.
Raju, B.I., and Srinivasan, M.A., 2002, Statistics of envelope of high-frequency ultrasonic
backscatter from human skin in vivo: IEEE Transactions on Ultrasonics, Ferroelectrics,
and Frequency Control, v. 49, no. 7, pp. 871882.
Reimann, C., Filzmoser, P., Garrett, R., and Dutter, R., 2008, Statistical data analysis
explainedApplied environmental statistics with R: West Sussex, England, John
Wiley, ISBN 9780470985816, 343 p.
Ribatet, M., 2009, POTGeneralized Pareto distribution and peaks over threshold:
R package version 1.10, dated October 16, 2009, initial package release September
6, 2005, http://www.cran.r-project.org/package=POT.
Ribatet, M., 2010, RFARegional Frequency Analysis: R package version 0.09, dated
January 14, 2010, initial package release September 14, 2005, http://www.cran.
r-project.org/package=RFA.
412
Rinne, H., 2008, The Weibull distributionA handbook: Boca Raton, Florida, Chapman
and Hall/CRC, ISBN 9781420087437, 808 p.
Rizzo, M.L., 2008, Statistical computing with R: Boca Raton, Florida, Chapman and
Hall/CRC, ISBN 9781584885450, 399 p.
Ross, S., 1994, A first course in probability, 4th ed.: New York, MacMillan College Publishing Company, ISBN 0024038725, 473 p.
Royston, P., 1992, Which measures of skewness and kurtosis are best?: Statistics in
Medicine, v. 11, no. 3, pp. 333343.
Roudier, P., and Mahe, G., 2009, Study of water stress and droughts with indicators
using daily data on the Bani river (Niger basin, Mali): International Journal of Climatology, v. 30, no. 11, pp. 16891705.
Rustomji, P., 2009, A statistical analysis of flood hydrology and bankfull discharge for
the Daly River catchment, Northern Territory, Australia: CSIRO Water for a Healthy
Country National Research Flagship (09/2009), 59 p.
Rustomji, P., 2010, A statistical analysis of flood hydrology and bankfull discharge for
the Mitchell River catchment, Queensland, Australia: CSIRO Water for a Healthy
Country National Research Flagship (01/2010), 108 p.
Rustomji, P., Bennett, N., and Chiew, F., 2009, Flood variability east of Australias Great
Dividing Range: Journal of Hydrology, v. 374, no. 34, pp. 169-208.
Sawitzki, G., 2009, Computational statisticsAn introduction to R: Boca Raton, Florida,
Chapman and Hall/CRC, ISBN 9781420086782, 251 p.
Sen, P.K., 1964, On some properties of the rank-weighted means: Journal Indian Society
of Agricultural Statistics: v. 16, pp. 5161.
Serfling, R.J., 1980, Approximation theorems of mathematical statistics: New York, John
Wiley, ISBN 0471219274, 371 p.
Serfling, R.J., and Xiao, P., 2007, A contribution to multivariate L-moments
L-comoment matrices: Journal of Multivariate Analysis, v. 98, pp. 17651781.
Schaefer, M.G., 1990, Regional analysis of precipitation annual maxima in Washington
State: Water Resources Research, v. 26, no. 1, pp. 119131.
Short, T., 2004, R reference card: dated November 7, 2004, Granted to the public
domain, see http://www.Rpad.org for the source and latest version, includes
material from R for Beginners by Emmanuel Paradis (with permission), http:
//cran.r-project.org/doc/contrib/Short-refcard.pdf
413
Sijbers, J., den Dekker, A.J., Scheunders, P., Van Dyck, D., 1998, Maximum likelihood
estimation of Rician distribution parameters: IEEE Transactions on Medical Imaging,
v. 17, no. 3, pp. 357361.
Sillitto, G., 1951, Interrelations between certain linear systematic statistics of samples
from any continuous population: Biometrika, v. 38, no. 34, pp. 377382.
Singh, V.P., and Deng, Z.Q., 2003, Entropy-based parameter estimation for kappa distribution: Journal of Hydrologic Engineering, v. 8, no. 2, pp. 8192.
Spatz, C., 1996, Basic statisticsTales of distributions: Pacific Grove, California,
Brooks/Cole Publishing Company, ISBN 0534264247, 488 p.
Spector, P., 2008, Data manipulation with R: New York, Springer, ISBN 9780389
747309, 152 p.
Stedinger, J.R., Vogel, R.M., and Foufoula-Georgiou, E., 1993, Frequency analysis of
extreme events, in Handbook of Hydrology, chapter 18, editor-in-chief D.A. Maidment: New York, McGraw-Hill, ISBN 0070397325.
Su, S., 2010, GLDEXFitting single and mixture generalized lambda distributions (RS
and FMKL) using various methods: R package version 1.0.4.1, dated January 20, 2010,
initial package release October 11, 2007, http://www.cran.r-project.org/
package=GLDEX.
Thomas, R., de la Torre, L., Chang, X., and Mehrotra, S., 2010, Validation and characterization of DNA microarray gene expression data distribution and associated
moments: BMC Bioinformatics, v. 11, no. 576, 14 p.
Thompson, E.M., Baise, L.G., and Vogel, R.M., 2007, A global index earthquake
approach to probabilistic assessment of extremes: Journal of Geophysical Research,
v. 112, B06314, 12 p.
Ugarte, M.D., Militino, A.F., and Arnhold, A.T., 2008, Probability and statistics with R:
Boca Raton, Florida, Chapman and Hall/CRC, ISBN 9781584888918, 700 p.
Ulrych, T.J., Velis, D.R., Woodbury, A.D., and Sacchi, M.D., 2000, L-moments and
C-moments: Stochastic Environmental Research and Risk Assessment, v. 14,
pp. 5068.
Unnikrishnan, N., and Vineshkumar, B., 2010, L-moments of residual life: Journal of
Statistical Planning and Inference, v. 140, no. 9, pp. 26182631.
414
Wallis, J.R., Matalas, N.C., and Slack, J.R., 1974, Just a moment!: Water Resources
Research, v. 10, pp. 211219.
Wallis, J.R., 1988, Catastrophes, computing and containmentLiving in our restless
habitat: Speculation in Science and Technology, v. 11, no. 4, pp. 295315.
Wang, Q.J., 1990a, Estimation of the GEV [Generalized Extreme Value] distribution
from censored samples by method of partial probability weighted moments: Journal
of Hydrology, v. 120, pp. 103114.
Wang, Q.J., 1990b, Unbiased estimation of probability weighted moments and partial
probability weighted moments from systematic and historical flood information and
their application to estimating the GEV [Generalized Extreme Value] distribution:
Journal of Hydrology, v. 120, pp. 115124.
Wang, Q.J., 1996a, Using partial probability weighted moments to fit the extreme value
distributions to censored samples: Water Resources Research, v. 32, no. 6, pp. 1767
1771.
Wang, Q.J., 1996b, Direct sample estimators of L-moments: Water Resources Research,
v. 32, no. 12., pp. 36173619.
Wang, D., Hutson, A.D., Miecznikowski, J.C., 2010, L-moment estimation for parametric
survival models given censored data: Statistical Methodology, v. 7, no. 6,
pp. 655667.
Weiss, L.L., 1964, Ratio of true to fixed-interval maximum rainfall: American Society of
Civil Engineers, Journal of the Hydraulics Division, v. 90, HY1, pp. 7782.
Whalen, T.M., Savage, G.T., and Jeong, G.D., 2002, The method of self-determined probability weighted moments revisited: Journal of Hydrology, v. 268, pp. 177191.
Yatracos, Y.G., 1998, Variance and clustering: Proceedings American Mathematical
Society, v. 126, no. 4, pp. 11771179.
Zafirakou-Koulouris, A., Vogel, R.M., Craig, S.M., and Habermeier, J., 1998, L-moment
diagrams for censored observations: Water Resources Research, v. 34, no. 5, pp. 1241
1249.
416
Index
For this topical index, page numbers on which a term is defined or the primary discussion
exists are typeset in bold.
Symbols
LATEX iii, 6
bootstrap 152
box plots 18, 1921, 24, 51, 58, 316318, 325,
326
TEX iii
417
418
419
gamma function
complete 64, 65, 85, 109, 180, 218, 243, 244,
244, 245, 262
relation to factorial 64
incomplete 243, 243
Generalized Extreme Value distribution 101,
104, 107, 116, 125, 129, 159, 160, 165, 167,
168, 170, 172, 187, 217, 217, 218228, 230,
235, 248251, 256258, 260, 261, 280, 300,
302, 306308, 323, 349, 370
Generalized Lambda distribution xxv, 10, 116,
139, 165, 167, 168, 174, 189, 238, 260, 261,
267, 267, 268276, 278281, 291, 295, 296,
300, 309, 327, 331, 333336
censored 267
trimmed see Trimmed Generalized Lambda
distribution
Generalized Logistic distribution 104, 114,
116, 160, 165, 167169, 221, 221, 222228,
253, 256, 261, 262, 266, 267, 272, 300,
302305, 307309, 313, 320, 321, 327
Generalized Normal distribution 116, 159,
160, 163, 165, 167, 168, 227, 227, 228236,
256, 257, 261, 264, 280, 296, 307, 308,
354357
Generalized Pareto distribution 10, 24, 39, 41,
69, 104, 116, 142, 160, 165, 167, 168, 213,
235, 235, 236, 238240, 257, 261, 270, 274,
281, 285290, 292, 293, 297, 300, 302, 308,
342, 343, 359361, 366, 372, 401
blipped example 360
lower bound 359
geology
earthquake 16, 24, 42, 48
geophysics 42
Permian
Clear Fork formation 54
volcanology 42
Geometric distribution 43, 44
geophysics 16
Gini mean difference 61, 71, 73, 7477, 118
object of 74
GNU iii, 3
Google 205
420
as concomitants 386
censoring
a vision 400
feature of asymmetry 387
matrices 389391, 396
method of 397
random variable co-movement
symmetric 391
ratios 387
L-cokurtosis 387
L-correlation 387, 389, 393
L-coskew 387, 390, 391, 393, 395, 396
L-CV 120, 124
relative L-variation 148
sample 126
L-estimators 70, 70, 71, 73, 75
type I 70
type II 70
L-kurtosis 120, 157, 213, 307, 327
hyper 272, 326
in L-moment ratio diagram 213, 301, 306,
307, 309, 312
more bounded than kurtosis 121
sample 126
L-moment ratio diagrams 13, 184, 212, 213,
215, 298, 299, 299, 300, 302305, 308, 310,
311, 313, 314, 321, 322, 327, 328, 336, 338,
349, 372, 376, 400
L-moment ratios 120, 121, 123, 126, 128, 140,
141, 200, 298, 372
boundedness 157
bounds of 120
sample 126, 145
theoretical 120
L-moments ii, iii, xxiixxv, 4, 8, 9, 9, 1014,
16, 23, 46, 55, 58, 6163, 65, 71, 7479, 81,
8688, 92, 97100, 103, 105, 108, 110115,
117125, 127143, 145, 146, 148, 149, 152,
156159, 161, 164167, 169171, 174181,
183, 184, 186, 187, 191194, 196, 197, 200,
201, 206, 214218, 220, 223231, 233, 235
238, 241, 243245, 249, 251263, 267272,
278, 280284, 286, 291, 293296, 298300,
303, 306, 308, 311, 313316, 318, 320, 321,
323326, 333, 335, 337, 338, 340342,
346349, 351, 353357, 359, 362, 367, 368,
421
lmomco list
L-moment 127, 128, 142, 143, 164, 224, 238
parameter 69, 102, 123, 142, 143, 148, 163,
163, 164, 166, 170, 177, 193, 224, 248, 279,
363
probability-weighted moment 108, 108,
111, 142, 164
product moment 90
TL-moment 143
log-logistic distribution see Generalized
Logistic distribution, 221
log-Normal distribution 2, 5759, 97, 150, 151,
153156, 174, 181, 227229, 232235, 257,
264, 296, 357
log-Normal3 distribution 116, 159, 160, 165,
167, 168, 229, 229, 230, 235, 236, 257, 291
log-Pearson Type III distribution 97, 245, 375,
381386, 398
logarithmic transformation 57, 97, 98, 156,
157, 181, 191, 228, 229, 232, 233, 363,
374376, 381, 385, 386
M
MacOSX iii, 3
Marcum Q function 205, 205, 207, 208, 215
Matlab 11
maximum 9, 21, 22, 44, 45, 47, 49, 58, 61, 62,
6668, 77, 115, 318, 352
maximum likelihood 179, 262
method of 2, 222, 262, 266, 349, 399
mean 9, 14, 20, 22, 27, 33, 41, 43, 44, 48, 51, 60,
65, 67, 68, 71, 79, 82, 83, 83, 85, 87, 88, 92,
98, 101, 102, 129, 134, 135, 137, 144, 157,
166, 171, 173, 202, 204, 206, 210, 211, 213,
215, 216, 221, 229, 243, 256, 259, 278, 304,
308, 349, 353, 356, 374, 376, 385, 389
back flipped 356
interpretation of 65
left-tail censored 354
sample 84
Sen see Sen weighted mean
trimmed 73, 83, 141
weighted 315, 316, 319, 320, 322, 336
mean square error 72, 73, 80, 83
measures of association 387, 390
422
423
424
425
426
Komogorov-Smirnov 400
outside scope of text 13, 299
Shapiro-Wilk test for normality 13
high outlier 150, 151, 153, 242, 375
inconsistency 155, 156
low outlier 97, 228, 242, 375
moments 47, 78, 79, 99
central product 83
outlier 16, 22, 80, 113, 241, 242
performance 80, 80
population 45, 46, 46, 49
precision 80
relative efficiency 76, 80, 80, 81, 235
robustness 8, 9, 71, 74, 80, 114, 139, 150
sample 46
simulation 12, 16, 45, 45, 46, 49, 65, 68, 73,
76, 80, 82, 89, 9194, 104, 110, 137, 144, 145,
147, 149, 153, 159, 175, 209, 215, 241, 257,
261, 279, 280, 303, 304, 311313, 337, 349,
361, 363, 364, 369, 373376, 378, 381, 384,
392, 395
bootstrap 130, 152, 152
pseudo-random numbers 45
unbias 9, 80, 80, 82, 8486, 89, 101, 106,
114116, 119, 124, 125, 145, 146, 351, 361,
377, 378, 383, 386, 387
streamflow 24, 48, 245, 336, 400
annual maximum 336
annual peak 5658, 60, 97, 219, 222, 231,
256, 257, 263265, 270272, 296, 324, 326,
328, 330332, 335, 362, 368, 371, 375
annual volume 358
daily mean 245, 257
flood 16, 42, 43, 97, 99, 113, 186, 187, 235,
315, 336, 375, 400
flood control levees 2
flood plains 56, 324
flood risk 335
flood volume 376
flow-duration curve 245, 257
hydrograph 179, 180, 201, 203
unit 179
peak of hydrograph 180, 201
river-flow modeling 315
time of peak 201
water quality 48
427
U
U.S. Geological Survey xxiii, xxiv, 56, 219, 222,
231, 245, 263265, 270, 272, 324, 325, 335,
362, 368, 371
Uniform distribution 45, 68, 136, 136, 137, 138,
197, 198, 238, 391
United States 188, 324, 326, 328, 330, 332
UNIX 3
variance 67, 80, 83, 83, 84, 85, 88, 98, 148, 206
sample 84, 85, 86, 88, 367
violin plots 318, 318, 319
W
Wakeby distribution 99, 114, 116, 160, 165,
167, 168, 260, 280, 280, 281, 283290, 292,
295297, 300, 309, 327332, 334336, 362,
364371, 373, 400
Weibull distribution 2, 25, 26, 35, 55, 116, 160,
165, 167, 168, 170172, 177, 191, 195, 196,
247, 247, 248251, 257, 258, 349, 401
Weibull plotting positions see plotting
positions, Weibull
wind
speed
annual maximum 218, 256, 370
hurricane maximum 370
offshore 400
risk 219
storm surge 42
wave height 186
Windows 3
428
Index of R Functions
This index lists in alphabetical order the R functions used in the text. The functions are
cataloged by heredity, whether built-in to R, listed by package, or other. The page for which
functions are discussed within paragraphs are typeset in the normal font. The beginning
page the code example for which functions are used only within the example and not
discussed in the text are typeset in an italic font.
Built-in to R
IQR() 46, 58
429
gsub() 220
help() 5, 15, 19, 91, 91, 387
hist() 19
if() 32, 39, 81, 152, 169, 207, 208, 266, 284,
286, 291, 359, 392, 393
ifelse() 210, 266, 371, 392
integrate() 66, 102, 125, 125, 126, 185,
207, 208
is.na() 393
is.null() 38
ks.test() 13
layout() 19, 131, 201, 208, 224, 230, 231,
235, 248, 286, 292, 294, 329, 331
legend() 35, 149, 193, 210, 226, 227, 246,
263, 265, 279, 284, 327, 350, 360, 363, 364,
366
length() 17, 71, 73, 86, 107, 132, 207, 208,
210, 292, 350, 360, 371, 392
lgamma() 64, 66, 85
library() 15, 15, 198, 272, 273, 318, 353,
357
lines() 35, 39, 49, 55, 57, 146, 149, 171,
171, 193, 195, 202, 208, 210, 212, 226, 227,
231, 246, 249, 263, 265, 271, 274, 279, 284,
286, 308, 322, 329, 334, 342, 350, 355, 360,
363, 364, 366, 371
list() 81, 107, 124, 198, 317, 318, 325
log() 188, 198, 371
log10() 57, 151, 152, 231, 246, 249, 263,
265, 271, 334, 363
ls() 18
matrix() 19, 131, 201, 208, 224, 231, 235,
286, 292, 294, 329, 331
max() 35, 45, 49, 68, 68, 69, 202, 266, 291,
318, 369
mean() 5, 20, 49, 57, 66, 68, 69, 71, 81, 81,
82, 86, 87, 89, 98, 110, 129, 135, 144, 146,
149, 155, 175, 209, 212, 234, 242, 265, 311,
312, 376, 389
median() 72, 73, 98
min() 35, 45, 68, 202, 266, 291, 318, 369,
392
mtext() 59, 249, 286, 292, 329
names() 18, 32, 46, 53, 138, 318
next() 284, 291, 292, 393
optim() 188, 197, 333
430
options() 284
par() 318
paste() 286
pbinom() 106
pdf() 6, 6, 91, 196, 365
pdffile() 220
pgamma() 31, 170
pgeom() 44
plot() 25, 35, 36, 39, 39, 49, 54, 56, 57, 58,
91, 94, 131, 135, 146, 149, 151, 152, 171,
181, 184, 188, 190, 193, 195, 202, 208, 210,
220222, 224, 226, 227, 231, 245, 246, 263,
264, 265, 271, 274, 279, 284, 286, 292, 304,
322, 329, 334, 342, 350, 355, 360, 362, 363,
369, 371, 388, 393, 395
pnorm() 27, 151, 162, 263
points() 54, 92, 131, 135, 188, 190, 210,
212, 220, 250, 304, 311, 321, 322, 327, 342,
350, 369, 372, 395
pp() 362
print() 6, 31, 46, 47, 69, 71, 72, 75, 76,
106, 127, 142, 143, 146, 148, 169, 177, 219,
234, 241, 270, 273, 323, 326, 331, 353355,
357, 373
pweibull() 248
q() 5
qbeta() 69
qexp() 30, 3436, 65, 68, 68, 69, 178
qgamma() 31, 182
qnorm() 32, 34, 45, 46, 49, 54, 57, 58, 151,
162, 164, 210, 211, 220, 231, 249, 263, 265,
271, 284, 328, 329, 334, 360, 363, 364, 366
quantile() 5255, 353, 357
qweibull() 35
range() 47
rbind() 34
rcauchy() 144, 279
read.csv() 17, 53
read.cvs() 17
read.cvs2() 17
read.delim() 17
read.delim2() 17
read.table() 17, 219
rep() 107, 359, 359
replicate() 66, 68, 73, 76, 82, 129, 145,
155
uniroot() 392
var() 76, 76
vector() 89, 90, 110, 131, 132, 146, 149,
return() 32, 38, 39, 69, 73, 76, 81, 86, 107,
125, 126, 188, 207, 208, 286, 320, 359, 371,
392, 393
rexp() 65, 68, 135, 143
rgamma() 91, 138, 149
rgb() 91, 152, 284, 304, 322, 327, 364, 365,
366, 388
rm() 17
rnorm() 45, 49, 53, 72, 76, 81, 89, 90, 106,
107, 127, 151, 154, 155, 174, 175, 273, 357,
388, 391
round() 34, 34, 54, 57, 66, 82, 87, 102, 110,
129, 132, 135, 144, 175, 178, 181, 182, 209,
219, 226, 234, 242, 266, 354, 355, 389, 390
rug() 388
runif() 45, 46, 68, 68, 69, 137, 209, 376,
393
rweibull() 55, 196
sample() 129, 130, 152, 153
sapply() 86, 110, 125, 126, 129, 164, 178,
317, 318, 359
save() 18
sd() 44, 49, 57, 58, 81, 85, 87, 89, 98, 149,
175, 234, 265, 373
segments() 304, 304, 311
seq() 25, 31, 34, 35, 36, 49, 89, 90, 107, 131,
144, 146, 149, 152, 175, 202, 208, 234, 242,
249, 274, 279, 284, 286, 303, 311, 322, 350,
355, 369, 376
set.seed() 66, 72, 273, 279
shapiro.test() 13
sin() 207
sort() 53, 55, 57, 66, 73, 86, 107, 132, 135,
151, 170, 171, 193, 195, 220, 231, 246, 248,
249, 263, 270, 274, 316, 329, 334, 342, 350,
359, 371
sqrt() 76, 81, 82, 86, 89, 102, 209, 284,
286, 294, 373
stop() 207
str() 74, 108, 108, 128, 163, 166, 181, 181,
185, 224, 232, 238, 320, 326, 362
sum() 73, 86, 125, 126, 132, 207, 208, 234
summary() 44, 46, 58, 81, 89, 89, 90, 138,
145, 155, 234, 373
system.time() 69
try() 392
Barnett() 76
Ftrans() 38, 39
HF() 38
MOcop() 392
MarcumQ1() 208
NADA:Cen() 353, 357
NADA:cenfit() 353, 357
beanplot:beanplot() 318
derCOPinv() 392, 393
func() 392
grv() 371
lambda.by.cdf() 125, 125, 126
lattice:contourplot() 198
maxOstat.system() 129
myWAK() 286, 287
myquagum() 188
ostat.sd() 86
qua.by.recursion() 32, 33
qua.ostat() 69
sam.biasvar() 73, 81, 82, 82, 83
simulateCopula() 392, 393, 395
test.pwm.pp() 107, 108
trim.mean() 72, 73
vioplot:vioplot() 318
Package: lmomco
431
LaguerreHalf() 209
Lcomoment.Wk() 131, 132, 132
Lcomoment.coefficients() 390,
391, 391
Lcomoment.correlation() 389
Lcomoment.matrix() 388, 389391
T2prob() 43, 323
TLmom() 115
TLmoms() 72, 115, 143, 157, 279
432
433
prettydist() 291
prob2T() 43, 151, 220
pwm() 101, 110, 342
pwm.gev() 101, 107, 108, 111, 125
pwm.pp() 101
pwm.ub() 101, 106, 111
pwm2lmom() 108, 110, 111, 115, 123, 125,
341, 342, 346, 346, 347
Lmoments() 272
Lmoments_calc() 272
fun.RMFMKL.lm() 273
fun.RPRS.lm() 273, 273, 274
fun.data.fit.lm() 273
t1lmoments() 272
qua.ostat() 69, 70
qua2ci() 369
quacau() 165, 184, 279
quaexp() 165, 169, 178, 178, 179
quagam() 165, 181, 182, 202
quagev() 165, 220, 226, 249
quagld() 165, 270, 271, 279
quaglo() 165, 169, 224, 226, 226
quagno() 165
quagpa() 165, 360
quagum() 165, 167, 169, 188, 190, 193
quakap() 165, 263, 271
quakur() 165
qualn3() 165
quanor() 162, 165, 231
quape3() 94, 165
quaray() 165, 202
quarevgum() 165, 193
quarice() 165, 209, 210, 210
quawak() 165, 284, 286, 363, 364, 366
quawei() 55, 165, 249
rlmomco() 94, 110, 130, 138, 146, 162,
Package: Lmoments
Lmoments() 116, 127
t1lmoments() 143
t1moments() 116
Package: lmom
theoLmoms.max.ostat() 115
theoTLmoms() 115, 142, 166, 185, 186,
241
Lmomcov_calc() 272
434
cdfexp()
cdfgam()
cdfgev()
cdfglo()
cdfgno()
cdfgpa()
cdfgum()
cdfkap()
cdfln3()
cdfnor()
cdfpe3()
cdfwak()
cdfwei()
lmrexp()
lmrgam()
lmrgev()
lmrglo()
lmrgno()
lmrgpa()
lmrgum()
lmrkap()
lmrln3()
lmrnor()
lmrpe3()
lmrwak()
lmrwei()
pelexp()
pelgam()
pelgev()
pelglo()
pelgno()
pelgpa()
pelgum()
160
160
159, 160
160
160
160
160
160
160
160
160
160
160
119, 160
119, 160
119, 160
119, 160
119, 160
119, 160
119, 160
119, 160
119, 160
119, 160
119, 160
119, 160
119, 160
160
160
160
160
160
160
160
pelkap()
pelln3()
pelnor()
pelpe3()
pelwak()
pelwei()
quaexp()
quagam()
quagev()
quaglo()
quagno()
quagpa()
quagum()
quakap()
qualn3()
quanor()
quape3()
quawak()
quawei()
samlmu()
160
160
160
160
160
160
160
160
160
160
435
160
160
160
160
160
160
160
160
160
119, 127, 157