Learning latent causal relationships in multiple time series