# Forecasting Irregular Seasonal Power Consumption.
## 2 Materials and Methods
### Forecasting Methods
#### 2.2.4 State Space Models  
The SSM refers to a form of graphical-probabilistic representation [63] to describe the dependence between an observed measurement and a series of latent state variables through equations called state equations that describe its evolution. Taking into account the fact that a time series can be decomposed into components of level, seasonality and trend, this terminology applied to time series would be understood as the model that interprets the evolution of the relationship of the observed variables (\(y_{t}\)) with the latent unobservable variables (level, trend, and seasonality). SSMs have a great variety of formulations. In this paper, the formulation indicated by [PERSON] [64] and [PERSON] et al. [16] applied to univariate stochastic time series is used. These models are structured through a formulation of two matrix equations, as shown in (10)-(11):  
\[y_{t}=\mu_{t}+\mathbf{r}x_{t-1}+\ \varepsilon_{t}, \tag{10}\]  
\[x_{t}=\mathbf{f}x_{t-1}+\mathbf{g}\varepsilon_{t}. \tag{11}\]  
Equation (11) is known as the state transition equation, and Equation (10) is known as the observation equation. Here \(x_{t-1}\) is known as the vector of states, \(y_{t}\) is the vector of observations, while \(\varepsilon_{t}\) is a vector of Gaussian white noise and is known as the innovation process. \(\mathbf{r},\mathbf{f}\) and \(\mathbf{g}\) are matrices and vectors of coefficients with appropriate dimensions. \(\mathbf{f}\) explains the evolution of \(x_{t}\) and \(\mathbf{g}\) provides the innovation correction of \(\varepsilon_{t}\). The term \(\mu_{t}\) is the one step ahead forecast, and \(\mathbf{r}\) is a term to include the error additively. [PERSON] [18] introduced modified models, based on the exponential smoothing methods, in which a Box-Cox transformation is applied to the data, and the residuals are modeled using an ARMA process and include the damping factor for trend and multiple seasonalities. The acronym for this method is BATS (Box-Cox transform ARMA errors Trend and Seasonal Components). This model is described in (12)-(16). \[y_{t}^{(\lambda)}=l_{t-1}+\varrho b_{t-1}+\sum_{i=1}^{n_{s}}s_{t-s_{i}}^{(i)}+d _{t}, \tag{12}\]  
\[l_{t}=l_{t-1}+\varrho b_{t-1}+\alpha d_{t}, \tag{13}\]  
\[b_{t}=(1-\varrho)b+b_{t-1}+\gamma d_{t}, \tag{14}\]  
\[s_{t}^{(i)}=s_{t-s_{i}}^{(i)}+\delta_{i}d_{t}, \tag{15}\]\[d_{t}=\sum_{i=1}^{p}\varphi_{i}d_{t-i}+\sum_{i=1}^{q}\theta_{i}\varepsilon_{t-i}+ \varepsilon_{t}. \tag{16}\]  
In these equations, \(y_{t}^{(\lambda)}\) indicates the value of the observed data after the Box-Cox transformation with the value \(\lambda\), described in (4). \(l_{t}\), \(b_{t}\) and \(s_{t}^{(i)}\) are the values of the level, trend and seasonalities with smoothing parameters \(\alpha\), \(\gamma\) and \(\delta_{i}\). The subscript \(i\) denotes the seasonality under consideration, of seasonal length \(s_{i}\), and \(n_{s}\) is the number of seasonalities. \(d_{t}\) is an ARMA (\(p\), \(q\)) process with residuals whose coefficients are determined by \(\varphi_{i}\) and \(\theta_{i}\). \(\varrho\) is the damping factor for trend. The term \(b_{t}\) stands for a long-run trend term. \(\varepsilon_{t}\) is a Gaussian white noise process \(N\big{(}0,\sigma^{2}\big{)}\). The nomenclature for BATS includes the following arguments \((\lambda,\varrho,p,q,s_{1},\ldots,s_{n_{s}})\). Additionally, [PERSON] et al. [18] presented the same model but with seasonality based on trigonometric models. The seasonality Equation (16) is replaced by the set of Equations (17)-(20), a seasonal component based on Fourier series. These are known as TBATS (Trigonometric seasonal BATS).