# Numerically estimating expected value of f(x) when x is normally distributed

I need to estimate $$\mathbb{E}_x[f_i(x)] = \int_{\mathbb{R}^n} f_i(x) p(x) dx$$ for many functions $$f_i(x)$$, where $$p(x)$$ is the density of a normal distribution. The evaluation of all the functions $$f_i(x)$$ is expensive. I was looking into Bayesian Quadrature but I cannot find an (approximately) optimal way of choosing sample points.

• How accurate does this estimate need to be? Highly accurate or somewhat accurate? Also: what properties about $f$ do you know? Is it $L$-Lipschitz or smooth in some other sense, or does $f$ vary widely? – cdipaolo Aug 18 '19 at 15:41
• The approximation doesn't need to be higly accurate, $f$ is L-Lipschitz. – Rosh Aug 18 '19 at 16:23
• in that case, you can always get a Monte-Carlo estimate (depending on your internal definition of “highly accurate.”) Since $f$ is Lipschitz, $f(x)$ is sub-Gaussian and obeys nice concentration properties. – cdipaolo Aug 19 '19 at 5:29
• The problem is that Monte-Carlo converges slowly. I was looking to find a way of defining the sampling points (with the corresponding weights) to converge faster than Monte-Carlo. – Rosh Aug 19 '19 at 8:27

## 1 Answer

Please have a look at the answers to this question on CrossValidated. There you can find a worked out solution (including R-code) based on Gauss-Hermite quadrature, which is especially designed for this problem (note that it requires a variable transformation) and -in a different answer- a comparsion of MonteCarlo (slow) with the R builtin function integrate (fast).