# Short-Term Power Forecasting Framework for Microgrids Using Combined Baseline and Regression Models
## 1 Introduction  
During the last few years, the presence of renewable energy generation has increased significantly within power systems [1]. These renewable generators are usually organized as small, mini, or micro power plants, but they are also used as complementary generation devices for consumers. Notably, the increasing presence of renewables marks a large change from a traditional centralized generation system to a distributed system. This trend is based on the distributed generation (DG) paradigm [2]. This paradigm is one of the key points in the smart grid sector [3, 4, 5] and is characterized by better control of all connected resources (including consumers and producers) and other goals [6], coverage of the whole system, and the application of artificial intelligence techniques [7]. In the DG paradigm, active sources are connected directly to the distribution network, permitting them to be nearer to consumption points [8]. These elements are usually called distributed energy resources (DERs). Moreover, the DER concept is not only associated withgeneration systems [9] but also with the coverage of storage [10; 11] and even controllable loads [12; 13]. In this sense, electric vehicles (EVs) can also be considered DERs, adding to the difficulty of being a mobile load [14; 15; 16]. Traditionally, all these DERs have been coordinated by energy management systems (EMSs). Moreover, driven by current regulations [17], there is expected to be a rising tendency toward the close participation of consumers in electricity and flexibility markets through tools such as demand response (DR) services [13]. These markets could include aggregator participation to simplify the management of resources [18]. Based on the aforementioned context, it can be identified that good forecasting of power generation and consumption is essential at various network levels. For example, transmission system operators (TSOs) and distribution system operators (DSOs) use forecasting to perform power system operation tasks [19; 20]. Even the mentioned EMSs in customer installations usually require the forecasting of some power consumption or generation metrics to optimize the use of resources under different criteria. These can be related to energy efficiency in buildings [21] and microgrids [22], environmental and economic improvements [23], or even the control of active and reactive power [24]. Based on this need, a complete framework for the multistep short-term forecasting of electric power consumption and generation is proposed in this paper. Unlike other common approaches found in the existing literature, the proposed framework performs day-ahead forecasting at the start of the day without requiring online training. If online training is used, where the observations from each day are used to update the model [25] (this is also called \"incremental learning\"), the daily computational cost needs to be considered to guarantee the applicability of the method [26]. Regarding the techniques for forecasting models, this framework proposes the use of rule-based baselines or two machine learning techniques; a multi-layer perceptron regressor (MLPR) and a random forest regressor (RFR). The rule-based baseline methods include the proposal and definition of different rules, where the number of previous days to be used can be specified, as well as whether any distinction by day type will be applied. Despite baseline methods being typical and classical prediction methods (some examples can be found in [27; 28; 29]), an important number of variations and specifications are proposed and evaluated here, and these yield the best results. These proposed baseline models have been found to be useful not only as nonblack-box methods but also as possible inputs for machine learning techniques. In this sense, the previously proposed machine learning techniques have been evaluated under different combinations of inputs, identifying which input sets achieve better results.