I want to approximate the integral corresponds to $E(XY)$ where X and Y are independent and X~N(0.5,1) and Y~N(0.5,1), using gauss-hermit quadrature using mvQuad package.
Since the two random variables are normal distributed, the approximated value should be close to 0.25.
But I am getting a different results.
> require(mvQuad)
> nw <- createNIGrid(dim=2, type="GHe", level=c(10,10))
> m=c(0.5,0.5)
> c=matrix(c(1,0,0,1),nrow = 2,byrow = F)
> rescale(nw, m = m, C = c, dec.type = 0)
>
> myFun2d <- function(x){
+ (0.5+sqrt(2)*x[,1])*(0.5+sqrt(2)*x[,2])/pi
+ }
>
> quadrature(myFun2d, grid = nw)
[1] 58.71479
>
Can anybody helps me to figure out what I am doing wrong?
Thank you