Wasserstein distances in the analysis of time series and dynamical systems