A Generalization of Principal Component Analysis