问题中显示的所有摘要仅取决于其第二时刻。或者,等价地,在矩阵X ' X。我们正在考虑的X为点云 -每个点是一排X -我们可能会问什么就这几点简单的操作维护的特性X ' X。XX′XXXX′X
一个是左乘由Ñ × Ñ矩阵ü,这会产生另一Ñ × 2矩阵Ú X。为此,至关重要的是Xn×nUn×2UX
X′X=(UX)′UX=X′(U′U)X.
平等是保证当是Ñ × Ñ单位矩阵:即,当Ú是正交。U′Un×nU
RnX
(xi,yi)(xj,yj)ijXRn
{(x′i,y′i)=(cos(θ)xi+sin(θ)xj,cos(θ)yi+sin(θ)yj)(x′j,y′j)=(−sin(θ)xi+cos(θ)xj,−sin(θ)yi+cos(θ)yj).
(xi,xj)(yi,yj)θxyRn(xi,yi)(xj,yj) R2
θ
⎧⎩⎨⎪⎪⎪⎪cos(θ)=±xix2i+x2j√sin(θ)=±xjx2i+x2j√.
x′j=0y′j≥0ijXγ(i,j)
γ(1,2),γ(1,3),…,γ(1,n)XXy2,3,…,nRnn−1X
X=(x′10y′1z),
0zn−1
X′X=((x′1)2x′1y′1x′1y′1(y′1)2+||z||2).
X
X=⎛⎝⎜⎜⎜⎜⎜⎜⎜x′100⋮0y′1||z||0⋮0⎞⎠⎟⎟⎟⎟⎟⎟⎟.
X2×2(x′10y′1||z||)
为了说明这一点,我从双变量正态分布中提取了四个iid点并将其值四舍五入为
X=⎛⎝⎜⎜⎜0.09−0.310.74−1.80.12−0.63−0.23−0.39⎞⎠⎟⎟⎟
下一个图的左侧使用实心黑点显示此初始点云,彩色箭头从原点指向每个点(以帮助我们将它们可视化为矢量)。
γ(1,2),γ(1,3),γ(1,4)yX||z||(x′1,y′1)
X
θ → (cos(θ)x′1,cos(θ)y′1+sin(θ)||z||)(1)
而第二个向量根据
θ → (−sin(θ)x′1,−sin(θ)y′1+cos(θ)||z||).(2)
We may avoid tedious algebra by noting that because this curve is the image of the set of points {(cos(θ),sin(θ)):0≤θ<2π} under the linear transformation determined by
(1,0) → (x′1,0);(0,1) → (y′1,||z||),
it must be an ellipse. (Question 2 has now been fully answered.) Thus there will be four critical values of θ in the parameterization (1), of which two correspond to the ends of the major axis and two correspond to the ends of the minor axis; and it immediately follows that simultaneously (2) gives the ends of the minor axis and major axis, respectively. If we choose such a θ, the corresponding points in the point cloud will be located at the ends of the principal axes, like this:
Because these are orthogonal and are directed along the axes of the ellipse, they correctly depict the principal axes: the PCA solution. That answers Question 1.
The analysis given here complements that of my answer at Bottom to top explanation of the Mahalanobis distance. There, by examining rotations and rescalings in R2, I explained how any point cloud in p=2 dimensions geometrically determines a natural coordinate system for R2. Here, I have shown how it geometrically determines an ellipse which is the image of a circle under a linear transformation. This ellipse is, of course, an isocontour of constant Mahalanobis distance.
Another thing accomplished by this analysis is to display an intimate connection between QR decomposition (of a rectangular matrix) and the Singular Value Decomposition, or SVD. The γ(i,j) are known as Givens rotations. Their composition constitutes the orthogonal, or "Q", part of the QR decomposition. What remained--the reduced form of X--is the upper triangular, or "R" part of the QR decomposition. At the same time, the rotation and rescalings (described as relabelings of the coordinates in the other post) constitute the D⋅V′ part of the SVD, X=UDV′. The rows of U, incidentally, form the point cloud displayed in the last figure of that post.
Finally, the analysis presented here generalizes in obvious ways to the cases p≠2: that is, when there are just one or more than two principal components.