Skip to content

Commit

Permalink
tidy website
Browse files Browse the repository at this point in the history
  • Loading branch information
teddygroves committed Mar 4, 2024
1 parent 4bc3222 commit c6e9abd
Show file tree
Hide file tree
Showing 7 changed files with 330 additions and 239 deletions.
6 changes: 6 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4731,6 +4731,12 @@
<a href="./week3.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">What to do after MCMC</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./metropolis-hastings.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Metropolis Hastings</span></a>
</div>
</li>
</ul>
</li>
Expand Down
117 changes: 42 additions & 75 deletions docs/metropolis-hastings.html

Large diffs are not rendered by default.

270 changes: 179 additions & 91 deletions docs/search.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions docs/week1.html
Original file line number Diff line number Diff line change
Expand Up @@ -4904,6 +4904,12 @@
<a href="./week3.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">What to do after MCMC</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./metropolis-hastings.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Metropolis Hastings</span></a>
</div>
</li>
</ul>
</li>
Expand Down
6 changes: 6 additions & 0 deletions docs/week2.html
Original file line number Diff line number Diff line change
Expand Up @@ -4904,6 +4904,12 @@
<a href="./week3.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">What to do after MCMC</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./metropolis-hastings.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Metropolis Hastings</span></a>
</div>
</li>
</ul>
</li>
Expand Down
143 changes: 76 additions & 67 deletions docs/week3.html

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions materials/week3.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ idata
```

The function `az.summary` lets us look at some useful summary statistics,
including $\hat{R}$ and divergent transitions.
including $\hat{R}$, divergent transitions and MCSE.

The variable `lp`, which you can find in the group `sample_stats` is the
model's total log probability density. It's not very meaningful on its own,
Expand All @@ -131,23 +131,30 @@ divergent transitions.
az.summary(idata.sample_stats, var_names=["lp", "diverging"])
```

Sometimes it's useful to check the convergence of individual parameters. This
can be done by pointing `az.summary` at the group where the parameters of
interest live. In this case the group is called `posterior`.
Sometimes it's useful to summarise individual parameters. This can be done by
pointing `az.summary` at the group where the parameters of interest live. In
this case the group is called `posterior`.

```{python}
az.summary(idata.posterior, var_names=["sigma", "g"])
```

The function `az.loo` performs approximate leave-one-out cross validation, which can be useful for evaluating how well the model might make predictions.
The function `az.loo` performs approximate leave-one-out cross validation, which
can be useful for evaluating how well the model might make predictions. Watch
out for the `warning` column, which can tell you if the approximation is likely
to be incorrect.

```{python}
az.loo(idata, var_name="y", pointwise=True)
```

The function `az.compare` is useful for comparing different out of sample log
likelihood estimates.

```{python}
idata.log_likelihood["fake"] = xr.DataArray(
# generate some fake log likelihoods
np.random.normal(0, 2, [4, 500, 919]),
coords=idata.log_likelihood.coords,
dims=idata.log_likelihood.dims
Expand All @@ -160,3 +167,5 @@ az.compare(
)
```

az.plot_ppc(j)

0 comments on commit c6e9abd

Please sign in to comment.