Is this Gram Schmidt?

88 Views Asked by At

Begin with a matrix $\mathbf{X}$ consisting of a time series of $M$ observations of an $N$-dimensional variable, \begin{align} \mathbf{X}=\left[\mathbf{x}(1),\mathbf{x}(2),\dots,\mathbf{x}(N_t)\right]. \end{align} I am interested in removing the variability in $\mathbf{X}$ correlated in time with the $N$-vector $\mathbf{p}$. I can do this in two steps. First, write \begin{align} \mathbf{X}=\mathbf{p}\mathbf{s}^\top+\mathbf{N} \end{align} where $\mathbf{N}$ is a matrix of residuals. The linear regression solution minimizing $\text{tr}(\mathbf{N}\mathbf{N}^\top)$ is \begin{align} \tilde{\mathbf{s}}=\left(\mathbf{p}^\top\mathbf{p}\right)^{-1}\mathbf{X}^\top\mathbf{p} \end{align} Next, to find the pattern $\mathbf{q}$ correlated with time variations in $\mathbf{p}$, we can write \begin{align} \mathbf{X}=\mathbf{q}\tilde{\mathbf{s}}^\top+\mathbf{L} \end{align} which has solution \begin{align} \tilde{\mathbf{q}}&=\left(\tilde{\mathbf{s}}^\top\tilde{\mathbf{s}}\right)^{-1}\mathbf{X}\tilde{\mathbf{s}}\\ &=\left[\left(\left(\mathbf{p}^\top\mathbf{p}\right)^{-1}\mathbf{X}^\top\mathbf{p}\right)^\top\left(\left(\mathbf{p}^\top\mathbf{p}\right)^{-1}\mathbf{X}^\top\mathbf{p}\right)\right]^{-1}\mathbf{X}\left(\mathbf{p}^\top\mathbf{p}\right)^{-1}\mathbf{X}^\top\mathbf{p}\\ &=\left(\mathbf{p}^\top\mathbf{p}\right)^2 \left(\mathbf{p}^\top\mathbf{X}\mathbf{X}^\top\mathbf{p}\right)^{-1}\mathbf{X}\left(\mathbf{p}^\top\mathbf{p}\right)^{-1}\mathbf{X}^\top\mathbf{p}\\ &=\left(\mathbf{p}^\top\mathbf{p}\right) \left(\mathbf{p}^\top\mathbf{X}\mathbf{X}^\top\mathbf{p}\right)^{-1}\mathbf{X}\mathbf{X}^\top\mathbf{p}\\ &=\frac{\mathbf{p}^\top\mathbf{p}}{\mathbf{p}^\top\mathbf{C}\mathbf{p}}\mathbf{C}\mathbf{p} \end{align} where I have defined a covariance matrix \begin{align} \mathbf{C}&=\frac{1}{M-1}\mathbf{X}\mathbf{X}^\top. \end{align} Is this procedure equivalent to Gram-Schmidt? I would like to name it appropriately in the application where I'm using it.