Canonical correlation for principal components of time series