# Short Term Electric Load Forecasting Based on Data Transformation and Statistical Machine Learning
## 2 Proposed Methodology
### Load Time Series Formulation and Statistical Analysis  
The time-varying nature of both residential and community electrical load datasets is modeled by deploying smaller auto-regressive data models. An autoregressive model depicts that the output variable depends linearly on its own previous values and on a stochastic term, therefore the model is in the form of a stochastic difference equation. Specifically, an autoregressive model of order \(p\) is defined as in Equation (3):  
\[X_{t}=c+\sum_{i=1}^{p}\phi_{i}+X_{t-1}+e_{t} \tag{3}\]  
Here \(\phi_{i}\) are the parameters of the model, \(c\) is a constant, and \(e_{t}\) is the error, where \(E(e_{t})=0\) and \(Var(e_{t})=\sigma^{2}\).  
The stationarity of the load time series is explored by deploying the unit root test [61]. A linear stochastic process has a unit root, if 1 is a root of the process' characteristic equation. Such a process is non-stationary but does not always have a trend. If the other roots of the characteristic equation lie inside the unit circle--that is, have a modulus (absolute value) less than one--then the first difference of the process will be stationary; otherwise, the process will need to be differentiated multiple times to become stationary. Due to this characteristic, unit root processes are also called difference stationary. Unit root processes may sometimes be confused with trend-stationary processes; while they share many properties, they are different in many aspects. It is possible for a time series to be non-stationary, yet to have no unit root and be trend-stationary. In both unit root and trend-stationary processes, their mean average may be increasing or decreasing over time; however, in the presence of a shock, trend-stationary processes are mean-reverting. The previous discrete-time stochastic process can be rewritten as an autoregressive process of order \(p\):  
\[X_{t}=\alpha_{1}x_{t-1}+\alpha_{2}x_{t-2}+\ldots+\alpha_{p}x_{t-p}+e_{t} \tag{4}\]  
and  
\[E(X_{t}|X_{t-1},\ldots,X_{p})=\sum_{i=1}^{p}\alpha_{i}X_{t-i} \tag{5}\]  
The time series is a serially uncorrelated, zero-mean stochastic process with constant variance \(\sigma^{2}\). If \(m=1\) is a root of the characteristic Equation (6) then the stochastic process has a unit root.  
\[m^{p}-m^{p-1}\alpha_{1}-m^{p-2}\alpha_{2}-\ldots-\alpha_{p}=0 \tag{6}\]  
The stochastic process has a unit root or, alternatively, is 1 st order integrated. If \(m=1\) with a root of multiplicity \(r\), then the stochastic process is \(r_{th}\) integrated, denoted \(I(r)\). There are various tests to check the existence of a unit root. In this paper we use the Augmented Dickey Fuller (ADF) [62] test which is widely used in statistics and econometrics. This analysis tests the null hypothesis that a unit root is present in a time series sample. If the unit root is not present then we cannot determine whether the time series is stationary. The ADF test is suitable for a large and more complicated set of time series models. The ADF index (\(\gamma\)) is a negative number; the more negative it is, the stronger the rejection of the hypothesis of non-stationarity for the observed level of significance is. As can be seen from Table 1, for all datasets the null hypothesis for non-stationarity has been rejected at the 0.01 significance level. Therefore it is quite likely that the electric load measured in all these cases displays the characteristic of trend or differential stationarity. The testing process of the ADF test is similar to the Dickey Fuller test but it is applied to the following model Equation (7).  
\[\Delta x_{t}=\alpha+\beta_{t}+\gamma_{t-1}+\delta\Delta x_{t-1}+\cdots+\delta_ {p-1}\Delta x_{t-p+1}+e_{t} \tag{7}\]