## 5 Discussion
### Granger Causality Test  
Granger causality test [36] is a statistical hypothesis test to determine whether one time series can be used to predict another. It assesses whether past values of one variable can provide information about the future values of another variable, thus indicating a directional influence. The test is based on the idea that if variable \(X\) Granger causes variable \(Y\), then past values of \(X\) should contain information that helps predict \(Y\). Let us consider the case of testing whether time series \(X\) Granger causes time series \(Y\). The models can be formulated as follows:  
1. Unrestricted model (URM): URM includes both the lagged values of \(X\) and \(Y\) to predict \(Y\). \[Y_{t}=\alpha+\beta_{1}Y_{t-1}+\beta_{2}Y_{t-2}+\cdots+\beta_{p}Y_{t-p}+\gamma _{1}X_{t-1}+\gamma_{2}X_{t-2}+\ldots+\gamma_{q}X_{t-q}+\varepsilon_{t}.\] (4)
2. Restricted model (RM): RM includes only the lagged values of \(Y\) to predict \(Y\), excluding the lagged values of \(X\). \[Y_{t}=\alpha+\beta_{1}Y_{t-1}+\beta_{2}Y_{t-2}+\cdots+\beta_{p}Y_{t-p}+ \varepsilon_{t},\] (5)  
The time series \(X\) and \(Y\) must be stationary (mean and variance are constant over time). This can be performed using unit root tests like the Augmented Dickey-Fuller (ADF) test. If the data are not stationary, then they needs to be transformed (e.g., differenced) until stationarity is achieved. We say \(X\) does not Granger cause \(Y\) if the following is true:  
\[E\big{(}Y_{t}\big{|}Y_{t-1},Y_{t-2},\ldots,Y_{t-p},X_{t-1},X_{t-2}\ldots,X_{t- q}\big{)}=E\big{(}Y_{t}\big{|}Y_{t-1},Y_{t-2},\ldots,Y_{t-p}\big{)}.\]  
Thus, the null hypothesis \(H_{0}\) for the Granger causality test is that past values of \(X\) do not Granger-cause \(Y\). This hypothesis implies that the coefficients \(\gamma_{1},\ \gamma_{2},\ldots,\gamma_{q}\) of the lagged values of \(X\) in the URM are jointly equal to zero (\(H_{0}:\ \gamma_{1}=\gamma_{2}=\cdots=\gamma_{q}=0\)). Alternative hypothesis \(H_{A}\): at least one \(\gamma_{i}\
eq 0\). The test statistic is based on the comparison of the sum of squared residuals (SSR) from the unrestricted and restricted models. The F-statistic is then calculated as follows:  
\[F=\frac{\frac{SSR_{RM}-SSR_{URM}}{q}}{\frac{SSR_{URM}}{T-p-q-1}}, \tag{6}\]  
where \(SSR_{RM}\) is the sum of squared residuals from the restricted model; \(SSR_{URM}\) is the sum of squared residuals from the unrestricted model; \(T\) is the number of observations; \(p\) is the number of lags in the model (order of autoregression for \(Y\)); \(q\) is the number of lags in the model (order of autoregression for \(X\)). To select the number of lags \((p,\ q)\) included in models (4) and (5), we will apply a graphical analysis of the autocorrelation function of time series (ACF shows the relationship between the values of the time series at different moments in time) and the partial autocorrelation function of time series (PACF shows the relationship between the values of the time series at different moments of time, excluding the influence of other lags), and also the Akaike Information Criterion (AIC) or the Schwarz criterion (SC), also known as the Bayesian Information Criterion (BIC). The F-statistic follows an F-distribution with degrees of freedom \(q\) in the numerator and \(T-p-q-1\) in the denominator. If the F-statistic is significant at a chosen significance level, the null hypothesis is rejected, indicating that past values of X Granger-cause Y.  
Denote the variable \(Y\) is the volume of gas consumption per month, the variable \(X\) is the natural gas cost of \(1\) m\({}^{3}\). Let us check whether time series \(X\) Granger causes time series \(Y\) using the Granger causality test [39]. At first, we draw the basic time series plots (Figures 5 and 6) of \"the natural gas cost of 1 m\({}^{3}\)\" and \"the volume of gas consumption per month\" for a single consumer of data mentioned above (Table 1) to analyze their relationship and identify seasonal fluctuations and long-term trends.