kcopula provides the bivariate K-copula by Wollschläger and Schäfer
(2016). It provides two functions: * pkcopula()
gives the
distribution function of the bivariate K-copula. *
dkcopula()
gives the density of the bivariate K-copula.
Install release version from CRAN:
install.packages("kcopula")
Install development version from GitHub:
# install.packages("devtools")
::install_github("mlkremer/kcopula") devtools
This example plots the bivariate K-copula density and distribution function.
library(kcopula)
## Parameters
<- .05 # step size
b <- seq(b, 1 - b, b)
u <- u
v <- .2
rho <- 4
N
## K-copula CDF
pkcopula(.5, .5, rho, N)
## Plot full K-copula CDF
<- pkcopula(u, v, rho, N, output = "matrix")
kcopula_cdf persp(u, v, kcopula_cdf, zlim = c(0, 1), xlab = "\n\n u", ylab = "\n\n v",
zlab = "\n\n CDF", theta = 30, phi = 30, ticktype = "detailed")
## K-copula PDF
dkcopula(.5, .5, rho, N)
## Plot full K-copula PDF
<- dkcopula(u, v, rho, N, output = "matrix")
kcopula_pdf persp(u, v, kcopula_pdf, zlim = c(0, max(kcopula_pdf)), xlab = "\n\n u", ylab = "\n\n v",
zlab = "\n\n PDF", theta = 30, phi = 30, ticktype = "detailed")
Wollschläger, M. and Schä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äger, M., and Schä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.