0
$\begingroup$

In the question: How to derive the ridge regression solution? there is a solution by whuber, which describes how the columns of the augmented matrix approach pairwise orthogonality as the regularization strength increases. However, I am not able to reproduce this argument in the following example. Can someone explain what is incorrect or missing?

Suppose the original design matrix is $$A = \begin{pmatrix}1 & 2 \\ 1 & 2 \end{pmatrix},$$ so $rank(A) = 1.$ Further, suppose the augmented design matrix is $$B = \begin{pmatrix}1 & 2 \\ 1 & 2 \\ \nu & 0 \\ 0 & \nu \end{pmatrix},$$ where $\nu^{2} = \lambda$ is the regularization strength, so $rank(B) = 2.$ Then, the columns of $B$ are linearly independent, whereas the columns of $A$ are linearly dependent.

Now, the inner product is the standard inner product on $\mathbb{R}^{4},$ so we may take the transpose of the first column of $B$ times the second column of $B$ to obtain: $$\begin{pmatrix} 1 & 1 & \nu & 0\end{pmatrix} \begin{pmatrix} 2 \\ 2 \\ 0 \\ \nu \end{pmatrix} = 4.$$ However, this inner product is nonzero, so the columns are not pairwise orthogonal.

$\endgroup$
11
  • $\begingroup$ Hint: when $\nu=10^{20},$ use your favorite statistical computing software to measure the angle between the two columns of $B.$ What is it? $\endgroup$
    – whuber
    Commented Jun 3, 2021 at 21:17
  • $\begingroup$ @whuber An angle of $\frac{\pi}{2}$ is not the same as orthogonal. The latter means a bilinear form vanishes; see en.wikipedia.org/wiki/Orthogonality. However, the normalized dot product is not a bilinear form; see my remarks below Alex's solution. $\endgroup$
    – sunspots
    Commented Jun 4, 2021 at 0:52
  • $\begingroup$ You are confused, because the context is that of approaching a right angle. You therefore need a concept of nearness to orthogonality. That is afforded by the measure of the angle. $\endgroup$
    – whuber
    Commented Jun 4, 2021 at 2:35
  • $\begingroup$ The confusion is your abuse of the word orthogonal. The definition of orthogonal is given in the aforementioned wiki link, and it is clearly in terms of a bilinear form. Instead, one should say the similarity between the columns vanishes with increasing regularization strength; en.wikipedia.org/wiki/Cosine_similarity. $\endgroup$
    – sunspots
    Commented Jun 4, 2021 at 2:44
  • $\begingroup$ Referring only to wikipedia for information about conventional uses of mathematical terms is too limited. In the context in which I originally used the term "orthogonal" its meaning is clear and unambiguous. $\endgroup$
    – whuber
    Commented Jun 4, 2021 at 11:35

2 Answers 2

3
$\begingroup$

Take $A^TA$:

$$A^TA = \begin{pmatrix}1 & 1 \\ 2 & 2 \end{pmatrix}\begin{pmatrix}1 & 2 \\ 1 & 2 \end{pmatrix}=\begin{pmatrix}2 & 4 \\ 4 & 8 \end{pmatrix},$$

and compare with $B^TB$:

$$B^TB = \begin{pmatrix}1 & 2 \\ 1 & 2 \\ \nu & 0 \\ 0 & \nu \end{pmatrix}^T\begin{pmatrix}1 & 2 \\ 1 & 2 \\ \nu & 0 \\ 0 & \nu \end{pmatrix}\\= \begin{pmatrix} 1 & 1 & \nu & 0 \\2 & 2 & 0 & \nu \end{pmatrix}\begin{pmatrix}1 & 2 \\ 1 & 2 \\ \nu & 0 \\ 0 & \nu \end{pmatrix} =\\ \begin{pmatrix}2 + \nu^2 & 4 \\ 4 & 8 + \nu^2 \end{pmatrix} $$

The bigger $\nu$ is, the more $B^TB$ resembles an (scaled) identity matrix.

$\endgroup$
2
  • $\begingroup$ How do the columns of the Gramian matrix $B^{t}B,$ which are elements of $\mathbb{R}^{2},$ relate to the columns of $B,$ which are elements of $\mathbb{R}^{4}?$ $\endgroup$
    – sunspots
    Commented Jun 2, 2021 at 13:16
  • 1
    $\begingroup$ +1. With your calculation in hand, we can even quantify how close $B^\prime B$ comes to a multiple of the identity, because (obviously) $$B^\prime B = \nu^2\left[\pmatrix{1&0\\0&1} + O(\nu^{-2})\right].$$ $\endgroup$
    – whuber
    Commented Jun 3, 2021 at 21:11
2
$\begingroup$

The claim in whuber's answer that the vectors are becoming "more orthogonal" is ambiguous. I would take it to mean that the correlation is getting closer to $0$ as $\nu$ gets bigger. In $A$, the correlation of the columns is $1$. In $B$, the centered correlation is given by $$\frac{-\nu^2/4 - 3\nu/2 + 2}{\sqrt{(3\nu^2 / 4 - \nu + 1)(3\nu^2/4 - 2\nu + 4)}},$$ which approaches $-1/3$ from below as $\nu \rightarrow \infty$.

Using the definition that the orthogonality of columns $c_1, c_2$ is $$\frac{c_1 \cdot c_2}{\sqrt{|c_1|^2 |c_2|^2}},$$ we have that the orthogonality of the columns of $A$ is 1, and the orthogonality of the columns of $B$ is $$\frac{4}{\sqrt{(1^2 + 1^2 + \nu^2)(2^2 + 2^2 + \nu^2)}} = \frac{4}{\sqrt{(2 + \nu^2)(8 + \nu^2)}},$$ which decreases from $1$ to $0$ as $\nu$ increases from $0$ to $\infty$.

$\endgroup$
12
  • $\begingroup$ I'm not sure that I follow, as I would expect a covariance (or correlation) matrix for either $A$ or $B.$ For $A,$ either matrix is in $M_{2 \times 2} (\mathbb{R}),$ and for $B,$ either matrix is in $M_{4 \times 4} (\mathbb{R}).$ $\endgroup$
    – sunspots
    Commented Jun 2, 2021 at 13:08
  • 1
    $\begingroup$ (1) Your calculation cannot possibly be correct for (B), because it is obvious that as $\nu$ grows the other terms can be treated as very small, whence the correlation must approach $0.$ (2) Re "ambiguous:" If orthogonality is not measured in terms of the normalized dot product (or its inverse cosine, which is the angle between the vectors), then what alternative do you have in mind? What measure of orthogonality would not agree with either of these insofar as it establishes a natural amount of orthogonality? $\endgroup$
    – whuber
    Commented Jun 2, 2021 at 13:09
  • 1
    $\begingroup$ @whuber I don't follow, see the solution by user1551 (there is an associated covariance or correlation matrix): math.stackexchange.com/questions/2624760/… $\endgroup$
    – sunspots
    Commented Jun 2, 2021 at 13:18
  • 1
    $\begingroup$ @sunspots The covariance matrix has three independent entries, but the correlation matrix merely contains a correlation coefficient. Since in either case there are only two columns, "$M_{4\times4}(\mathbb{R})$" is not a relevant space. It looks like you might be confusing rows with columns. $\endgroup$
    – whuber
    Commented Jun 2, 2021 at 13:33
  • 1
    $\begingroup$ cor is not the appropriate function to be using for this calculation because it initially centers the vectors before computing the dot products. $\endgroup$
    – whuber
    Commented Jun 2, 2021 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.