Skip to content

Commit 0607678

Browse files
Tom's March 3 edits of svd lecture
1 parent a89215c commit 0607678

File tree

1 file changed

+106
-39
lines changed

1 file changed

+106
-39
lines changed

lectures/svd_intro.md

Lines changed: 106 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -583,65 +583,72 @@ and where the (huge) $m \times m $ matrix $X^{+}$ is the Moore-Penrose generaliz
583583
Think about the singular value decomposition
584584

585585
$$
586-
X = \tilde U \tilde \Sigma \tilde V^T
586+
X = U \Sigma V^T
587587
$$
588588

589-
where $\tilde U$ is $m \times r$, $\tilde \Sigma$ is an $r \times r$ diagonal matrix, and $\tilde V^T$ is an $r \times \tilde n$ matrix.
589+
where $U$ is $m \times p$, $\Sigma$ is a $p \times p$ diagonal matrix, and $ V^T$ is a $p \times \tilde n$ matrix.
590+
591+
Here $p$ is the rank of $X$, where necessarily $p \leq \tilde n$.
590592

591593

592594
We could compute the generalized inverse $X^+$ by using
593595
as
594596

595597
$$
596-
X^{+} = \tilde V \tilde \Sigma^{-1} \tilde U^T
598+
X^{+} = V \Sigma^{-1} U^T
597599
$$
598600

599-
where the matrix $\tilde \Sigma^{-1}$ is constructed by replacing each non-zero element of $\tilde \Sigma$ with $\sigma_j^{-1}$.
601+
where the matrix $\Sigma^{-1}$ is constructed by replacing each non-zero element of $ \Sigma$ with $\sigma_j^{-1}$.
600602

601603
The idea behind **dynamic mode decomposition** is to construct an approximation that
602604

603605
* sidesteps computing the generalized inverse $X^{+}$
604606

605-
* retains only the largest $\tilde r< < r$ eigenvalues and associated eigenvectors of $\tilde U$ and $\tilde V^T$
606-
607-
* constructs an $m \times \tilde r$ matrix $\Phi$ that captures effects on all $m$ variables of $\tilde r$ dynamic modes that are associated with the $\tilde r$ largest singular values
607+
* constructs an $m \times r$ matrix $\Phi$ that captures effects on all $m$ variables of $r < < p$ dynamic modes that are associated with the $r$ largest singular values
608608

609-
* uses $\Phi$ and powers of $\tilde r$ leading singular values to forecast *future* $X_t$'s
609+
610+
* uses $\Phi$ and powers of $r$ singular values to forecast *future* $X_t$'s
610611

611612
The magic of **dynamic mode decomposition** is that we accomplish this without ever computing the regression coefficients $A = X' X^{+}$.
612613

613614
To construct a DMD, we deploy the following steps:
614615

615616

616-
* As described above, though it would be costly, we could compute $A$ by solving
617+
* As described above, though it would be costly, we could compute an $m \times m$ matrix $A$ by solving
617618

618619
$$
619-
A = X' V \Sigma^{-1} U^T
620+
A = X' V \Sigma^{-1} U^T
620621
$$ (eq:bigAformula)
622+
623+
621624
622625
But we won't do that.
626+
627+
We'll first compute the $r$ largest singular values of $X$.
628+
629+
We'll form matrices $\tilde V, \tilde U$ corresponding to those $r$ singular values.
630+
623631
624-
The matrix $A$ is $m \times m$.
625632
626633
627-
We'll the instead work with a reduced-order system of dimension $\tilde r$ by forming an $\tilde r \times \tilde r$ transition matrix
634+
We'll then construct a reduced-order system of dimension $r$ by forming an $r \times r$ transition matrix
628635
$\tilde A$ defined by
629636
630637
$$
631638
\tilde A = \tilde U^T A \tilde U
632639
$$ (eq:tildeA_1)
633640
634-
The $\tilde A$ matrix governs the dynamics of the $\tilde r \times 1$ vector $\tilde x_t $
641+
The $\tilde A$ matrix governs the dynamics of an $r \times 1$ vector $\tilde X_t $
635642
according to
636643
637644
$$
638-
\tilde x_{t+1} = \tilde A \tilde x_t
645+
\tilde X_{t+1} = \tilde A \tilde X_t
639646
$$
640647
641-
where an approximation to the original $m \times 1$ vector $x_t$ can be acquired from
648+
where an approximation to (i.e., a projection of) the original $m \times 1$ vector $X_t$ can be acquired from inverting
642649
643650
$$
644-
x_t = \tilde U \tilde x_t
651+
X_t = \tilde U \tilde X_t
645652
$$
646653
647654
From equation {eq}`eq:tildeA_1` and {eq}`eq:bigAformula` it follows that
@@ -660,35 +667,108 @@ To construct a DMD, we deploy the following steps:
660667
661668
$$
662669
\tilde A W = W \Lambda
663-
$$
670+
$$ (eq:tildeAeigen)
664671
665-
where $\Lambda$ is a $\tilde r \times \tilde r$ diagonal matrix of eigenvalues and the columns of $W$ are corresponding eigenvectors
666-
of $\tilde A$. Both $\Lambda$ and $W$ are $\tilde r \times \tilde r$ matrices.
672+
where $\Lambda$ is a $r \times r$ diagonal matrix of eigenvalues and the columns of $W$ are corresponding eigenvectors
673+
of $\tilde A$. Both $\Lambda$ and $W$ are $r \times r$ matrices.
667674
668-
* Construct the $m \times \tilde r$ matrix
675+
* Construct the $m \times r$ matrix
669676
670677
$$
671-
\Phi = X' V \Sigma^{-1} W
678+
\Phi = X' \tilde V \tilde \Sigma^{-1} W
672679
$$ (eq:Phiformula)
673680
674681
675682
676-
Let $\Phi^{+}$ be a generalized inverse of $\Phi$; $\Phi^{+}$ is an $\tilde r \times m$ matrix.
683+
We can construct an $r \times m$ matrix generalized inverse $\Phi^{+}$ of $\Phi$.
684+
685+
686+
* We interrupt the flow with a digression at this point
687+
688+
689+
* notice that from formula {eq}`eq:Phiformula`, we have
690+
691+
$$
692+
\begin{aligned}
693+
A \Phi & = (X' \tilde V \tilde \Sigma^{-1} \tilde U^T) (X' \tilde V \tilde \Sigma^{-1} W) \cr
694+
& = X' \tilde V \Sigma^{-1} \tilde A W \cr
695+
& = X' \tilde V \tilde \Sigma^{-1} W \Lambda \cr
696+
& = \Phi \Lambda
697+
\end{aligned}
698+
$$ (eq:APhiLambda)
699+
700+
701+
702+
703+
677704

678705
* Define an initial vector $b$ of dominant modes by
679706

680707
$$
681708
b= \Phi^{+} X_1
709+
$$ (eq:bphieqn)
710+
711+
where evidently $b$ is an $r \times 1$ vector.
712+
713+
(Since it involves smaller matrices, formula {eq}`eq:beqnsmall` below is a computationally more efficient way to compute $b$)
714+
715+
* Then define _projected data_ $\hat X_1$ by
716+
717+
$$
718+
\tilde X_1 = \Phi b
719+
$$ (eq:X1proj)
720+
721+
* It follows that
722+
723+
$$
724+
\tilde U \tilde X_1 = X' \tilde V \tilde \Sigma^{-1} W b
725+
$$
726+
727+
and
728+
729+
$$
730+
\tilde X_1 = \tilde U^T X' \tilde V \tilde \Sigma^{-1} W b
731+
$$
732+
733+
* Recall that $ \tilde A = \tilde U^T X' \tilde V \tilde \Sigma^{-1}$ so that
734+
735+
$$
736+
\tilde X_1 = \tilde A W b
682737
$$
738+
739+
and therefore, by the eigendecomposition {eq}`eq:tildeAeigen` of $\tilde A$, we have
740+
741+
$$
742+
\tilde X_1 = W \Lambda b
743+
$$
744+
745+
* Therefore,
683746
684-
where evidently $b$ is an $\tilde r \times 1$ vector.
747+
$$
748+
b = ( W \Lambda)^{-1} \tilde X_1
749+
$$ (eq:beqnsmall)
750+
751+
which is computationally more efficient than equation {eq}`eq:bphieqn`.
752+
753+
754+
755+
### Putting Things Together
685756
686-
With $\Lambda, \Phi, \Phi^{+}$ in hand, our least-squares fitted dynamics fitted to the $\tilde r$ dominant modes
757+
With $\Lambda, \Phi, \Phi^{+}$ in hand, our least-squares fitted dynamics fitted to the $r$ modes
687758
are governed by
688759
689760
$$
690-
X_{t+1} = \Phi \Lambda \Phi^{+} X_t
761+
X_{t+1} = \Phi \Lambda \Phi^{+} X_t .
762+
$$ (eq:Xdynamicsapprox)
763+
764+
But by virtue of equation {eq}`eq:APhiLambda`, it follows that **if we had kept $r = p$**, this equation would be equivalent with
765+
691766
$$
767+
X_{t+1} = A X_t .
768+
$$ (eq:Xdynamicstrue)
769+
770+
When $r << p $, equation {eq}`eq:Xdynamicsapprox` is an approximation (of reduced order $r$) to the $X$ dynamics in equation
771+
{eq}`eq:Xdynamicstrue`.
692772
693773
694774
Conditional on $X_t$, we construct forecasts $\check X_{t+j} $ of $X_{t+j}, j = 1, 2, \ldots, $ from
@@ -698,25 +778,12 @@ $$
698778
$$
699779
700780
701-
### Useful Connections
702-
703-
From formula {eq}`eq:Phiformula`, notice that
704-
705-
$$
706-
\begin{aligned}
707-
A \Phi & = (X' \tilde V \tilde \Sigma^{-1} \tilde U^T) (X' \tilde V \tilde \Sigma^{-1} W) \cr
708-
& = X' \tilde V \Sigma^{-1} \tilde A W \cr
709-
& = X' \tilde V \tilde \Sigma^{-1} W \Lambda \cr
710-
& = \Phi \Lambda
711-
\end{aligned}
712-
$$
713-
714781
715782
716783
## Reduced-order VAR
717784
718785
DMD is a natural tool for estimating a **reduced order vector autoregression**,
719-
an object that we define in terms of the populations regression equation
786+
an object that we define in terms of the population regression equation
720787
721788
$$
722789
X_{t+1} = \check A X_t + C \epsilon_{t+1}

0 commit comments

Comments
 (0)