check.pdf: Check and Potentially Graph Probability Density Functions

Description Usage Arguments Value Author(s) Examples

Description

This convenience function checks that a given probability density function (pdf) from lmomco appears to numerically be valid. By definition a pdf function must integrate to unity. This function permits some flexibility in the limits of integration and provides a high-level interface from graphical display of the pdf.

Usage

1
2
3
check.pdf(pdf, para, lowerF=0.001, upperF=0.999,
               eps=0.02, verbose=FALSE, plot=FALSE, plotlowerF=0.001,
               plotupperF=0.999, ...)

Arguments

pdf

A probability density function from lmomco.

lowerF

The lower bounds of nonexceedance probability for the numerical integration.

upperF

The upper bounds of nonexceedance probability for the numerical integration.

para

The parameters of the distribution.

eps

An error term expressing allowable error (deviation) of the numerical integration from unity. (If that is the objective of the call to the check.pdf function.)

verbose

Is verbose output desired?

plot

Should a plot (polygon) of the pdf integration be produce?

plotlowerF

Alternative lower limit for the generation of the curve depicting the pdf function.

plotupperF

Alternative upper limit for the generation of the curve depicting the pdf function.

...

Additional arguments that are passed onto the R function integration function.

Value

An R list structure is returned

isunity

Given the eps is F close enough.

F

The numerical integration of pdf from lowerF to upperF.

Author(s)

W.H. Asquith

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
lmrg <- vec2lmom(c( 100, 40, 0.1)) # Arbitrary L-moments
lmrw <- vec2lmom(c(-100, 40,-0.1)) # Reversed Arbitrary L-moments
gev  <- pargev(lmrg) # parameters of Generalized Extreme Value distribution
wei  <- parwei(lmrw) # parameters of Weibull distribution

# The Weibull is a reversed GEV and plots in the following examples show this.
# Two examples that should integrate to "unity" given default parameters.
layout(matrix(c(1,2), 2, 2, byrow = TRUE), respect = TRUE)
check.pdf(pdfgev,gev,plot=TRUE)
check.pdf(pdfwei,wei,plot=TRUE)

lmomco documentation built on Nov. 17, 2017, 7:25 a.m.