Skip to content

Commit c57d8c5

Browse files
committed
minor updates
1 parent af66993 commit c57d8c5

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

lectures/likelihood_bayes.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ $f$ or $g$.
7676

7777
Before the beginning of time, nature once and for all decides whether she will draw a sequence of IID draws from $f$ or from $g$.
7878

79-
We will sometimes let $q$ be the density that nature chose once and for all, so
79+
We let $q$ be the density that nature chose once and for all, so
8080
that $q$ is either $f$ or $g$, permanently.
8181

8282
Nature knows which density it permanently draws from, but we the observers do not.
@@ -584,7 +584,7 @@ def compute_KL(f, g):
584584
585585
def compute_div_m(f, g):
586586
"""
587-
Compute Jensen-Shannon divergence
587+
Compute KL(m, f) and KL(m, g)
588588
"""
589589
def m(w):
590590
return 0.5 * (f(w) + g(w))
@@ -602,7 +602,7 @@ Since $KL(m, f) < KL(m, g)$, $f$ is "closer" to the mixture distribution $m$.
602602
Hence by our discussion on KL divergence and likelihood ratio process in
603603
{doc}`likelihood_ratio_process`, $\log(L_t) \to \infty$ as $t \to \infty$.
604604
605-
Now looking back to the key equation {eq}`eq_Bayeslaw1033`.
605+
Now look back at the key equation {eq}`eq_Bayeslaw1033`.
606606
607607
Consider the function
608608
@@ -734,12 +734,12 @@ Thus, let $\{\pi_t(\omega)\}_{t=0}^\infty$ denote a particular sample path index
734734
\in \Omega$.
735735
736736
We can think of nature as drawing an $\omega \in \Omega$ from a probability distribution
737-
${\textrm{Prob}} \Omega$ and then generating a single realization (or _simulation_) $\{\pi_t(\omega)\}_{t=0}^\infty$ of the process.
737+
${\textrm{Prob}}(\Omega)$ and then generating a single realization (or _simulation_) $\{\pi_t(\omega)\}_{t=0}^\infty$ of the process.
738738
739739
The limit points of $\{\pi_t(\omega)\}_{t=0}^\infty$ as $t \rightarrow +\infty$ are realizations of a random variable that is swept out as we sample $\omega$ from $\Omega$ and construct repeated draws of $\{\pi_t(\omega)\}_{t=0}^\infty$.
740740
741741
742-
By staring at law of motion {eq}`eq_recur1` or {eq}`eq:like44` , we can figure out some things about the probability distribution of the limit points
742+
By staring at the law of motion {eq}`eq_recur1` or {eq}`eq:like44`, we can figure out some things about the probability distribution of the limit points
743743
744744
745745
@@ -765,8 +765,8 @@ $$
765765
$$
766766
767767
768-
Thus, for some realizations, $\lim_{\rightarrow + \infty} \pi_t(\omega) =1$
769-
while for other realizations, $\lim_{\rightarrow + \infty} \pi_t(\omega) =0$.
768+
Thus, for some realizations, $\lim_{t \rightarrow + \infty} \pi_t(\omega) =1$
769+
while for other realizations, $\lim_{t \rightarrow + \infty} \pi_t(\omega) =0$.
770770
771771
Now let's remember that $\{\pi_t\}_{t=0}^\infty$ is a martingale and apply the law of iterated expectations.
772772
@@ -888,7 +888,7 @@ plt.show()
888888
889889
The above graph indicates that
890890
891-
* each of paths converges
891+
* each of the paths converges
892892
893893
* some of the paths converge to $1$
894894
@@ -913,7 +913,7 @@ Evidently, by $t = 199$, $\pi_t$ has converged to either $0$ or $1$.
913913
914914
The fraction of paths that have converged to $1$ is $.5$
915915
916-
The fractions of paths that have converged to $0$ is also $.5$.
916+
The fraction of paths that have converged to $0$ is also $.5$.
917917
918918
Does the fraction $.5$ ring a bell?
919919
@@ -954,9 +954,9 @@ $F$ more frequently along a sample path, and this pushes $\pi_t$ toward $1$.
954954
fig, ax = plt.subplots()
955955
for i, j in enumerate([10, 100]):
956956
ax.plot(range(T+1), π_path[j,:], color=colors[i],
957-
label=fr'$\pi$_path, {j}-th simulation', lw=2)
957+
label=fr'$\{\pi_t\}$, {j}-th simulation', lw=2)
958958
ax.plot(range(1,T+1), w_path[j,:], color=colors[i],
959-
label=fr'$w$_path, {j}-th simulation', alpha=0.3, lw=2)
959+
label=fr'$\{w_t\}$, {j}-th simulation', alpha=0.3, lw=2)
960960
961961
ax.legend(loc='upper right')
962962
ax.set_xlabel('time')
@@ -1001,7 +1001,7 @@ $$
10011001
\Bigl[ \pi_{t-1} f(w) + (1-\pi_{t-1})g(w) \Bigr] d w
10021002
$$
10031003
1004-
We can use a Monte Carlo simulation to approximate this conditional variance.
1004+
We can use a Monte Carlo simulation to approximate this conditional variance.
10051005
10061006
We approximate it for a grid of points $\pi_{t-1} \in [0,1]$.
10071007
@@ -1010,7 +1010,7 @@ Then we'll plot it.
10101010
```{code-cell} ipython3
10111011
@jit
10121012
def compute_cond_var(π, mc_size=int(1e6)):
1013-
# Create monte carlo draws
1013+
# Create Monte Carlo draws
10141014
mc_draws = np.zeros(mc_size)
10151015
10161016
for i in prange(mc_size):

lectures/likelihood_ratio_process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ $f$ or $g$.
7373
Before the beginning of time, nature once and for all decides whether she will draw a sequence of IID draws from either
7474
$f$ or $g$.
7575

76-
We will sometimes let $q$ be the density that nature chose once and for all, so
76+
We let $q$ be the density that nature chose once and for all, so
7777
that $q$ is either $f$ or $g$, permanently.
7878

7979
Nature knows which density it permanently draws from, but we the observers do not.

lectures/likelihood_ratio_process_2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $f$ or $g$.
7575
Before the beginning of time, nature once and for all decides whether she will draw a sequence of IID draws from either
7676
$f$ or $g$.
7777

78-
We will sometimes let $q$ be the density that nature chose once and for all, so
78+
We let $q$ be the density that nature chose once and for all, so
7979
that $q$ is either $f$ or $g$, permanently.
8080

8181
Nature knows which density it permanently draws from, but we the observers do not.

0 commit comments

Comments
 (0)