Matrix Algebra in regression

34 Views Asked by At

I am trying to if these two regression predictrion equations are equivalent: The input and data is as follows

Let $\mathbf{x}_i=[\mathbf{x}^1_i, ..., \mathbf{x}^p_i]^t$, $\mathbf y$ be of dimension $n \times 1$ and $X$ be $p \times n$ such that

$$X=\begin{bmatrix} \mathbf{x_1} & \mathbf{x_2} & ... & \mathbf{x_n} \end{bmatrix}$$

How is it true that

$$\mathbf{x}^t_{\ast}(XX^t+\sigma^2 I_p)^{-1}X\mathbf{y}=\mathbf{x}_{\ast}^tX(X^tX+\sigma^2I_n)^{-1} \mathbf{y}$$

Note $I_p$ is a $p\times$ identity matrix, similarly for $I_n$ and $\mathbf{x}_{\ast}$ is any new input point.

1

There are 1 best solutions below

0
On

By Woodbury matrix identity, we have \begin{align} & (XX^t + \sigma^2 I_p)^{-1} \\ = & \sigma^{-2}I_p - \sigma^{-2}X(I_n + \sigma^{-2}X^tX)^{-1}X^t\sigma^{-2}. \end{align}

Therefore, \begin{align} & x_*^t(XX^t + \sigma^2 I_p)^{-1}Xy \\ = & \sigma^{-2}x_*^tXy - \sigma^{-4}x_*^tX(I_n + \sigma^{-2}X^tX)^{-1}X^tXy \\ = & \sigma^{-2}x_*^tX(I_n - \sigma^{-2}(I_n + \sigma^{-2}X^tX)^{-1}X^tX)y \tag{1} \end{align}

Now set $A = I_n, U = \sigma^{-2}I_n, V = X^tX, C = I_n$ in the Woodbury identity to get $$I_n - \sigma^{-2}(I_n + \sigma^{-2}X^tX)^{-1}X^tX = (I_n + \sigma^{-2}X^tX)^{-1}. \tag{2}$$

The result then follows by substituting $(2)$ to $(1)$.