You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lectures/imp_sample.md
+23-16Lines changed: 23 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ import matplotlib.pyplot as plt
36
36
from math import gamma
37
37
```
38
38
39
-
## Mathematical Expectation of Likelihood Ratio
39
+
## Mathematical expectation of likelihood ratio
40
40
41
41
In {doc}`this lecture <likelihood_ratio_process>`, we studied a likelihood ratio $\ell \left(\omega_t\right)$
42
42
@@ -57,11 +57,10 @@ $$
57
57
Our goal is to approximate the mathematical expectation $E \left[ L\left(\omega^t\right) \right]$ well.
58
58
59
59
In {doc}`this lecture <likelihood_ratio_process>`, we showed that $E \left[ L\left(\omega^t\right) \right]$ equals $1$ for all $t$.
60
+
60
61
We want to check out how well this holds if we replace $E$ by with sample averages from simulations.
61
62
62
-
This turns out to be easier said than done because for
63
-
Beta distributions assumed above, $L\left(\omega^t\right)$ has
64
-
a very skewed distribution with a very long tail as $t \rightarrow \infty$.
63
+
This turns out to be easier said than done because for Beta distributions assumed above, $L\left(\omega^t\right)$ has a very skewed distribution with a very long tail as $t \rightarrow \infty$.
65
64
66
65
This property makes it difficult efficiently and accurately to estimate the mean by standard Monte Carlo simulation methods.
Since we must use an $h$ that has larger mass in parts of the distribution to which $g$ puts low mass, we use $h=Beta(0.5, 0.5)$ as our importance distribution.
162
161
@@ -178,7 +177,7 @@ plt.ylim([0., 3.])
178
177
plt.show()
179
178
```
180
179
181
-
## Approximating a Cumulative Likelihood Ratio
180
+
## Approximating a cumulative likelihood ratio
182
181
183
182
We now study how to use importance sampling to approximate
The Monte Carlo method underestimates because the likelihood ratio $L(\omega^T) = \prod_{t=1}^T \frac{f(\omega_t)}{g(\omega_t)}$ has a highly skewed distribution under $g$.
251
+
252
+
Most samples from $g$ produce small likelihood ratios, while the true mean requires occasional very large values that are rarely sampled.
253
+
254
+
In our case, since $g(\omega) \to 0$ as $\omega \to 0$ while $f(\omega)$ remains constant, the Monte Carlo procedure undersamples precisely where the likelihood ratio $\frac{f(\omega)}{g(\omega)}$ is largest.
255
+
256
+
As $T$ increases, this problem worsens exponentially, making standard Monte Carlo increasingly unreliable.
257
+
258
+
Importance sampling with $q = h$ fixes this by sampling more uniformly from regions important to both $f$ and $g$.
259
+
260
+
## Distribution of sample mean
252
261
253
262
We next study the bias and efficiency of the Monte Carlo and importance sampling approaches.
254
263
@@ -323,17 +332,15 @@ The simulation exercises above show that the importance sampling estimates are u
323
332
324
333
Evidently, the bias increases with increases in $T$.
325
334
326
-
## Choosing a Sampling Distribution
335
+
## Choosing a sampling distribution
327
336
328
337
+++
329
338
330
339
Above, we arbitraily chose $h = Beta(0.5,0.5)$ as the importance distribution.
331
340
332
341
Is there an optimal importance distribution?
333
342
334
-
In our particular case, since we know in advance that $E_0 \left[ L\left(\omega^t\right) \right] = 1$.
335
-
336
-
We can use that knowledge to our advantage.
343
+
In our particular case, since we know in advance that $E_0 \left[ L\left(\omega^t\right) \right] = 1$, we can use that knowledge to our advantage.
0 commit comments