I'm wondering if it is OK to combine importance sampling with optimization to choose the parameters for the substitute distribution.
I have a non-negative random variable $X$ on $\mathbb{R}^d$ with pdf $p(x)$, and I want to estimate $\mathbb{E}[X]$. $X$ is close to zero for everywhere except a small region of $\mathbb{R}^d$, which makes it harder to estimate $\mathbb{E}[X]$ through random sampling. When $d$ is large, evaluating the integral $\int_x x p(x)\, dx$ is expensive, so I am looking for more efficient methods. I know that $f$ is sharply concentrated: i.e., it is zero mostly everywhere, except for a small region where it is large.
I've come up with following method for estimating $\mathbb{E}[X]$. I am going to use importance sampling with some substitute distribution $q(x)$, using the fact that
$$\mathbb{E}_{X \sim p}[X] = \mathbb{E}_{X' \sim q}[X' p(X')/q(X')].$$
Next I will try to find a substitute distribution $q$ that gives me the best estimate. In particular, I will let $q$ be a multivariate Gaussian distribution with mean $\mu$ and covariance matrix $\sigma$. Then I will optimize over $\mu,\sigma$, letting
$$\mu^*,\sigma^* := \arg \max_{\mu,\sigma} \mathbb{E}_{X' \sim q_{\mu,\sigma}}[X' p(X')/q_{\mu,\sigma}(X')].$$
Finally, I will estimate $\mathbb{E}_{X' \sim q_{\mu^*,\sigma^*}}[X' p(X')/q_{\mu^*,\sigma^*}(X')]$ by sampling a value of $x'$ from $q_{\mu^*,\sigma^*}$ and computing $x' p(x')/q_{\mu^*,\sigma^*}(x')$ (or sampling a few values and taking the average) and using this as my estimate for $\mathbb{E}[X]$.
My question: Is this an unbiased estimate of $\mathbb{E}[X]$?
My doubt: we're choosing $\mu^*,\sigma^*$ somehow based on $p$, so it feels "not independent" and that makes me worry that it might cause a bias.
Follow-up question: Is there a better way to use optimization to make a better choice of $\mu^*,\sigma^*$ that will give a lower-variance estimate of $\mathbb{E}[X]$?