dGEVxGEV {flood}R Documentation

Two-component generalized extreme value distribution (GEV)

Description

Density, distribution function, quantile function and random generation for a two-component GEV distribution (product of two GEVs).

Usage

dGEVxGEV(x, param1, param2)

pGEVxGEV(q, param1, param2)

qGEVxGEV(p, param1, param2)

rGEVxGEV(n, param1, param2)

Arguments

x

vector of quantiles.

param1

three-dimensional vector (loc, scale, shape)' of a GEV from season 1.

param2

three-dimensional vector (loc, scale, shape)' of a GEV from season 2.

q

vector of quantiles.

p

vector of probabilities.

n

number of observations.

Details

These functions use the parametrization of the gev-functions from the package 'evd'. The distribution F of a two-component GEV is: F=F_1 \cdot F_2, where F_1 and F_2 are two distribution functions of a GEV.

Examples

# density and distribution function of a two-component GEV:
par(mfrow=c(3,1))
curve(dGEVxGEV(x, c(2,1,0.2), c(3,2,0.4)), from=0, to=20, ylab="Density", n=1000)
curve(pGEVxGEV(x, c(2,1,0.2), c(3,2,0.4)), from=0, to=20, ylab="Probability", n=1000)

# quantiles of a two-component GEV:
qGEVxGEV(p=c(0.9, 0.99), c(2,1,0.2), c(3,2,0.4))

# random numbers of a two-component GEV:
set.seed(23764)
rn <- rGEVxGEV(1000, c(2,1,0.1), c(3,2,0))
hist(rn, breaks=40, freq=FALSE, main="")
curve(dGEVxGEV(x, c(2,1,0.1), c(3,2,0)), from=0, to=20,
ylab="density", n=1000, col="red", add=TRUE)

[Package flood version 0.1.1 Index]