The canonical decomposition of bivariate distributions