In more detail, principal component analysis is a method of writing a matrix, such as matrix X, wherein matrix X is comprised of 1 to n columns and 1 to 1 rows, of rank r, where r is the number of variables in matrix X, as a sum of r rank 1 matrices, as follows: