# Forecasting

### Assembly Line

#### Forecasting Algorithms: A Tool to Optimize Energy Consumption

For example, a client connected to the main grid on a variable energy contract, with a controllable battery and solar panels, must satisfy an electricity demand. The two sources of uncertainty in the future are the electricity demand (load) and the renewable energy production. In order to avoid a black out while minimizing the total electricity cost over the time horizon, we need to forecast them.

We usually forecast both the mean value and a probability distribution. This is so that we can evaluate the level of uncertainty and assess the spectrum of all possible scenarios in the future. For example, rather than saying that the electricity production of solar panels will be 150 kWh tomorrow, it is better to make a prediction of the probability. If we say that there is a probability of 95% that the electricity production will be between 120 kWh and 180 kWh, we can be aware of the extreme values, such as in the case of high or low production.