twocompGEV: Two-component generalized extreme value distribution (GEV)

Description Usage Arguments Details Examples

Description

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

Usage

1
2
3
4
5
6
7
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 * F_2, where F_1 and F_2 are two distribution functions of a GEV.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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)

Example output

[1] 10.6251 29.5917

flood documentation built on May 2, 2019, 4:04 p.m.

Related to twocompGEV in flood...