EVPlotAdd: Add lines and/or points to an extreme value plot

View source: R/All.R

EVPlotAddR Documentation

Add lines and/or points to an extreme value plot

Description

Functionality to add extra lines or points to an extreme value plot (derived from the EVPlot function).

Usage

EVPlotAdd(
  Pars,
  dist = "GenLog",
  Name = "Adjusted",
  MED = NULL,
  xyleg = NULL,
  col = "red",
  lty = 1,
  pts = NULL,
  ptSym = NULL
)

Arguments

Pars

a numeric vector of length two. The first is the Lcv (linear coefficient of variation) and the second is the Lskew (linear skewness).

dist

distribution name with a choice of "GenLog", "GEV", "GenPareto", and "Gumbel"

Name

character string. User chosen name for points or line added (for the legend)

MED

The two year return level. Necessary In the case where the EV plot is not scaled

xyleg

a numeric vector of length two. They are the x and y position of the symbol and text to be added to the legend.

col

The colour of the points of line that have been added

lty

An integer. The type of line added

pts

A numeric vector. An annual maximum sample, for example. This is for points to be added

ptSym

An integer. The symbol of the points to be added

Details

A line can be added using the Lcv and Lskew based on one of four distributions (Generalised extreme value, Generalised logistic, Gumbel, Generalised Pareto). Points can be added as a numeric vector. If a single point is required, the base points() function can be used and the x axis will need to be log(RP-1).

Value

Additional, user specified line or points to an extreme value plot derived from the EVPlot function.

Author(s)

Anthony Hammond

Examples

#Get an AMAX sample and plot the growth curve with the GEV distribution
AM.203018 <- GetAM(203018)
EVPlot(AM.203018$Flow, dist = "GEV")
#Now add a line (dotted & red) for the generalised logistic distribution
#first get the Lcv and Lskew using the Lmoms function
pars <- as.numeric(Lmoms(AM.203018[,2])[c(5,6)])
EVPlotAdd(Pars = pars, dist = "GenLog", Name = "GenLog", xyleg = c(-5.2,2.65), lty = 3)
#Now add a line for the gumbel distribution which is darkgreen and dashed.
EVPlotAdd(Pars = pars[1], dist = "Gumbel", Name = "Gumbel",
xyleg = c(-5.19,2.5), lty = 3, col = "darkgreen")
#now plot afresh and get another AMAX and add the points
EVPlot(AM.203018$Flow, dist = "GEV")
AM.27090 <- GetAM(27090)
EVPlotAdd(xyleg = c(-4.9,2.65), pts = AM.27090[,2], Name = "27090")

UKFE documentation built on Nov. 6, 2023, 1:07 a.m.

Related to EVPlotAdd in UKFE...