Learn R Programming

RTMBdist (version 1.0.1)

ddcopula: Joint probability under a discrete bivariate copula

Description

Computes the joint probability mass function of two discrete margins combined with a copula CDF.

Usage

ddcopula(d1, d2, p1, p2, Copula, log = FALSE)

Value

Joint probability (or log-probability) under chosen copula

Arguments

d1, d2

Marginal p.m.f. values at the observed points, not on log-scale.

p1, p2

Marginal CDF values at the observed points.

Copula

A function of two arguments returning the copula CDF.

log

Logical; if TRUE, return the log joint density. In this case, d1 and d2 must be on the log scale.

Details

The joint probability mass function for two discrete margins is $$ \Pr(Y_1 = y_1, Y_2 = y_2) = C(F_1(y_1), F_2(y_2)) - C(F_1(y_1-1), F_2(y_2)) - C(F_1(y_1), F_2(y_2-1)) + C(F_1(y_1-1), F_2(y_2-1)), $$ where \(F_i\) are the marginal CDFs, and \(C\) is the copula CDF.

Available copula CDF constructors are:

  • Cclayton (Clayton copula)

  • Cgumbel (Gumbel copula)

  • Cfrank (Frank copula)

See Also

dcopula(), dmvcopula()

Examples

Run this code
x <- c(3,5); y <- c(2,4)
d1 <- dpois(x, 4); d2 <- dpois(y, 3)
p1 <- ppois(x, 4); p2 <- ppois(y, 3)
ddcopula(d1, d2, p1, p2, Copula = Cclayton(2), log = FALSE)

Run the code above in your browser using DataLab