## 3 Demand Forecasting Models and Power Theft Detection Strategy
### ARIMA Model  
Autoregressive integrated moving average (ARIMA) is a time series model designed to predict future points of an event with regard to its historic time series data [27; 28]. The ARIMA model is generally considered with stationary data, wherein an initial differencing is applied several times to nonstationary data to attain a stationary time series. The AR part of ARIMA specifies that the generation variable repeats with respect to its lag values. The MA part of ARIMA specifies that the generation variable repeats with respect to its prior forecast errors obtained continuously. The first part of ARIMA indicates that the data values are restored by the difference value between original value and previous value. The aim of each of these features of ARIMA is to make the model fit the data. The model being used for prediction is an ARIMA model given by ARIMA \((p,d,q)_{s}\), where '\(p\)' denotes the number of autoregressive terms, and '\(d\)' represents number of seasonal differences required for stationarity. The '\(q\)' is the number of lagged forecast errors in the prediction errors, and '\(s\)' is the number of lagged forecast errors in the periods per season (generally 12 in the present case). The structure of ARIMA model is shown in Figure 2.  
The mathematical representations of AR and MA models can be given as a pure Auto Regressive (AR) model, where \(Z_{t}\) is only dependent on its own lag. In an AR model, \(Z_{t}\) is a function of the 'lag components of \(Z_{t}\)'. Hence, the mathematical representation of AR model becomes:  
\[Z_{t}=\alpha+\beta_{1}Z_{t-1}+\beta_{2}Z_{t-2}+\ldots\ldots\beta_{n}Z_{t-n} \in_{t}+\ldots\ldots+\phi_{1}\in_{t-1}+\phi_{2}\in_{t-2}+\ldots+\phi_{n}\in_{t -n} \tag{1}\]  
The architecture of an ARIMA model works on the basis of a time series analysis. Time series analysis (TSA) is a method to determine the futuristic trend of an event with a view  
Figure 2: Architectural view of the ARIMA model. of its past trend. The technique is based on the assumption that the future trend will hold similar to the historical trend. TSA focuses on two aspects, which are the identification of the nature of event (with respect to the series of observations) and the forecasting thereof. Electricity demand forecasting by the utilization of ARIMA model consists of the following steps:  
**Step 1:**: _Collection of dataset_: Forecasting is always triggered by a set of values. **Step 2:**: _Observation of series_: The obtained series of data are plotted, and the pattern of series is observed. The underlying characteristics, such as trend, seasonality, and noise, are identified. Various break points and elevated points of the series are also observed. This is a crucial part of TSA, wherein the data, with respect to its time series, is thoroughly analyzed; various statistical components of the series are discovered. **Step 3:**: _Stationarity_: When the statistical properties of a series, such as mean, variance, autocorrelation, etc., are constant over time, then such a time series is stationary. The augmented Dickey-Fuller (ADF) test is the test for stationarity, where the time series must have a '\(H\)' parameter less than 0.05 to be stationary [28]. **Step 4:**: _Extraction of the optimal model parameters_: This can be done by identifying the Autocorrelation function (ACF) and partial autocorrelation function (PACF) plots. The autocorrelation function is the plot of autocorrelation of a time series by lag; partial autocorrelation is the relationship among the prior time observations of time series. In this step, all the parameters are checked, and the most appropriate models are selected. **Step 5:**: _Fitting Model_: Optimal model parameters are followed by the ARIMA model, which is fit to learn the series pattern. ARIMA(7,1,6) is the prediction model. **Step 6:**: _Prediction_: After fitting the model, the event is predicted. In the present research paper, the predicted test data is obtained and compared with the original dataset.