how to derive the steps of principal component analysis?
\begin{align}
\frac1N\sum_{i=1}^N Y_{1i}^2 &amp;= \frac1N\sum_{i=1}^N (v_1'z_i)(z_i'v_1)\\
&amp;=v_1'\left(\frac1N \sum_{i=1}^N z_iz_i' \right) v_1 \\
&amp;= v_1'Rv_1
\end{align}

where $R=\frac1N \sum_{i=1}^N z_iz_i'.$