A Bayesian-based approach for the short-term forecasting of electrical loads in smart grids. Part I: theoretical aspects