Learn R Programming

rvinecopulib (version 0.2.6.1.1)

bicop_distributions: Bivariate copula distributions

Description

Density, distribution function, random generation and h-functions (with their inverses) for the bivariate copula distribution.

Usage

dbicop(u, family, rotation, parameters)

pbicop(u, family, rotation, parameters)

rbicop(n, family, rotation, parameters, U = NULL)

hbicop(u, cond_var, family, rotation, parameters, inverse = FALSE)

Arguments

u

evaluation points, either a length 2 vector or a two-column matrix.

family

the copula family, a string containing the family name (see bicop for all possible families).

rotation

the rotation of the copula, one of 0, 90, 180, 270.

parameters

a vector or matrix of copula parameters.

n

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

U

optionally, an \(n \times 2\) matrix of values in \((0,1)\). The result is then the inverse Rosenblatt transform of U; if U is a matrix of independent \(U(0, 1)\) variables, this simulates data from vinecop.

cond_var

either 1 or 2; cond_var = 1 conditions on the first variable, cond_var = 2 on the second.

inverse

whether to compute the h-function or its inverse.

Value

dbicop() gives the density, pbicop() gives the distribution function, rbicop() generates random deviates, and hbicop() gives the h-functions (and their inverses).

The length of the result is determined by n for rbicop(), and the number of rows in u for the other functions.

The numerical arguments other than n are recycled to the length of the result.

Details

See bicop for the various implemented copula families.

H-functions (hbicop()) are conditional distributions derived from a copula. If \(C(u, v) = P(U \le u, V \le v)\) is a copula, then $$h_1(v | u) = P(U \le u | V = v),$$ $$h_2(u | v) = P(V \le v | U = u).$$

Examples

Run this code
# NOT RUN {
## evaluate the copula density
dbicop(c(0.1, 0.2), "clay", 90, 3)
dbicop(c(0.1, 0.2), bicop_dist("clay", 90, 3))

## evaluate the copula cdf
pbicop(c(0.1, 0.2), "clay", 90, 3)

## simulate data
plot(rbicop(500, "clay", 90, 3))

## h-functions
joe_cop <- bicop_dist("joe", 0, 3)
# h_1(0.2 | 0.1)
hbicop(c(0.1, 0.2), 1, "bb8", 0, c(2, 0.5))
# h_2(0.1 | 0.2)
hbicop(c(0.1, 0.2), 2, joe_cop)
# h_1^{-1}(0.2 | 0.1)
hbicop(c(0.1, 0.2), 1, "bb8", 0, c(2, 0.5), inverse = TRUE)
# h_2^{-1}(0.1 | 0.2)
hbicop(c(0.1, 0.2), 2, joe_cop, inverse = TRUE)
# }

Run the code above in your browser using DataLab