I think I understand what Malinowski is talking about on p. 63. He has no example to illustrate it, and I have to assume that he was a little sloppy: I must assume that the matrix T in eq. 1.136 3.136 is different from the matrix T in eq. 1.134 3.134. I don’t like having to assume that, but the math makes sense this way. This is the best way I have found to reconcile his equations.
I had thought that eq. 1.136 3.136 was a typo, but I no longer think so.
If what I’m about to do is what Malinowski was suggesting, then the credit is his; in any case, the mathematics looks good to me, and if it’s not what he suggested, it is nevertheless my reaction to his work.
the data and its SVD
The cleanest way to make my case is to do a simulation. The following is the data from my example 5. It is of rank 2. In keeping with my latest notation, this is denoted by a “D”, specifically D0 (rather than “X”).
Let me add some noise to it.
Here’s randomly generated and rounded noise…
which i add to D0 to get the final data matrix for this example. In keeping with my latest notation, that data matrix will be called D.
That is what we know, not D0. We can talk about D0 because this is a simulation, but in practice D0 is unknowable: we are trying to estimate it.
Get the Singular Value Decomposition of D, . Here’s w:
Set the 3rd singular value to zero. We are assuming that it is a measurement of the noise – which it is, by design. (There will still be some noise left over.)
We could write either
For w1, we need the cut-down u and v. Because w1 is 2×2, u1 is the first 2 columns of u, v1 is the first 2 columns of v. Then compute the “reconstituted data” , using the cut-down SVD. As usual, it is also true that , using the full SVD with only two singular values. Here is the reconstituted data D1:
The difference between the data D and the reconstituted matrix is…
There is no way in the real world we would know the original matrix D0, but this is a simulation and here’s the difference between D0 and D1:
The u and v computed from D (which has noise) are different from the u and v computed from D0 (which does not have noise); the two largest singular values (w1) are also different: I infer that we cannot eradicate the noise (D vs D0) just by eliminating the smallest singular value. If we could have, D1 would match D0.
In other words, the noise has caused D1 to differ from D0.
For reference, in case you are working along with me, here are the u and v matrices.
the RC decomposition, and Xhat from X
Moving on, do what we’ve done before: here’s and , so D1 = R C:
Now, we test the following two X vectors (i.e. two columns of this X matrix):
You should assume that I tested thousands of other data records looking for likely candidates, and selected these two based on the following calculations.
To get I want the hat matrix, :
I compute the (As I said, in the real world this computation is what selected the columns of X; the computation preceded the construction of X.)
I compute the difference :
OK, they will do: the differences are small. We would have done that calculation for thousands of candidates. Now get for the two candidates we chose.
As before, we can confirm that the product R T
is equal to .
Yhat from Y
Now, i’m going to change notation. Somebody has to do something! We write, as before
all i want to do is change is the name of : call it (instead of ). then we have
Why change notation? Because i’m about to test some vectors y and construct an independent . To put it another way, I desperately need something which is to Y as is to X.
Duh, use . (My first wish is that Malinowski had done this.)
Let (This is the hat matrix for Y; it projects a vector onto the 2D space spanned by the columns of v1. It corresponds neatly to .)
Let two test vectors y be :
NOTE that my two vectors are the rows of Y, whereas my x vectors were the columns of X.
Instead of , we have (because I put the vectors into the rows, and J is symmetric, J^T= J.) here is :
and here is the difference between Y and :
They are very close to the Y, of course. Again, you should assume that i searched high and low and tested hundreds or thousands of potential y vectors before selecting these two; and the computations dictated the selection, in contrast to my selecting first and then computing.)
Let’s look at it the other way: what are the new components of Y? Of Yhat? To get new components, we multiply each vector by the inverse (i.e. transpose) transition matrix, i.e. by . But matrix Y has vectors in rows, so we combine the individual
which makes sense for column vectors into
which makes sense for row vectors making up Y, and this gives us the new components in rows. And just as we used u instead of u1 for this, we use v instead of v1.
The 3rd components are nearly zero, as they should be: the vectors in Y are almost in the 2D subspace spanned by v1.
As further reassurance, we may compute the new components of the :
Yes: their 3rd components are 0.
We need the “T” matrix for these Yhat. FIrst, give it a new name, S. (That’s the second thing I wish Malinowski had done, because I take it to be a different matrix.)
We have the hat matrix J
and the projections
and instead of , we will write
i.e. we compute
I have checked that .
This time we write
(The second reason for using S instead of T is that reverse, inserting instead of .)
And now we use to denote , getting
Maybe i should point out that we inserted inside D1 = RC because ; we insert the reverse inside D1 = RC because .
There is no doubt in my mind that Malinowski suggested replacing by X in the equation
to get a different product which is approximately D or D1:
I showed you that replacement in the previous post.
There is no doubt in my mind that it is equally valid to replace by Y in the equation
to get a different product which is also approximately D or D1:
Then, we could compare the original data matrix D with the two partially reconstructed data matrices and . Each of and combines data (X and Y, respectively) with model ( and , respectively).
I have to say that malinowski does not describe the details of such a comparison between D and, say, .
The only doubt in my mind has nothing to do with my mathematics. What i did is valid, and plausible; but is it what he was recommending? I have to assume that his T in equation 3.133 in not the same T as in equation 3.136. To be specific, where he writes (3.132 and 3.133)
I write instead
All I did was change notation.
But where he writes (3.135 and 3.136)
I write instead
Not only is S not equal to T, but . They’re close – that’s the point of studying their deviations from D: they’re both close to both D1 and D.
We could certainly have defined , but I can’t see how we get anything useful from it. I have to believe that his T in the second pair of equations is a generic symbol, and that we really do have the two distinct computed matrices T and S.
Here are the two matrices:
These are perfectly reasonable things to look at. X is close to and Y is close to ; each of X, Y was chosen because it was close. Replacing by X and by Y is a reasonable way to study the goodness of the model.
We would compute and investigate the differences and . Just to be clear, let me compute, instead, the difference between the two matrices; they are not the same:
sometimes approximate products
Finally, and this is what i think he meant by “the crown jewels of factor analysis” on p. 24, we could compute the product XY. We could also compute the product and the product . I remind you that when he writes on p. 64, he means what I’ve called . He has no symbol for the projection of his data .
What do we know about those products? Well, XY should be close to . But are they related to D or D1?
so (and therefore XY) should be close to RC (hence close to D1 and D) if TS is the identity. By the same token,
so should be close to RC if is close to the identity; that’s equivalent to TS close to the identity.
It’s time to write down all those products and relationships. We have the equalities
and we have approximately
so we could write
The other 3 products are
We have seen that all three of them will be close to D1 if TS is close to the identity. It’s all or nothing for the three musketeers.
Well, let’s just look at them. Here’s XY…
and for comparison, we recall D…
They are not close. Just what is TS?
Not close to the identity. is no closer to D:
Nor is XY:
Note that all of XY, , are quite different from each other, and quite different from D.
Please do not misunderstand me. and are always good things to look at. But XY, , and need not be.
Please do not misunderstand me: they could be. If we had just used a different Y matrix, namely
then everything would have worked out fine. We would have found that ST was very nearly the identity, and that (hence also , and ).
But the proof of the pudding is the product TS, where T comes from the X data and S comes from the Y data, and if they mesh, then they mesh. That is, if TS = I, then they mesh.
I have deliberately computed a case where they did not mesh. I deliberately messed up the Y matrix. I hope to make this failure more memorable than the possibility that they could have meshed.
The key is that any change of scale at all would have left me with a matrix Y which is still close to its projection . If any vector y is close to the 2D subspace, so is any multiple of it. Such closeness by itself only guarantees that XY is close to , but it says nothing about ST close to the identity, hence it says nothing about XY being close to D.
Now, if there were an underlying chemical or physical model such that D ~ XY, and if we chose among such X and Y data, then we might more than hope – we might expect – that things would mesh. The challenge is to get X and Y that go together. In fact, one would hope that simply choosing consistent units would make them go together.
Nevertheless, I’d rather you took a deep sigh of relief if they meshed rather than expect it.
Finally, I really did have X and Y that would have made everything work out peachy. Instead, I scaled the rows of Y, and although I could still get perfectly reasonable independent projections and , they were just that: independent.
As we wind down, I think you should asking: how did I know X and Y? Obviously they weren’t real data.
For that matter, how did I construct D0, so precisely of rank 2? That’s the question. And the answer.
I started with a 5×2 (“column”) matrix
and a 2×3 (“row”) matrix
and i multiplied them together to get D0.
Then later on I took that column matrix for X and a scaling of that row matrix for Y.
Please do not think that we could have reconstructed X and Y. We invented them! In the real world, they are data to be searched out. We can talk about them here because this is a simulation. Remember example 6, and the fact that our X matrix was made up of independent data for o-xylene and p-xylene. In that case, we would need independent data for Y.
If they do not mesh, and if you cannot rescale things or find other data that does mesh, maybe you settle for studying
Of course, if you have only X data, then you study only , and if you have only Y data, then you study only .
Next will be a “summary” of Malinowski, but in fact I expect that it will be more in the nature of “compare and contrast”. Although this example has introduced Y data and its projection , I hope it was also a good review and summary of what we’ve done with Malinowski.