@@ -65,7 +65,7 @@ Thus, we change the specification in [](likelihood_bayes) in the following way.
6565Now, ** each period** $t \geq 0$, nature flips a possibly unfair coin that comes up $f$ with probability $\alpha$
6666and $g$ with probability $1 -\alpha$.
6767
68- Thus, nature perpetually draws from the ** mixture distribution** with c.d.f.
68+ Thus, nature perpetually draws from the ** mixture distribution** with CDF
6969
7070$$
7171H(w) = \alpha F(w) + (1-\alpha) G(w), \quad \alpha \in (0,1)
@@ -220,7 +220,7 @@ Here is pseudo code for a direct "method 1" for drawing from our compound lotter
220220
221221Our second method uses a uniform distribution and the following fact that we also described and used in [ ] ( prob_matrix ) :
222222
223- * If a random variable $X$ has c.d.f. $F$, then a random variable $F^{-1}(U)$ also has c.d.f. $F$, where $U$ is a uniform random variable on $[ 0,1] $.
223+ * If a random variable $X$ has CDF $F$, then a random variable $F^{-1}(U)$ also has CDF $F$, where $U$ is a uniform random variable on $[ 0,1] $.
224224
225225In other words, if $X \sim F(x)$ we can generate a random sample from $F$ by drawing a random sample from
226226a uniform distribution on $[ 0,1] $ and computing $F^{-1}(U)$.
@@ -267,6 +267,12 @@ def draw_lottery_MC(key, p, N):
267267```
268268
269269``` {code-cell} ipython3
270+ ---
271+ mystnb:
272+ figure:
273+ caption: Direct and Monte Carlo draws
274+ name: fig-lottery-draws
275+ ---
270276# verify
271277N = 100000
272278α = 0.0
@@ -457,6 +463,12 @@ def plot_π_seq(key, α, π1=0.2, π2=0.8, T=200):
457463```
458464
459465```{code-cell} ipython3
466+ ---
467+ mystnb:
468+ figure:
469+ caption: Belief paths, $\alpha = 0.6$
470+ name: fig-pi-seq-1
471+ ---
460472plot_π_seq(jax.random.key(42), α=0.6)
461473```
462474
@@ -467,6 +479,12 @@ sample paths of $\pi_t$ that start from two distinct initial conditions.
467479Let's see what happens when we change $\alpha$.
468480
469481```{code-cell} ipython3
482+ ---
483+ mystnb:
484+ figure:
485+ caption: Belief paths, $\alpha = 0.2$
486+ name: fig-pi-seq-2
487+ ---
470488plot_π_seq(jax.random.key(42), α=0.2)
471489```
472490
@@ -568,6 +586,12 @@ def π_lim(key, α, T=5000, π_0=0.4):
568586Let us first plot the KL divergences $KL_g\left(\alpha\right), KL_f\left(\alpha\right)$ for each $\alpha$.
569587
570588``` {code-cell} ipython3
589+ ---
590+ mystnb:
591+ figure:
592+ caption: KL divergences against $\alpha$
593+ name: fig-kl
594+ ---
571595α_arr = np.linspace(0, 1, 100)
572596KL_g_arr = KL_g_v(α_arr)
573597KL_f_arr = KL_f_v(α_arr)
@@ -598,6 +622,12 @@ recorded on the $x$ axis.
598622Thus, the graph below confirms how a minimum KL divergence governs what our type 1 agent eventually learns.
599623
600624``` {code-cell} ipython3
625+ ---
626+ mystnb:
627+ figure:
628+ caption: Limit points and KL divergences
629+ name: fig-kl-limit
630+ ---
601631α_arr_x = α_arr[(α_arr < discretion) | (α_arr > discretion)]
602632keys = jax.random.split(jax.random.key(42), len(α_arr_x))
603633π_lim_arr = π_lim_v(keys, α_arr_x)
@@ -710,6 +740,12 @@ def MCMC_run(ws):
710740The following code generates the graph below that displays Bayesian posteriors for $\alpha$ at various history lengths.
711741
712742``` {code-cell} ipython3
743+ ---
744+ mystnb:
745+ figure:
746+ caption: Posterior for $\alpha$ as $t$ grows
747+ name: fig-posterior-alpha
748+ ---
713749fig, ax = plt.subplots()
714750
715751for i in range(len(sizes)):
0 commit comments