# We simulate from a conditional copula
set.seed(1)
N = 100
# This is a small example for performance reasons.
# For a better example, use:
# N = 800
Z = rnorm(n = N, mean = 5, sd = 2)
conditionalTau = -0.9 + 1.8 * pnorm(Z, mean = 5, sd = 2)
simCopula = VineCopula::BiCopSim(N=N , family = 1,
par = VineCopula::BiCopTau2Par(1 , conditionalTau ))
X1 = qnorm(simCopula[,1])
X2 = qnorm(simCopula[,2])
newZ = seq(2, 10, by = 1)
estimatedCKT_kernel <- CKT.kernel(
X1 = X1, X2 = X2, Z = Z,
newZ = newZ, h = 0.2, kernel.name = "Epa", se = TRUE)
se(estimatedCKT_kernel)
confint(estimatedCKT_kernel, level = 0.9)
plot(estimatedCKT_kernel, confint = TRUE)
Run the code above in your browser using DataLab