You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lectures/var_dmd.md
+35-23Lines changed: 35 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -262,9 +262,9 @@ $$ (eq:AhatSVDformula)
262
262
263
263
264
264
265
-
We turn to the **tall and skinny** case associated with **Dynamic Mode Decomposition**, the case in which $ m >>n $.
265
+
We turn to the $ m >>n $ **tall and skinny** case associated with **Dynamic Mode Decomposition**.
266
266
267
-
Here an $ m \times n $ data matrix $ \tilde X $ contains many more attributes $ m $ than individuals $ n $.
267
+
Here an $ m \times n+1 $ data matrix $ \tilde X $ contains many more attributes (or variables) $ m $ than time periods $ n+1 $.
268
268
269
269
270
270
Dynamic mode decomposition was introduced by {cite}`schmid2010`,
@@ -502,7 +502,9 @@ $$
502
502
$$ (eq:Ahatwithtildes)
503
503
504
504
505
-
Paralleling a step used to construct Representation 1, define a transition matrix for a rotated $p \times 1$ state $\tilde b_t$ by
505
+
**Computing Dominant Eigenvectors of $\hat A$**
506
+
507
+
We begin by paralleling a step used to construct Representation 1, define a transition matrix for a rotated $p \times 1$ state $\tilde b_t$ by
506
508
507
509
$$
508
510
\tilde A =\tilde U^\top \hat A \tilde U
@@ -521,6 +523,7 @@ $$
521
523
= \tilde U^\top X' \tilde V \tilde \Sigma^{-1} \tilde U^\top
522
524
$$ (eq:tildeAverify)
523
525
526
+
524
527
525
528
526
529
Next, we'll just compute the regression coefficients in a projection of $\hat A$ on $\tilde U$ using a standard least-squares formula
@@ -530,10 +533,12 @@ $$
530
533
\tilde U^\top X' \tilde V \tilde \Sigma^{-1} \tilde U^\top = \tilde A .
531
534
$$
532
535
536
+
Thus, we have verified that $\tilde A$ is a least-squares projection of $\hat A$ onto $\tilde U$.
533
537
538
+
**An Inverse Challenge**
534
539
535
540
536
-
Note that because we are using a reduced SVD, $\tilde U \tilde U^\top \neq I$.
541
+
Because we are using a reduced SVD, $\tilde U \tilde U^\top \neq I$.
537
542
538
543
Consequently,
539
544
@@ -543,14 +548,17 @@ $$
543
548
544
549
so we can't simply recover $\hat A$ from $\tilde A$ and $\tilde U$.
545
550
551
+
**A Blind Alley**
546
552
547
-
Nevertheless, we hope for the best and proceed to construct an eigendecomposition of the
548
-
$p \times p$ matrix $\tilde A$:
553
+
We can start by hoping for the best and proceeding to construct an eigendecomposition of the $p \times p$ matrix $\tilde A$:
549
554
550
555
$$
551
-
\tilde A = \tilde W \Lambda \tilde W^{-1} .
556
+
\tilde A = \tilde W \Lambda \tilde W^{-1}
552
557
$$ (eq:tildeAeigenred)
553
558
559
+
where $\Lambda$ is a diagonal matrix of $p$ eigenvalues and the columns of $\tilde W$
560
+
are corresponding eigenvectors.
561
+
554
562
555
563
Mimicking our procedure in Representation 2, we cross our fingers and compute an $m \times p$ matrix
556
564
@@ -575,7 +583,9 @@ That
575
583
$ \hat A \tilde \Phi_s \neq \tilde \Phi_s \Lambda $ means that, unlike the corresponding situation in Representation 2, columns of $\tilde \Phi_s = \tilde U \tilde W$
576
584
are **not** eigenvectors of $\hat A$ corresponding to eigenvalues on the diagonal of matix $\Lambda$.
577
585
578
-
But in a quest for eigenvectors of $\hat A$ that we **can** compute with a reduced SVD, let's define the $m \times p$ matrix
586
+
**An Approach That Works**
587
+
588
+
Continuing our quest for eigenvectors of $\hat A$ that we **can** compute with a reduced SVD, let's define an $m \times p$ matrix
579
589
$\Phi$ as
580
590
581
591
$$
@@ -584,7 +594,7 @@ $$ (eq:Phiformula)
584
594
585
595
It turns out that columns of $\Phi$ **are** eigenvectors of $\hat A$.
586
596
587
-
This is a consequence of a result established by Tu et al. {cite}`tu_Rowley`, which we now present.
597
+
This is a consequence of a result established by Tu et al. {cite}`tu_Rowley` that we now present.
588
598
589
599
590
600
@@ -603,12 +613,14 @@ $$
603
613
\end{aligned}
604
614
$$
605
615
606
-
Thus, we have deduced that
616
+
so that
607
617
608
618
$$
609
-
\hat A \Phi = \Phi \Lambda
619
+
\hat A \Phi = \Phi \Lambda .
610
620
$$ (eq:APhiLambda)
611
621
622
+
623
+
612
624
Let $\phi_i$ be the $i$th column of $\Phi$ and $\lambda_i$ be the corresponding $i$ eigenvalue of $\tilde A$ from decomposition {eq}`eq:tildeAeigenred`.
613
625
614
626
Equating the $m \times 1$ vectors that appear on the two sides of equation {eq}`eq:APhiLambda` gives
@@ -625,7 +637,7 @@ This concludes the proof.
625
637
Also see {cite}`DDSE_book` (p. 238)
626
638
627
639
628
-
### Decoder of $X$ as a linear projection
640
+
### Decoder of $\check b$ as a linear projection
629
641
630
642
631
643
@@ -639,7 +651,7 @@ $$
639
651
$$ (eq:Aform12)
640
652
641
653
642
-
From formula {eq}`eq:Aform12` we can deduce the reduced dimension dynamics
654
+
From formula {eq}`eq:Aform12` we can deduce dynamics of the $p \times 1$ vector $\check b_t$:
643
655
644
656
$$
645
657
\check b_{t+1} = \Lambda \check b_t
@@ -673,7 +685,7 @@ $$ (eq:Xcheck_)
673
685
674
686
is an $m \times n$ matrix of least squares projections of $X$ on $\Phi$.
675
687
676
-
688
+
**Variance Decomposition of $X$**
677
689
678
690
By virtue of the least-squares projection theory discussed in this quantecon lecture <https://python-advanced.quantecon.org/orth_proj.html>, we can represent $X$ as the sum of the projection $\check X$ of $X$ on $\Phi$ plus a matrix of errors.
There is a useful way to approximate the $p \times 1$ vector $\check b_t$ instead of using formula {eq}`eq:decoder102`.
722
+
We now describe a way to approximate the $p \times 1$ vector $\check b_t$ instead of using formula {eq}`eq:decoder102`.
711
723
712
724
In particular, the following argument adapted from {cite}`DDSE_book` (page 240) provides a computationally efficient way to approximate $\check b_t$.
713
725
714
-
For convenience, we'll do this first for time $t=1$.
726
+
For convenience, we'll apply the method at time $t=1$.
715
727
716
728
717
729
@@ -723,7 +735,7 @@ $$ (eq:X1proj)
723
735
724
736
where $\check b_1$ is a $p \times 1$ vector.
725
737
726
-
Recall from representation 1 above that $X_1 = U \tilde b_1$, where $\tilde b_1$ is a time $1$ basis vector for representation 1 and $U$ is from a full SVD of $X$.
738
+
Recall from representation 1 above that $X_1 = U \tilde b_1$, where $\tilde b_1$ is a time $1$ basis vector for representation 1 and $U$ is from the full SVD $X = U \Sigma V^\top$.
727
739
728
740
It then follows from equation {eq}`eq:Xbcheck` that
729
741
@@ -741,7 +753,7 @@ $$
741
753
$$
742
754
743
755
744
-
Replacing the error term $U^\top \epsilon_1$ by zero, and replacing $U$ from a full SVD of $X$ with $\tilde U$ from a reduced SVD, we obtain an approximation $\hat b_1$ to $\tilde b_1$:
756
+
Replacing the error term $U^\top \epsilon_1$ by zero, and replacing $U$ from a **full** SVD of $X$ with $\tilde U$ from a **reduced** SVD, we obtain an approximation $\hat b_1$ to $\tilde b_1$:
745
757
746
758
747
759
@@ -785,22 +797,22 @@ $$
785
797
$$ (eq:bphieqn)
786
798
787
799
788
-
(To highlight that {eq}`eq:beqnsmall` is an approximation, users of DMD sometimes call components of the basis vector $\check b_t = \Phi^+ X_t $ the **exact** DMD modes.)
800
+
(To highlight that {eq}`eq:beqnsmall` is an approximation, users of DMD sometimes call components of basis vector $\check b_t = \Phi^+ X_t $ the **exact** DMD modes and components of $\hat b_t = ( \tilde W \Lambda)^{-1} \tilde U^\top X_t$ the **approximate** modes.)
789
801
790
-
Conditional on $X_t$, we can compute our decoded $\check X_{t+j}, j = 1, 2, \ldots $ from either
802
+
Conditional on $X_t$, we can compute a decoded $\check X_{t+j}, j = 1, 2, \ldots $ from the exact modes via
791
803
792
804
$$
793
805
\check X_{t+j} = \Phi \Lambda^j \Phi^{+} X_t
794
806
$$ (eq:checkXevoln)
795
807
796
808
797
-
or use the approximation
809
+
or use compute a decoded $\hat X_{t+j}$ from approximate modes via
0 commit comments