Calculates correlation between cubes