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: docs/src/hamiltonianmontecarlo.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,4 +26,4 @@ end
26
26
Then use that likelihood to guide the next round of HMC. Using this simulation-plus-sampler
27
27
setup is much easier than working out the math of non-Exponential distributions.
28
28
29
-
1. Billig, E. M., Roy, J. A., Ross, M. E., Dolgert, D. J., & Levy, M. Z. (2015, October). A BAYESIAN MODEL FOR IDENTIFYING AND PREDICTING THE DYNAMICS OF URBAN INSECT INFESTATIONS. In AMERICAN JOURNAL OF TROPICAL MEDICINE AND HYGIENE (Vol. 93, No. 4, pp. 537-537). 8000 WESTPARK DR, STE 130, MCLEAN, VA 22101 USA: AMER SOC TROP MED & HYGIENE.
29
+
1. Billig, E. M., Roy, J. A., Ross, M. E., Dolgert, D. J., & Levy, M. Z. (2015, October). "A Bayesian model for identifying and predicting the dynamics of urban insect infestations," in American Journal OF Tropical Medicine and Hygeine (Vol. 93, No. 4, pp. 537-537).
Copy file name to clipboardExpand all lines: docs/src/importance_skills.md
+10-14Lines changed: 10 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Importance Sampling for Simulation
2
2
3
+
Importance sampling is a way to steer a simulation towards simulating the conditions you most care about. The simplest importance sampling is to wait until a simulation gets near a state of interest and then [`CompetingClocks.split!`](@ref) the simulation into multiple copies that can better explore that state. The technique can be more powerful with the use of likelihoods, as described below.
4
+
3
5
## The Process
4
6
5
7
When you apply importance sampling in simulation, the workflow feels like this:
@@ -14,15 +16,9 @@ When you apply importance sampling in simulation, the workflow feels like this:
14
16
15
17
The main problem is that too large of bias on distributions can lead to mathematical underflow in calculation of the weights. Intuitively, a stochastic simulation can have a lot of individual sampled events, and each event's probability multiplies to get the probability of a path of samples in a trajectory. If those samples are repeatedly biased, they can cause numbers that are too small to represent.
16
18
```math
17
-
w = \frac{L(\lambda_{\mbox{target}})}{L(\lambda_{\mbox{proposal}})}
What you'll see in practice is that the initial simulation, under $p$, works fine, that a small change in a distribution's parameters still works fine, and then the importance-weighted estimates fall off a cliff and show values like $10^{-73}$.
28
24
@@ -63,13 +59,13 @@ If it stops growing linearly with N, your proposal is too far from the target.
63
59
### Use the coefficient of variation of weights to see where variance explodes.
Coefficient of variation is a reparametrization of ESS.
69
65
70
66
### Make a weight histogram
71
67
72
-
Plot log of the weight, $\log_{10}(w)$ or $\log(w/\mbox{mean}(w))$. You want a unimodal, not-too-wide shape. Heavy-tailed distributions indicate you're close to degeneracy.
68
+
Plot log of the weight, $\log_{10}(w)$ or $\log(w/\text{mean}(w))$. You want a unimodal, not-too-wide shape. Heavy-tailed distributions indicate you're close to degeneracy.
Let's say we have three proposal distributions from which we sample evenly, so $\alpha=[1/3, 1/3, 1/3]$. We run each simulation where for each enabling of a clock we pass in a vector of four (4) distributions. The first is the proposal distribution we want to use to generate events for this run. The next three are the actual distribution $p$ and the other proposal distributions.
@@ -118,7 +114,7 @@ to reduce variance in your estimate of the rare event.
118
114
One each run, you choose bias parameters $\theta$ to minimize the Kullback-Liebler.
119
115
120
116
```math
121
-
\mbox{KL}(p^*||q_\theta)
117
+
\text{KL}(p^*||q_\theta)
122
118
```
123
119
124
120
Here $p^*$ is the conditional distribution on the rare event.
@@ -182,7 +178,7 @@ Do the log-space trick. Just like log-sum-exp in machine learning.
182
178
Underflow is a problem. $\exp(-700)$ is small enough to underflow.
0 commit comments