pel: Generic function for 'pel...'

View source: R/pel.R

pelR Documentation

Generic function for pel...

Description

Generic function for pel...: probability distribution fitting with L-Moments

Usage

pel(
  distrib = c("exp", "gam", "gev", "glo", "gpa", "gno", "gum", "kap", "ln3", "nor",
    "pe3", "wak", "wei"),
  lmom = NULL,
  probability_distribution_attrname = "probability_distrib",
  x = NULL,
  nmom = 5,
  sort.data = TRUE,
  ratios = sort.data,
  trim = 0,
  indices = NULL,
  spi.scale = NA,
  correction = NULL,
  ...
)

pel_x(x, ...)

pel_lmom(lmom, ...)

Arguments

distrib

character string indicating the probability distribution to fit

lmom, ...

L-moments and further parameters for pel...

probability_distribution_attrname

attribute name for probability distribution

x

vector containg sample. It is utiled to calculete L-moments in case lmom is set equal to NULL.

nmom, sort.data, ratios, trim

arguments for samlmu (nmom=5 by default). Thay are utilized if argument lmom is NULL.

indices

optional index or tag character vector of the same length of x used as INDEX for tapply. It is used to fit different probability distribution in one sample time series (e. g. months in an year).

spi.scale

integer value or NA. If it is greater than 1, x is filtered with the sum of a generic element of x and the previous spi.scale-1 ones (e.g. SPI-3,SPI-6, etc. ). Default is NA (no filtering) which is equivalent to spi.scale=1.

correction

numeric value correction for the 3rd (and higher) L-moment estimation. Default is NULL , generally it is not used. It is used and suggested to be 10^(-10) in case of a massive function use with lmom=NULL (e.g. raster cell or zonal statistics).

Details

pel_x and pel_lmom are wrapper functions of pel whose first argument is x or lmom respectively.

Value

A numeric vector containing the parameters of the selected probability distribution. It is a list in case of selection of several probability distributions (i.e. length(distrib)>1).

See Also

pel...,pelexp,pelgam,pelgev,pelglo,pelgpa,

pelgno,pelgum,pelkap,pelln3,pelnor,

pelpe3,pelwak,pelwei,

cdf,qua

Examples


 # Sample L-moments of Ozone from the airquality data
 data(airquality)
 lmom <- samlmu(airquality$Ozone,nmom=6)
 distrib <- "gev"    
 # Fit a GEV distribution
 out_gev <- pel(distrib=distrib,lmom=lmom)

 distrib <- c("exp","gam","gev","glo","gpa","gno","gum","kap","ln3",
 "nor","pe3","wak","wei")

 out_list <- pel(distrib=distrib,lmom=lmom)



lmomPi documentation built on Aug. 15, 2023, 5:07 p.m.

Related to pel in lmomPi...