I have a copula representing the dependence between two variables X and Y. I want to compute the following formula: E(X|Y≤1%). It is the expected value of X conditional on Y being lower than 1%. I see that a somewhat similar question was asked there but the R code provided does not give the value I am looking for. Below are some details about the copula and marginal distribution.
library(VineCopula)
library(copula)
#I estimate my Copula and assumes normal distribution for the two marginals
copula_dist <- mvdc(copula=claytonCopula(param=1.0), margins=c("norm","norm"),
paramMargins=list(list(mean=0, sd=5),list(mean=0, sd=5)))
#I take a sample of 500 events
sim <- rMvdc(500,copula_dist)
# Compute the density
pdf_mvd <- dMvdc(sim, my_dist)
# Compute the CDF
cdf_mvd <- pMvdc(sim, my_dist)