Learn R Programming

kcopula (version 0.1.0)

kcop: The Bivariate K-Copula

Description

Density and distribution function of the bivariate K-copula by Wollschl<U+00E4>ger and Sch<U+00E4>fer (2016).

Usage

pkcopula(u, v, c, N, output = "vector", method = "interpolate")

dkcopula(u, v, c, N, output = "vector")

Arguments

u, v

Numeric vectors with values in \([0, 1]\).

c

Numeric; Pearson correlation coefficient in \([-1, 1]\).

N

Numeric; inverse fluctuation strength of correlations around their average c, \(N>0\). The larger N the smaller the fluctuations around c, and vice versa.

output

Character; output as "vector" (default) for single values of the K-copula, or "matrix" for the full K-copula.

method

Character; method to be used for pkcopula(..., output = "vector"). If method = "interpolate" (default), values are computed by interpolating the bivariate K-copula distribution function (computationally faster); returns NA, if u, v are out of range (here: outside of \([.025, .975]\)). If method = "integrate", values are computed by integrating the bivariate K-copula density (computationally slower).

Value

dkcopula gives the density (PDF), pkcopula gives the distribution function (CDF) of the bivariate K-copula.

References

Wollschl<U+00E4>ger, M. and Sch<U+00E4>fer, R. (2016). Impact of nonstationarity on estimating and modeling empirical copulas of daily stock returns. Journal of Risk, 19(1):1--23. https://doi.org/10.21314/JOR.2016.342. SSRN version: https://ssrn.com/abstract=3533903.

Chetalova, D., Wollschl<U+00E4>ger, M., and Sch<U+00E4>fer, R. (2015). Dependence structure of market states. Journal of Statistical Mechanics: Theory and Experiment, 2015(8):P08012. https://doi.org/10.1088/1742-5468/2015/08/P08012. SSRN version: https://ssrn.com/abstract=3533951.

Examples

Run this code
# NOT RUN {
## Parameters
u <- seq(.05, .95, .05)
v <- u
rho <- .2
N <- 4

## K-copula PDF
dkcopula(.5, .5, rho, N)

# }
# NOT RUN {
## Plot full K-copula PDF
kcopula_pdf <- dkcopula(u, v, rho, N, output = "matrix")
persp(u, v, kcopula_pdf)

## K-copula CDF
pkcopula(.5, .5, rho, N)

## Plot full K-copula CDF
kcopula_cdf <- pkcopula(u, v, rho, N, output = "matrix")
persp(u, v, kcopula_cdf)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab