Generalized Canonical Analysis