# Novel Data-Driven Models Applied to Short-Term Electric Load Forecasting
## 3 Materials and Methods
### Models Description
It is a data-driven method based on approximating the temporal evolution of the system by a linear transformation given by a matrix \((A)\). The eigenvectors and eigenvalues of this matrix define the dynamic modes of the system and their temporal evolution. The matrix \(A\) that defines the mapping between past ( \(x_{t}\)) and future (\(x_{t+1}\)) snapshots of the system follows Equation (1). This expression can be extended to a complete set of snapshots obtained using the rolling window method presented in Figure 2. The snapshots set can be arranged in a matrix \(X\in\ \mathbb{R}^{p\times N}\), where \(p\) is the length of the snapshots and \(N\) is the number of snapshots obtained with the rolling window process. Likewise, a new matrix \(\hat{X}\) is created by selecting the same columns of \(X\) with a lag, i.e., if \(\hat{X}_{i}\) is the \(i\) column of matrix \(\hat{X}\), then \(\hat{X}_{i}=X_{i+1}\). Once \(X\) and \(\hat{X}\) are defined, we obtain Equations (2) and (3), where \(X^{\dagger}\) is the pseudo inverse of \(X\). The eigenvectors of \(X\) define the dynamic modes of the system. The problem with Equation (3) is that the matrices involved are large and their computation is difficult. The DMD method provides a solution to obtain the eigenvectors of \(A\) by computing the singular value decomposition of \(X\) (Equation (4)) and the matrix \(\bar{A}\) (Equation (5)). The matrix \(\bar{A}\) can be considered as the linear best fit for our original system. The matrix \(\bar{A}\) has a much lower dimensionality than \(A\), which allows us to easily obtain its eigenvalues (\(\Lambda\)) and eigenvectors (\(W\)) (Equation (6)). Finally, the eigenvalues of \(A\) are the same as the eigenvalues of \(\bar{A}\)[3] and the eigenvectors of \(A\) (denoted as \(\Phi\)) can be obtained from the previously obtained elements and computed following Equation (7). \[x_{t+1}=A\ x_{t} \tag{1}\]  
\[\hat{X}=A\ X \tag{2}\]  
\[A=\hat{X}\ X^{\dagger} \tag{3}\]  
\[X=U\Sigma V^{*}\ ;\ \hat{X}=AU\Sigma V^{*} \tag{4}\]  
\[U^{*}\hat{X}\ V\Sigma^{-1}=U^{*}AU=\widetilde{A} \tag{5}\]  
Figure 5: Detail of the deep learning ensemble models used in this work. \[\widetilde{A}W=W\Lambda \tag{6}\]  
Figure 3:0  
The previous presentation of DMD corresponds to a complete deployment of the algorithm. To further reduce computational needs, we can keep just the leading eigenvalues (\(\Lambda\)) and eigenvectors (\(W\)) of \(\widetilde{A}\) while preserving most of the decomposition energy [3,4]. In this way, we reduce the dynamics of the system to its main eigenvalues and its corresponding eigenvectors (\(\Phi\)). In Section 4, we present the main eigenvectors of the DMD decomposition for our data set for different rolling window lengths (\(p\)). DMD allows us to implement forecasts [3,4] using Equation (8), where \(x_{t}\) is a forecast for time t, \(\Lambda^{t}\) is the power t of the diagonal matrix \(\Lambda\), which is easily computed, and \(b_{0}\) is an initial condition obtained by multiplying the inverse of the matrix \(\Phi\) with the initial snapshot (first column) ( \(X_{0}\)) of the matrix \(X\):  
Figure 3:1  
As shown in Section 4, the DMD algorithm is not particularly efficient at forecasting, but it is very useful for identifying the fundamental modes and temporal behavior of a time series. The classic ML models with best combined performance results, considering both the forecasting metrics and execution times, are: linear regression (LR) and random forest (RF) [13]. They are well-known ML models. They are robust, fast and do not require intensive hyperparameter tuning and are good at preventing overfitting. These models are particularly interesting for very short-term forecasts (Section 4). However, they experience problems with large values of the parameters \(p\) and \(f\) that produce large input vectors, since the inputs of these models are the predictors arranged as a flat vector. This has an impact on memory problems and computational times.