Log-Pearson Flood Flow Frequency using USGS 17B

This function will calculate flood flow frequencies using published guidelines by the USGS.
12.1K Downloads
Updated 2 Dec 2009

View License

This function estimates Flood Frequencies using U.S. Water Resources Council publication Flood Flow Frequencies, Bulletin #17B (1976, revised 1981,1982). This method uses a Log Pearson Type-3 distribution for estimating quantiles. See url: http://water.usgs.gov/osw/bulletin17b/bulletin_17B.html for further documentation.

Modifications:
January 28, 2009 - Tweaked the figure created by cleaning up the legend, reference lines can be turned on/off and are hard coded to display: Upper/Lower 100yr CIs, 100yr, 25yr, 10yr, 5yr, and 2yr. Also changed a few of the default tick placements used to make the grid.

March 13, 2009 - Removed the lower confidence reference line on the figure. Also now will project the last water year in the data set to the final frequency curve and plot a drop down reference line annotating what the interpreted return period would be.

April 20, 2009 - Modified pplot function to create a second type of graph that displays the legend outside the figure and also summarizes in a textbox flow frequencies. Made the comments more Report friendly.

December 2, 2009 - updated code to use matlab interp1 function instead of the lagrange.m function. People were downloading the wrong lagrange.m function.

NaN need to be removed in the dataset. If any years have missing data, it will still assume to include that year as part of the sample size-- as stipulated in 17B guidelines. An exmaple MAT file is provided for the user to test. Further down in these comments is some sample script to pre-process the examples.mat file provided.

There are only a couple of loops in this function and subfunctions, most of this is vectorized for speed.

A nice enhancement to this function is a plot of the analyses. It is plotted in probability space-- SKEWED probability space! Because data may not be normally distributed, plotting in skewed space maintains a straight line for the final frequency curve. Again, no need of any
special toolboxes to create this figure. All self contained in this function.

Outputs of this function include:
estimates of a final frequency (based on a weighted skew),
confidence intervals (95%) for the final frequency,
expected frequency curve based on an adjusted conditional
probability,
observed data with computed plotting positions using Gringorten and
Weibull techniques (no toolbox required),
various Skews,
mean of log10(Q),
standard deviation of log10(Q),
and the coup de grâce,
a probability plot that does not require a toolbox to create, but
also plots the probability space using the computed weighted skew
and not just the normal probability.

*This added feature yields a straight line plot for the final
frequency curve even if the data are not normally distributed.

The one important aspect not included in this funtion is the assumed generalized skew (which is variable throughout the country), which can be obtained from Plate 1 in the bulletin. Using the USGS program PKFQWin, this generalized skew is automatically estimated with given lat/long
coordinates. For this function, the user must specify a generalized skew, if no generalized skew is provided, 0.0 is assumed.

Even though this function computes probabilities, skews, etc., no toolboxes are required. All necessary tables are provided as additional MAT files supporting this function. These tables are created from the published USGS 17B manual, and not taken from any Matlab toolboxes, so there are no conflicts or copyright violations.

Other files required to support this function are:
KNtable.mat - using normal distribution, a table of 10-percent
significance level of K values per N sample size.
ktable.mat - Appendix 3 table Pearson distributions
PNtable.mat - Table 11-1 in Appendix 11. Table of probabilities
adjusted for sample size.
pscale.mat - table used to define tick/grid intervals when creating a
probability plot of the results. Can be modified by user if other than
the default values.
examples.mat - dataset presented in the 17B publication.

Parabolic interpolation of Pearson Distribution is dependant on function: lagrange.m (written by Jeff Burkey 3/23/2007). Can be downloaded from Mathworks user community.

Syntax
[dataout skews pp XS SS hp] =
b17(datain, gg, imgfile, gaugeName, plotref)

written by
Jeff Burkey
King County- Department of Natural Resources and Parks
Seattle, WA
email: jeff.burkey@kingcounty.gov
January 6, 2009

Cite As

Jeff Burkey (2024). Log-Pearson Flood Flow Frequency using USGS 17B (https://www.mathworks.com/matlabcentral/fileexchange/22628-log-pearson-flood-flow-frequency-using-usgs-17b), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.7.0.0

Modified code to no longer need lagrange.m Thanks to Shan Zou for finally solving why people were getting the lagrange error. People were downloading the wrong lagrange.m function.

1.6.0.0

Modified pplot function to create a second type of figure by displaying the legend outside the figure, and also summarizing flow frequencies in a text box. Made the comments more Report friendly.

1.5.0.0

Added a drop down reference line for projecting the last water year data point on the final frequency curve.

1.4.0.0

Given the couple of posts seeming to get errors using the example dataset, I've included the EX1.mat file for people to use instead of having people extract out the data from the example.mat file.

1.3.0.0

Updated the Figure by cleaning up the legend, also added reference lines with values displayed, and adjusted the default xticks used for the grid (i.e. pscale.mat). More detail is in the comments of the b17.m file.

1.2.0.0

Updated Graphing to include inverse of probabilities (i.e. Return Period). Also rotated X-axis tick labels (adapted code from rotateticklabel.m written by Andy Bliss).

1.1.0.0

Corrected a type-o in the title.

1.0.0.0