Principles and Algorithms for Forecasting Groups of Time Series: Locality and Globality