@@ -48,15 +48,17 @@ plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
4848
4949## The AR(1) model
5050
51- The * AR(1) model* (autoregressive model of order 1) takes the form
51+ The ** AR(1) model* * (autoregressive model of order 1) takes the form
5252
5353``` {math}
5454:label: can_ar1
5555
5656X_{t+1} = a X_t + b + c W_{t+1}
5757```
5858
59- where $a, b, c$ are scalar-valued parameters.
59+ where $a, b, c$ are scalar-valued parameters
60+
61+ (Equation {eq}` can_ar1 ` is sometimes called a ** stochastic difference equation** .)
6062
6163For example, $X_t$ might be
6264
@@ -88,6 +90,7 @@ Iterating backwards from time $t$, we obtain
8890$$
8991X_t = a X_{t-1} + b + c W_t
9092 = a^2 X_{t-2} + a b + a c W_{t-1} + b + c W_t
93+ = a^3 X_{t-3} + a^2 b + a^2 c W_{t-2} + b + c W_t
9194 = \cdots
9295$$
9396
@@ -200,7 +203,7 @@ Notice that, in the figure above, the sequence $\{ \psi_t \}$ seems to be conver
200203This is even clearer if we project forward further into the future:
201204
202205``` {code-cell} python3
203- def plot_density_seq(ax, mu_0=-3.0, v_0=0.6, sim_length=60 ):
206+ def plot_density_seq(ax, mu_0=-3.0, v_0=0.6, sim_length=40 ):
204207 mu, v = mu_0, v_0
205208 for t in range(sim_length):
206209 mu = a * mu + b
@@ -220,7 +223,7 @@ For example, this alternative density sequence also converges to the same limit.
220223
221224``` {code-cell} python3
222225fig, ax = plt.subplots()
223- plot_density_seq(ax, mu_0=3 .0)
226+ plot_density_seq(ax, mu_0=4 .0)
224227plt.show()
225228```
226229
@@ -255,7 +258,7 @@ We can confirm this is valid for the sequence above using the following code.
255258
256259``` {code-cell} python3
257260fig, ax = plt.subplots()
258- plot_density_seq(ax, mu_0=3 .0)
261+ plot_density_seq(ax, mu_0=4 .0)
259262
260263mu_star = b / (1 - a)
261264std_star = np.sqrt(c**2 / (1 - a**2)) # square root of v_star
0 commit comments