@@ -40,6 +40,9 @@ QuantEcon lecture.
40
40
41
41
(That lecture also describes some technicalities about second-order linear difference equations.)
42
42
43
+ In this lecture, we'll also learn about an ** autoregressive** representation and a ** moving average** representation of a non-stationary
44
+ univariate time series $\{ y_t\} _ {t=0}^T$.
45
+
43
46
We'll also study a "perfect foresight" model of stock prices that involves solving
44
47
a "forward-looking" linear difference equation.
45
48
119
122
where
120
123
121
124
$$
122
- y = \begin{bmatrix} y_1 \cr y_2 \cr \cdots \cr y_T \end{bmatrix}
125
+ y = \begin{bmatrix} y_1 \cr y_2 \cr \vdots \cr y_T \end{bmatrix}
123
126
$$
124
127
125
128
Evidently $y$ can be computed from
@@ -284,13 +287,13 @@ governed by the system
284
287
285
288
$$
286
289
A y = b + u
287
- $$
290
+ $$ (eq:eqar)
288
291
289
292
The solution for $y$ becomes
290
293
291
294
$$
292
295
y = A^{-1} \left(b + u\right)
293
- $$
296
+ $$ (eq:eqma)
294
297
295
298
Let’s try it out in Python.
296
299
@@ -350,6 +353,7 @@ plt.show()
350
353
```
351
354
352
355
356
+
353
357
## Computing Population Moments
354
358
355
359
@@ -449,6 +453,7 @@ my_process = population_moments(
449
453
alpha0=10.0, alpha1=1.53, alpha2=-.9, T=80, y_1=28., y0=24., sigma_u=1)
450
454
451
455
mu_y, Sigma_y = my_process.get_moments()
456
+ A_inv = my_process.A_inv
452
457
```
453
458
454
459
It is enlightening to study the $\mu_y, \Sigma_y$'s implied by various parameter values.
@@ -509,7 +514,6 @@ But just to set the stage for that analysis, let's increase $T$ to 100 and print
509
514
510
515
```{code-cell} ipython3
511
516
my_process = population_moments(alpha0=0, alpha1=.8, alpha2=0, T=100, y_1=0., y0=0., sigma_u=1)
512
-
513
517
mu_y, Sigma_y = my_process.get_moments()
514
518
print("bottom right corner of Sigma_y = \n", Sigma_y[95:,95:])
515
519
```
@@ -525,6 +529,61 @@ There is a lot to be learned about the process by staring at the off diagonal el
525
529
+++
526
530
527
531
532
+ ## Moving Average Representation
533
+
534
+ Let's print out $A^{-1}$ and stare at its structure
535
+
536
+ * is it triangular or almost triangular or $\ldots$ ?
537
+
538
+ To study the structure of $A^{-1}$, we shall print just up to $3$ decimals.
539
+
540
+ Let's begin by printing out just the upper left hand corner of $A^{-1}$
541
+
542
+ ```{code-cell} ipython3
543
+ with np.printoptions(precision=3, suppress=True):
544
+ print(A_inv[0:7,0:7])
545
+ ```
546
+
547
+
548
+
549
+
550
+ Evidently, $A^{-1}$ is a lower triangular matrix.
551
+
552
+
553
+ Let's print out the lower right hand corner of $A^{-1}$ and stare at it.
554
+
555
+ ```{code-cell} ipython3
556
+ with np.printoptions(precision=3, suppress=True):
557
+ print(A_inv[72:,72:])
558
+ ```
559
+
560
+
561
+ Notice how every row ends with the previous row's pre-diagonal entries.
562
+
563
+
564
+
565
+
566
+
567
+ Since $A^{-1}$ is lower triangular, each row represents $ y_t$ for a particular $t$ as the sum of
568
+ - a time-dependent function $A^{-1} b$ of the initial conditions incorporated in $b$, and
569
+ - a weighted sum of current and past values of the IID shocks $\{u_t\}$
570
+
571
+ Thus, let $\tilde{A}=A^{-1}$.
572
+
573
+ Evidently, for $t\geq0$,
574
+
575
+ $$
576
+ y_ {t+1}=\sum_ {i=1}^{t+1}\tilde{A}_ {t+1,i}b_ {i}+\sum_ {i=1}^{t}\tilde{A}_ {t+1,i}u_ {i}+u_ {t+1}
577
+ $$
578
+
579
+ This is a **moving average** representation with time-varying coefficients.
580
+
581
+ Just as system {eq}`eq:eqma` constitutes a
582
+ **moving average** representation for $y$, system {eq}`eq:eqar` constitutes an **autoregressive** representation for $y$.
583
+
584
+
585
+
586
+
528
587
## A Forward Looking Model
529
588
530
589
Samuelson’s model is **backwards looking** in the sense that we give it **initial conditions** and let it
0 commit comments