PPlinesG: Add return level curves based on a set of (estimated)...

View source: R/lmomFits.R

PPlinesGR Documentation

Add return level curves based on a set of (estimated) parameters.

Description

This can be useful in combination with PPmatG. The x-axis is shown using the Gumbel variate -log(-log(f)), with f the non exceedance probability. If a distribution is given to fit.lines, it adds an estimated return level curve based on L-moments estimate.

Usage

PPlinesG(
  mat = NULL,
  pars = NULL,
  cols = NULL,
  fit.lines = "gev",
  ff = seq(0.005, 0.995, by = 0.0025),
  ...
)

Arguments

mat

data matrix, each column will be analysed seperately.

pars

matrix of parameter estimates. Each column should correspond to a parameter, each line to an observation (station).

cols

colour in which the lines points of each row should be displayed

fit.lines

a character string indicating the distribution to be used to draw the fitted line. Current options are "gev" (default), "glo", "gpa", "gamma"

ff

the non-exceedance probabilities for which the lines are estimated It also affects the width of the x-axis. Defaul is seq(0.005,0.995,by=0.0025)

...

additional graphical parameters

Value

A set of estimated return curves added to the current plot

Examples

x <- matrix(c(rgev(20, 10, 3,   -0.2), 
              rgev(20, 15, 4.5, -0.2), 
              rgev(20, 40, 6.5, -0.2)), byrow = FALSE, ncol=3)
library(lmom)
PPmatG(x, cols = c(4,5,2), fit.lines = "gev")
pars <- t(apply(x,2,function(x) pelglo(samlmu(x))))
PPlinesG(pars = pars, cols= c(4,5,2), lty=2)
PPlinesG(mat  = x, cols= c(4,5,2), lty=3, fit.lines = "gamma")

ilapros/ilaprosUtils documentation built on April 6, 2023, 4:44 a.m.