Recall that we computed the SVD of this matrix:

and we found that the w matrix was

Because w has only two nonzero entries, we know that X is of rank 2. Its three columns only span a 2D space.

Given a column of data x (a variable, in this example, of length 5), Malinowski wants to know if it is in that 2D space. As he puts it, “if the suspected test vector [x] is a real factor, then the regeneration will be successful.” He gives us a formula for computing t; by a successful regeneration, he means that is close to x.

He says that this is how it is done in practice: given a “suspected test vector” x, compute t …, compute R t, and compare R t to x.

We will see that he has some use for t apart from this testing of x. Otherwise, if he doesn’t need t, what he’s doing is unnecessarily complicated. I want to focus on his “regeneration” computation. He says that

.

You might recognize that as the normal equations

of ordinary least squares regression. (You might look at my “math OLS” category.) He counts on this, and says (p. 57) that “A least-squares procedure is employed to generate a transformation vector [t] that will yield a predicted vector… most closely matching [x]….”

(I would argue that’s a little misleading. The predicted vector is restricted to lie in the 2D subspace.)

Instead of

his implicit regression model is

.

The analog of is : his t’s are the ‘s, his xhat is the yhat. In the customary notation, he’s computing yhat and comparing it to a “suspected test vector” y.

In his notation, he wants to compute R t and compare it to x.

Fine, let’s do it. We know enough to label his R t as

. We have

,

so let’s find the matrix

.

I have called it H because it has a name, the **hat matrix**. It is ubiquitous in regression diagnostics. Note that we are working with the R matrix, not with the full X matrix. Boy, does that matter!

we have R ( = u w)…

and

and its inverse…

We really want to observe that is the squared nonzero singular values, w1^2:

(Believe me, we will pursue that later.)

We premultiply by R and post-multiply by , getting

Suppose we now try this on one of the columns of the X matrix. Here’s the first column:

And here’s H applied to it:

He would say, we regenerated the input. I would say, our regression has been perfect. (My suspect was known to lie in the 2D space. because it was a column of X.) Let’s try his favorite suspect in general: all 1’s. Here’s our test vector…

and here’s H applied to it:

Now that’s quite a different outcome. This is not close to x = x2. We did not regenerate the input. This is not a good regression. That vector x2 is not in the 2D subspace, not by a long shot.

His next favorite test is the basis vectors. We could apply H to each of the basis vectors and see what we get. But we know that the images under H of the basis vectors are the columns of H, so what we would get is the columns of H. Let’s do some serious rounding and just see if any of the columns of H look like the appropriate basis vectors. (That is, for example, does the second column look like the second basis vector, i.e. 1 on the diagonal and zero elsewhere?)

I would say not: never mind the diagonals, the columns have either zero or two large entries, instead of one large entry.

In summary, we can compute . But what’s going on? As we see this more clearly, we will discover three things.

- we can make a significant computational simplification.
- we can make a significant conceptual breakthrough.
- we can dispense with the hat matrix H completely.

But all of that depends on having u and , that is, all of it depends on using the SVD in both forms:

We must know that , not just that .

## Leave a Reply