Skip to content

Commit dedd7ea

Browse files
committed
fix typo
1 parent b8a7514 commit dedd7ea

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lectures/bayes_nonconj.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ $$
273273
where
274274

275275
$$
276-
p\left(Y\right)=\int p\left(Y\mid\theta\right)p\left(Y\right) d\theta.
276+
p\left(Y\right)=\int p\left(Y\mid\theta\right)p\left(\theta\right) d\theta.
277277
$$ (eq:intchallenge)
278278
279279
The integral on the right side of {eq}`eq:intchallenge` is typically difficult to compute.
@@ -297,7 +297,7 @@ Note that
297297
$$
298298
\begin{aligned}D_{KL}(q(\theta;\phi)\;\|\;p(\theta\mid Y)) & =-\int q(\theta;\phi)\log\frac{P(\theta\mid Y)}{q(\theta;\phi)} d\theta\\
299299
& =-\int q(\theta)\log\frac{\frac{p(\theta,Y)}{p(Y)}}{q(\theta)} d\theta\\
300-
& =-\int q(\theta)\log\frac{p(\theta,Y)}{p(\theta)q(Y)} d\theta\\
300+
& =-\int q(\theta)\log\frac{p(\theta,Y)}{q(\theta)p(Y)} d\theta\\
301301
& =-\int q(\theta)\left[\log\frac{p(\theta,Y)}{q(\theta)}-\log p(Y)\right] d\theta\\
302302
& =-\int q(\theta)\log\frac{p(\theta,Y)}{q(\theta)}+\int q(\theta)\log p(Y) d\theta\\
303303
& =-\int q(\theta)\log\frac{p(\theta,Y)}{q(\theta)} d\theta+\log p(Y)\\
@@ -406,7 +406,7 @@ def sample_prior(model: BayesianInference):
406406
407407
elif model.name_dist == "vonMises":
408408
# unpack parameters
409-
kappa = model.param
409+
kappa, = model.param
410410
sample = numpyro.sample(
411411
"theta", ShiftedVonMises(kappa), rng_key=model.rng_key
412412
)
@@ -425,7 +425,8 @@ def show_prior(
425425
model: BayesianInference, size=1e5, bins=20, disp_plot=1
426426
):
427427
"""
428-
Visualizes prior distribution by sampling from prior and plots the approximated sampling distribution
428+
Visualizes prior distribution by sampling from prior
429+
and plots the approximated sampling distribution
429430
"""
430431
with numpyro.plate("show_prior", size=size):
431432
sample = sample_prior(model)

0 commit comments

Comments
 (0)