rho <- 0.2
f1 <- function(X) {
x <- X[1]
y <- X[2]
(pnorm(x-10)-pnorm(y-10))^2*(exp(-((x-10)^2-2*rho*(x-10)*(y-10)+(y-10)^2)/(2*(1-rho^2)))/(2*pi*sqrt(1-rho^2)))
}
library(cubature)
round(hcubature(f1, c(-Inf, -Inf), c(Inf, Inf), tol = 1e-12)$integral, 6)
this gave 0, but the correct answer should be 0.1348. Could anyone help me? Many thanks.