Skip to content

Commit 6de7ab1

Browse files
committed
fix typo and add explanation
1 parent 986b445 commit 6de7ab1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lectures/ar1_turningpts.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ def make_ar1(ρ: float, σ: float, y0: float, T0: int = 100, T1: int = 100):
172172
AR1 named tuple containing the specified parameters.
173173
"""
174174
return AR1(ρ=ρ, σ=σ, y0=y0, T0=T0, T1=T1)
175+
```
175176
177+
Using the `AR1` class, we can simulate paths more conveniently. The following function simulates an initial path with $T0$ length.
176178
179+
```{code-cell} ipython3
177180
def AR1_simulate_past(ar1: AR1, key=key):
178181
"""
179182
Simulate a realization of the AR(1) process for T0 periods.
@@ -500,8 +503,8 @@ def draw_from_posterior(data, size=10000, bins=20, dis_plot=1, key=key):
500503
data=plot_data,
501504
compact=True,
502505
lines=[
503-
("σ", {}, ar1.ρ),
504-
("ρ", {}, ar1.σ),
506+
("ρ", {}, ar1.ρ),
507+
("σ", {}, ar1.σ),
505508
],
506509
backend_kwargs={"figsize": (10, 6), "layout": "constrained"},
507510
)

0 commit comments

Comments
 (0)