# Tag Info

You can also understand the logic from the view of constrained optimisation. Introduce a Lagrange function: $$\mathcal{L} = \text{Tr} (w^{T} X X^{T} w) - \lambda w^{T} w$$ And take the derivative with respect to $w$: $$\frac{\partial \mathcal{L}}{\partial w} = 2 (X X^{T} - \lambda) w$$ For the general case of dimension $\geqslant 1$ $w$ is a set of ...
You might want to have a look at the wikipedia article of PCA, where it says: "The $k$th component can be found by subtracting the first $k − 1$ principal components from $\mathbf{X}$:" $$\hat{\mathbf{X}}_k = \mathbf{X} - \sum_{s=1}^{k-1}\mathbf{X}\mathbf{w}_s\mathbf{w}_s^T$$ Then you repeat the process to find the next component: \mathbf{w}_k = \...