dfcop_dist: A discrete factor copula distribution

Description Usage Arguments Details Value Note Examples

Description

A S3 class to store discrete factor copula distributions.

Usage

1
2
3
4
5
dfcop_dist(prob, family = "indep", parameters = numeric(0))

ddfcop(x, prob, family = "indep", parameters = numeric(0), ngrid = 100)

rdfcop(n, prob, family = "indep", parameters = numeric(0))

Arguments

prob

the marginal probabilities, a vector of numbers in (0,1).

family

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

parameters

a vector or matrix of copula paramters.

x

a binary vector of the same length as prob

ngrid

number of nodes and weights for the Gaussian quadrature

n

number of observations.

Details

The implemented families listed below. Partial matching is activated, i.e., "gauss" is equivalent to "gaussian".

indep

Independence copula.

gaussian

Gaussian copula.

t

Student t copula.

clayton

Clayton copula.

gumbel

Gumbel copula.

frank

Frank copula.

joe

Joe copula.

bb1

BB1 copula.

bb6

BB6 copula.

bb7

BB7 copula.

bb8

BB8 copula.

Value

An object of class dfcop_dist.

Note

The evaluation functions can optionally be used with a dfcop_dist object, e.g., ddfcop(c(1, 0), dfcop_dist(c(0.5, 0.5),"indep")).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# A 10-dimensional Gaussian factor copula
dfcop_dist(runif(10),"gaussian", 0.5)
str(dfcop_dist(runif(10), "gauss", 0.5))

# A 100-dimensional rotated Clayton factor copula
dfcop <- dfcop_dist(runif(100), "clayton", 3)
 
# evaluate the probability mass function
ddfcop(cbind(c(1,1,0,0), c(1,0,1,0)), c(0.5, 0.5), "indep")
ddfcop(rbinom(100, 1, 0.5), dfcop)

# simulate data
rdfcop(1e2, c(0.5, 0.5))
rdfcop(1e2, dfcop)

tvatter/mdmd documentation built on May 13, 2019, 4:11 a.m.