Skip to content

Commit 8033652

Browse files
committed
Add more information on NUTS
1 parent b45dab0 commit 8033652

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lectures/ar1_bayes.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ Unknown parameters are $\rho, \sigma_x$.
107107
108108
We have independent **prior probability distributions** for $\rho, \sigma_x$ and want to compute a posterior probability distribution after observing a sample $\{y_{t}\}_{t=0}^T$.
109109
110-
The notebook uses `pymc4` and `numpyro` to compute a posterior distribution of $\rho, \sigma_x$.
110+
The notebook uses `pymc4` and `numpyro` to compute a posterior distribution of $\rho, \sigma_x$. We will use NUTS samplers to generate samples from the posterior in a chain. Both of these libraries support NUTS samplers.
111111
112+
NUTS is a form of Monte Carlo Markov Chain (MCMC) algorithm that bypasses random walk behaviour and allows for convergence to a target distribution more quickly. This not only has the advantage of speed, but allows for complex models to be fitted without having to employ specialised knowledge regarding the theory underlying those fitting methods.
112113
113114
Thus, we explore consequences of making these alternative assumptions about the distribution of $y_0$:
114115
@@ -191,6 +192,8 @@ with AR1_model:
191192
y_like = pmc.Normal('y_obs', mu=yhat, sigma=sigma, observed=y[1:])
192193
```
193194
195+
[pmc.sample](https://www.pymc.io/projects/docs/en/latest/api/generated/pymc.sample.html?highlight=sample#pymc.sample) by default uses the NUTS samplers to generate samples as shown in the below cell:
196+
194197
```{code-cell} ipython3
195198
:tag: [hide-output]
196199

0 commit comments

Comments
 (0)