dcop {dsfa}R Documentation

Copula function

Description

Probablitiy density function, distribution and random number generation for copulas.

Usage

dcop(W, delta, family_cop = "normal", log.p = FALSE, deriv = 0)

pcop(W, delta = 0, family_cop = "normal", log.p = FALSE)

rcop(n, delta = 0, family_cop = "normal")

Arguments

W

matrix of pseudo observations. Must have at least two columns.

delta

matrix of copula parameter. Must have at least one column.

family_cop

string, defines the copula family:
independent = Independence copula
normal = Gaussian copula
clayton = Clayton copula
gumbel = Gumbel copula
frank = Frank copula
joe = Joe copula

log.p

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

deriv

derivative of order deriv of the log density. Available are 0,2.

n

number of observations.

Details

For more than 2 dimensions only the gaussian copula is implemented. The functions pcop and rcop are wrapper functions for 'copula' package. The functions pcop and rcop are wrapper functions for the pCopula() and rCopula(). Although the parameter space is larger in theory for some copulas, numeric under- and overflow limit the parameter space. The intervalls for the parameter delta are given as follows:

  1. independent, min=0 and max=1

  2. normal, min=-1 and max=1

  3. clayton, min=1e-16 and max=28

  4. gumbel, min=1 and max=17

  5. frank, min=-35 and max=35

  6. joe, min=1e-16 and max=30

Value

dcop gives the density, pcop gives the distribution function for a specified copula and rcop generates random numbers, with given delta. If the derivatives are calculated these are provided as the attributes gradient, hessian of the output of the density.

Functions

References

Examples

u=0.3; v=0.7; p=0.5
pdf <- dcop(W=matrix(c(u,v), ncol=2), delta=matrix(p,ncol=1), family_cop="normal")
cdf <- pcop(W=matrix(c(u,v), ncol=2), delta=matrix(p,ncol=1), family_cop="normal")
r <- rcop(n=100, delta=matrix(p,nrow=100), family_cop="normal")


[Package dsfa version 1.0.1 Index]