AlexisDerumigny / CondCopulas

Estimation and inference for conditional copulas models
2 stars 1 forks source link

Integrate `ggplot2` in `plot.simpA_kendallReg_test` #3

Open AlexisDerumigny opened 6 months ago

AlexisDerumigny commented 6 months ago

The following works, but it could be directly integrated in the plot method. This means that we would add one more dependency...

N = 300
Z = runif(n = N, min = 0, max = 1)
conditionalTau = -0.9 + 1.8 * Z
simCopula = VineCopula::BiCopSim(N=N , family = 1,
   par = VineCopula::BiCopTau2Par(1 , conditionalTau ))
X1 = qnorm(simCopula[,1])
X2 = qnorm(simCopula[,2])

result = simpA.kendallReg(X1, X2, Z, h_kernel = 0.03)
plot(result) |> 
  ggplot() + 
  geom_line(aes(x = z, y = est_CKT_reg)) + 
  geom_ribbon(aes(x = z, ymin = est_CKT_reg_q025, ymax = est_CKT_reg_q975), alpha = 0.5)