Explain and derive importance sampling estimators
Company: Tesla
Role: Machine Learning Engineer
Category: Statistics & Math
Difficulty: hard
Interview Round: Technical Screen
Explain importance sampling. Derive an estimator for mu = E_p[f(X)] when sampling from a proposal q whose support covers that of p. Show the unnormalized estimator using weights w(x) = p(x) / q(x) and the self-normalized estimator, and discuss bias and variance properties of each. Derive how the variance depends on the choice of q and why an ideal proposal is proportional to |f(x)| p(x). Define and interpret effective sample size (ESS). Provide a concrete numerical example (e.g., estimating an integral or expectation under a target Gaussian using a different Gaussian proposal), include pseudocode, and discuss pitfalls such as weight degeneracy, heavy-tailed proposals, and high-variance tails. Optionally relate importance sampling to off-policy evaluation in reinforcement learning and resampling in particle filters.
Quick Answer: This question evaluates understanding of importance sampling, Monte Carlo estimators, weight normalization, variance behavior, optimal proposal selection, and effective sample size, assessing competency in statistical estimation and Monte Carlo methods.