3
$\begingroup$

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]$?

$\endgroup$
1

1 Answer 1

2
$\begingroup$

The solution remains unbiased as $(\mu^\star,\sigma^\star)$ does not depend on the sample from $q_{\mu^\star,\sigma^\star}(\cdot)$.

The optimisation$$\mu^*,\sigma^* := \arg \max_{\mu,\sigma} \mathbb{E}_{X' \sim q_{\mu,\sigma}}[X' p(X')/q_{\mu,\sigma}(X')]$$does not make sense since $$\mathbb{E}_{X' \sim q_{\mu,\sigma}}[X' p(X')/q_{\mu,\sigma}(X')]=\mathbb{E}_{X \sim p}[X]$$for all $(\mu,\sigma)$. One alternative is to minimise the variance $$\mu^*,\sigma^* := \arg \min_{\mu,\sigma} \mathbb{E}_{X \sim q_{\mu,\sigma}}[X^2p(X)^2/q_{\mu,\sigma}(X)^2]$$which leads to $q_{\mu,\sigma}(x)\propto |x|p(x)|$ if feasible; another to bring $q_{\mu,\sigma}$ as close as possible to $p$: $$\mu^*,\sigma^* := \arg \min_{\mu,\sigma} \mathbb{E}_{X \sim q_{\mu,\sigma}}[\log q_{\mu,\sigma}(X)/p(X)]$$ or $$\mu^*,\sigma^* := \arg \min_{\mu,\sigma} \mathbb{E}_{X \sim p}[\log p(X)/q_{\mu,\sigma}(X)]:= \arg \max_{\mu,\sigma} \mathbb{E}_{X \sim p}[\log q_{\mu,\sigma}(X)]$$

$\endgroup$
6
  • $\begingroup$ Thank you! Those are excellent points. (I think the reason why the maximization superficially seemed to make sense is that I'm estimating the expectation by taking a few samples; and because $X$ is close to zero for everywhere except a small region of $\mathbb{R}^d$, the sampling-based estimate tends to underestimate the true expectation unless $q_{\mu,\sigma}$ is close to $p$. But your proposals make more sense. Thank you!) $\endgroup$
    – D.W.
    Commented May 10, 2020 at 23:19
  • $\begingroup$ What made you choose $\mathbb{E}[\log q_{\mu,\sigma}(X) / p(X)]$ rather than, say, the KL between $q_{\mu,\sigma}$ and $p$? e.g., $\mathbb{E}[\log (q_{\mu,\sigma}(X) / p(X))]$? Or perhaps that is already what you meant? Do you have any advice on how you would choose between these two ways of measuring how close $q_{\mu,\sigma}$ is to $p$? Thank you again! $\endgroup$
    – D.W.
    Commented May 20, 2020 at 18:37
  • $\begingroup$ Yes I meant the Kullback-Leibler. $\endgroup$
    – Xi'an
    Commented May 20, 2020 at 19:40
  • $\begingroup$ Can you help me understand why making $q_{\mu,\sigma}$ similar to $p$ is a useful/sensible thing to do? I've seen results that the optimal $q(x)$ is proportional to $x p(x)$ (optimal in the sense of minimizing variance). Is there a sense in which using $q$ that is most similar to $p$ is a good choice? In the extreme, where $q=p$, it seems this offers no advantage over ordinary sampling from $p$, so I'm struggling to understand. I'm happy to ask this as a separate question if you think that's more suitable. Thank you for your help! $\endgroup$
    – D.W.
    Commented Jun 12, 2020 at 6:18
  • $\begingroup$ It all depends on the chosen criterion. If using Kullback with $xp(x)$, $xp(x)$ need be normalised into a density. $\endgroup$
    – Xi'an
    Commented Jun 12, 2020 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.