Learn R Programming

RTDE (version 0.2-2)

FGM: The Eyraud Farlie Gumbel Morgenstern Distribution

Description

Density function, distribution function, quantile function, random generation.

Usage

dFGM(u, v, alpha, log = FALSE)
pFGM(u, v, alpha, lower.tail=TRUE, log.p = FALSE)
qFGM(p, alpha, lower.tail=TRUE, log.p = FALSE)
rFGM(n, alpha)

Value

dFGM gives the density,

pFGM gives the distribution function,

qFGM gives the quantile function, and

rFGM generates random deviates.

The length of the result is determined by n for

rFGM, and is the maximum of the lengths of the numerical parameters for the other functions.

The numerical parameters other than n are recycled to the length of the result. Only the first elements of the logical parameters are used.

Arguments

u, v

vector of quantiles.

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

alpha

shape parameter.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are \(P[X \le x]\), otherwise, \(P[X > x]\).

Author

Christophe Dutang

Details

The FGM is defined by the following distribution function $$ C(u,v) = u*v*(1+\alpha*(1-u)*(1-v)) $$ for all \(u,v\) in [0,1] and \(\alpha\) in [0,1]. When lower.tail=FALSE, pFGM returns the survival copula \(P(U > u, V > v)\).

References

Nelsen, R. (2006), An Introduction to Copula, Second Edition, Springer.

Examples

Run this code

#####
# (1) density function
u <- v <- seq(0, 1, length=25)

cbind(u, v, dFGM(u, v, 1/2))
cbind(u, v, outer(u, v, dFGM, alpha=1/2))


#####
# (2) distribution function

cbind(u, v, pFGM(u, v, 1/2))
cbind(u, v, outer(u, v, pFGM, alpha=1/2))




		

Run the code above in your browser using DataLab