regfit: Fit a regional frequency distribution

View source: R/lmomRFA.r

regfitR Documentation

Fit a regional frequency distribution

Description

Fits a frequency distribution to a vector of regional average L-moments. Returns an object of class "rfd", which contains the specification of the regional frequency distribution: the quantile function, parameters of the regional growth curve, and the index-flood values (site-specific scale factors) for each site.

Usage

regfit(regdata, dist)

Arguments

regdata

Object of class regdata, containing summary statistics of the data for the sites in a region.

dist

Character string specifying the distribution to be fitted. See “Details” below.

Details

The function computes regional average L-moments (by calling regavlmom) and fits a probability distribution to the regional average L-moments. This distribution has mean 1, i.e., the index flood is the mean of the distribution.

For distribution dist there should exist a function to estimate the parameters of the distribution given a set of L-moments. The function should have a name that is the character string "pel" followed by the character string dist. It should accept a single argument, a vector containing L-moments \ell_1, \ell_2, t_3, t_4, etc., and return a vector of distribution parameters.

For distribution dist there should also exist a quantile function, which should have a name that is the character string "qua" followed by the character string dist. It should accept two arguments: a vector of probabilities and a vector containing the parameters of the distribution.

The search path used to find the "pel" and "qua" functions is the same as for arguments supplied to regfit, i.e. the enclosing frames of the function, followed by the search path specified by search().

The estimation routines and quantile functions in package lmom have the form described here. For example, to use a generalized extreme value distribution set dist to be the string "gev"; then the fitting function pelgev and the quantile function quagev will be used (unless these functions have been masked by another object on the search path).

Value

An object of class "rfd", containing the specification of the regional frequency distribution: It is a list with the following elements:

dist

The character string dist.

para

Vector containing the parameters of the fitted regional distribution.

qfunc

The quantile function of distribution dist. It is a function that takes a single argument, a vector of probabilities, and returns a vector of quantiles.

rmom

The regional average L-moments.

index

Index flood values at each site. This is a named vector whose values are the index flood values at each site, from regdata[[3]], and whose names are the site names, from regdata[[1]].

Author(s)

J. R. M. Hosking jrmhosking@gmail.com

Examples

data(Cascades)                  # An object of class "regdata"
rfit <- regfit(Cascades, "gno") # Fit a generalized normal distribution
rfit                            # Print details of the fitted distribution
                                #   (components 'dist' and 'para')
rfit$index                      # Index flood values

evplot(rfit)                    # Plot the regional growth curve
evplot(qfunc=rfit$qfunc)        # The same, but with more typing
evplot(qfunc=regqfunc(rfit))    # The same, with still more typing

lmomRFA documentation built on Aug. 29, 2023, 9:07 a.m.