Learn R Programming

VGAM (version 0.8-3)

Frank: Frank's Bivariate Distribution

Description

Density, distribution function, and random generation for the (one parameter) bivariate Frank distribution.

Usage

dfrank(x1, x2, alpha, log=FALSE)
pfrank(q1, q2, alpha)
rfrank(n, alpha)

Arguments

x1, x2, q1, q2
vector of quantiles.
n
number of observations. Must be a positive integer of length 1.
alpha
the positive association parameter $\alpha$.
log
Logical. If log=TRUE then the logarithm of the density is returned.

Value

  • dfrank gives the density, pfrank gives the distribution function, and rfrank generates random deviates (a two-column matrix).

Details

See frank, the VGAM family functions for estimating the association parameter by maximum likelihood estimation, for the formula of the cumulative distribution function and other details.

References

Genest, C. (1987) Frank's family of bivariate distributions. Biometrika, 74, 549--555.

See Also

frank.

Examples

Run this code
N = 100
x = seq(-0.30, 1.30, len=N)
alpha = 8
ox = expand.grid(x, x)
z = dfrank(ox[,1], ox[,2], alp=alpha)
contour(x, x, matrix(z, N, N))
z = pfrank(ox[,1], ox[,2], alp=alpha)
contour(x, x, matrix(z, N, N))

alpha = exp(4)
plot(r <- rfrank(n=3000, alpha=alpha))
par(mfrow=c(1,2))
hist(r[,1]) # Should be uniform
hist(r[,2]) # Should be uniform

Run the code above in your browser using DataLab