# Is it possible to perform PCA on a multimensional array?

Normally you have a matrix n x p and apply PCA to it. But in the article I'm reading, the author considers that the matrix has points in it. So instead of being n x p, it'd be, say, n x p x 2. He then goes on about finding eigenvectors associated with the points and whatnot.

So, is it possible to use PCA here? All the material I've seen considers it being used with a bidimensional array. I thought about flattening the points so that instead of a three-dimensional array I'd have one with the points' coordinates interleaved, but since the eigenvalues the author talks are associated with the points and not each coordinate, I don't think that'll work.

Another thing is, supposing you're using a color image, you'd have 3 coordinates for each color which results in another three-dimensional array. The tutorials I've seen with PCA for images have use black and white images, avoiding this problem.

-
Look into Multiway PCA, PARAFAC and Tucker-3 decompositions. Most decomposition methods require you to "unfold" your multidimensional matrix before performing PCA. A few years ago I was a talk where it was claimed that it was possible to perform PCA directly on a n-dimensional matrix, but there were something underlying assumptions that had to be made regarding its interpretation. My knowledge in this area is not the most up to date, so someone please correct me if I'm wrong. Also I recommend asking this question on stats.stackexchange.com –  Gilead Feb 7 '11 at 21:10
Look at any linear algebra book advanced enough to mention tensors. You'll see that it all boils down to matrices in the end, so yes, you can do it. As for specifics (implementations and software and whatnot), I'm not sure if this is the Q&A site for you. –  David Roberts Feb 7 '11 at 21:44