Three mode factor analysis: an algorithm to simplify the core matrix