← Back to AI Math Mind Map
⚡Flashcard Drill➔
📐 AI MathID: importance-sampling

Importance Sampling

重要性采样
🎯Core Definition
Importance Sampling estimates Ep[f]\mathbb{E}_p[f] without sampling from pp directly: when pp is hard to sample, draw from an easy qq and reweight,
📌Overview
Ep[f]=∫f(x)p(x) dx=∫f(x)p(x)q(x)q(x) dx=Eq[f(x)w(x)],w(x)=p(x)q(x),\mathbb{E}_p[f] = \int f(x) p(x) \, dx = \int f(x) \frac{p(x)}{q(x)} q(x) \, dx = \mathbb{E}_q[f(x) w(x)], \quad w(x) = \frac{p(x)}{q(x)},
📌Overview
the weight w=p/qw = p/q corrects the mismatch between proposal and target; the sample mean μ^=1n∑i=1nf(xi)w(xi)\hat\mu = \frac{1}{n} \sum_{i=1}^{n} f(x_i) w(x_i) is unbiased. Its variance is
📌Overview
Varq[fw]=Eq[(fw)2]−(Ep[f])2,\mathrm{Var}_q[f w] = \mathbb{E}_q[(f w)^2] - (\mathbb{E}_p[f])^2,
📌Overview
which explodes (extreme-weight problem) when qq has thinner tails than pp, making the ratio ww unbounded.
💡Use Cases
Bayesian posterior expectations, off-policy reinforcement learning (importance ratio π(a∣s)/μ(a∣s)\pi(a \mid s) / \mu(a \mid s)), and variance reduction in Monte Carlo integration; interviews often probe the weight formula, variance conditions and the optimal proposal.
⚡Key Problems Solved
expectations without drawing target samples, and one batch of qq-samples serves many target distributions (off-policy reuse); the theoretically optimal proposal q∗(x)∝p(x)∣f(x)∣q^*(x) \propto p(x) |f(x)| makes fwfw constant with zero variance, but its normalization is unknown and it still requires sampling from p∣f∣p|f|, so in practice one uses heavy-tailed proposals and monitors the effective sample size ESS=1/∑iw^i2ESS = 1 / \sum_i \hat{w}_i^2 to guard against weight collapse.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Importance Sampling.
Use Cases
In production engineering, what are the primary use cases for Importance Sampling and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Derive Ep[f]=Eq[fw]\mathbb{E}_p[f] = \mathbb{E}_q[f w] with weight w=p/qw = p/q; why is the sample-mean estimator unbiased?
2
What is the variance formula Varq[fw]\mathrm{Var}_q[f w]? Why does a mismatched qq blow up the variance?
3
What is the optimal proposal? Why does it drive variance to 0, and why can't it be used in practice?
4
How is the effective sample size ESS=1/∑w^i2ESS = 1/\sum \hat{w}_i^2 defined and what does it measure?
5
Importance sampling vs rejection sampling: estimating expectations vs generating samples; weighted average vs 0/1 acceptance?
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Importance Sampling"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
← Previous CardRejection SamplingNext Card →Markov Chain & Detailed Balance

🔗 More AI Math Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/Math/card/importance-sampling