Sarima VS LSTM For Time Series
Sarima VS LSTM For Time Series
Study and analysis of SARIMA and LSTM in forecasting time series data
Ashutosh Kumar Dubey a, Abhishek Kumar a, Vicente García-Díaz b, *, Arpit Kumar Sharma c,
Kishan Kanhaiya d
a
Chitkara University School of Engineering and Technology, Chitkara University, Himachal Pradesh, India
b
Department of Computer Science, University of Oviedo, Oviedo, Spain
c
Department of Computer and Communication Engineering, Manipal University Jaipur, India
d
Netaji Subhas Institute of Technology, Delhi, India
A R T I C L E I N F O A B S T R A C T
Keywords: Energy consumption forecasting is essential for smart grid operations as it facilitates electricity demand man
ARIMA agement and utilities load planning. In this paper data analytics has been presented on the collected smart meter
SARIMA measurement and then predicting the energy consumption on a daily basis using (autoregressive integrated
LSTM
moving average) ARIMA, seasonal ARIMA (SARIMA) and long short-term memory (LSTM). The analysis tends to
Energy consumption
RMSE
understand the different factors which influence energy consumption, and assist operators to make decisions
MASE accordingly. It is helpful in reducing the outage, and enhancing the situational awareness of power consumption
on a daily basis of the smart meters. The relational factors are capable in lowering energy consumption, or rather
contributing to the effective consumption of energy units. The parameters used for the result evaluation are
various features of the weather features relation in terms of power consumption based on temperature, humidity,
cloud cover, visibility, wind speed, UV index and dew point. The results indicate that the energy consumption has
a high positive correlation with humidity and high negative correlation with temperature. (Dew point and UV
index) and (Cloud cover and Visibility Display) have multicollinearity with temperature and humidity respec
tively, so, can be discarded. Pressure and Moon Phase have minimal correlation with energy consumption, so, it
can also be discarded. Wind speed has low correlation with energy, but it does not show multicollinearity. So, it
can be considered for further analysis. Overall LSTM found to be prominent in comparison to ARIMA and
SARIMA with the average mean absolute error (MAE) of 0.23.
* Corresponding author.
E-mail address: [email protected] (V. García-Díaz).
https://doi.org/10.1016/j.seta.2021.101474
Received 25 August 2020; Received in revised form 24 May 2021; Accepted 10 July 2021
Available online 28 July 2021
2213-1388/© 2021 Elsevier Ltd. All rights reserved.
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
seasonality and noise. Level shows the value. The trend shows the considered from Turkey. Integrated module has been considered for this
behaviour. It may be increasing or decreasing. The cycle of behaviour architecture. They have suggested that it has the unique mechanical and
shows the seasonality. Noise shows the unexpected value. It also rep industrial design. In 2019, Olivares-Rojas et al [26] discussed about the
resents the time correlation trends. The major benefits of timeseries data energy sector and data analytics. They have suggested the integration of
are supported grid operation [11], time feature extraction, univariant data analysis processes in the advanced metering infrastructure (AMI).
analysis, impact of forecasting in different timestamps etc. [12–16]. They have presented a novel architecture for smart metering systems. It
The main objectives of this paper are as follows: is based on the edge-fog-cloud computing architecture. It is for the
multi-tier context. The results show feasible solution in case of smart
• To discuss and analyze the potential of machine learning approaches metering systems. In 2019, Van and Poll [27] discussed about the smart
for predicting the daily electrical consumption of smart meter metering infrastructure in terms of functionality and realization. It has
measurement. been discussed in case of the Netherlands. They have discussed the smart
• To assess decision making capability through the computational metering infrastructure in terms of privacy and security concerns. In
measurement in terms of electricity consumption. 2019, Stegner et al. [28] discussed about the standard load profiles
• To assess the energy consumption and their correlation based on (SLPs). They have discussed about the future prospect of the power
weather information, weather cluster and time series analysis and system. They have suggested renewable and distributed energy re
forecasting. sources (DER) are the main sources. In 2019, Junior et al. [29] discussed
• To assess the parametric correlation of temperature, humidity, cloud about the smart meters (SM) data collection. They have considered
cover, visibility, wind speed, UV speed and dew point. electric energy, water gas consumption and power quality (PQ) metrics.
In this context, an edge-fog-cloud architecture based on a low-cost SM is
Literature review proposed. Their proposed approach had embedded at a low-cost SM. In
2019, Tijani and Butler-Purry [30] discussed about advanced metering
In 2017, Mathiyalagan et al. [17] discussed about the electricity infrastructure (AMI). They have presented different approaches for the
consumption reduction. They have discussed about the smart electricity smart meter incorporation. They have considered time series simulation
meters. They have suggested that different analytics can be performed in OpenDSS. They have also investigated photovoltaic distributed gen
on the data generated by smart meters. The parameters suggested are erators impact for the simulation in OpenDSS. In 2019, Vangelista et al.
demand for electricity, time of use and tariff rates. They have used the [31] discussed about the application of the LoRaWAN™ technology. It
integration of Apache Hadoop and R for the time series analysis. They has been discussed for the purpose of metering. They have compared
have used autoregressive integrated moving average (ARIMA) and WM-Bus. They have considered the parameter like battery lifetime and
(autoregressive moving average) ARMA models. The measurements quality of service. Their results show that the LoRaWAN meters out
have been done by Akaike information criterion (AIC) and root mean performs the WMBus meters in terms of battery lifetime. In 2019, Dubey
square error (RMSE). In 2018, do et al. [18] discussed about the possi [32] discussed about sensor network in terms of energy performance
bilities due to smart grids. They have proposed the techniques for the comparison. The performance parameters have been discussed and
energy consumption prediction. Their approach has the capability of analysed. In 2019, Kallman and Frickel [33] discussed the rollout of
energy efficiency calculation. They have presented forecasting tech smart meters in Washington State. They have also discussed the
niques. They have also presented a case study for the proposed solution deployment of smart meters. They have suggested that the nested logics
demonstration. In 2018, Yildiz et al. [19] discussed about smart grid have the constraints and opportunities for the new organizational forms
technologies and about the electricity consumption. They have proposed and behaviors. They have also discussed these in terms of energy
a novel forecast model for the for the electrical loads. For this purpose, research and sustainability policy. In 2019, Suresh et al. [34] discussed
they have used clustering and classification techniques. Their approach about smart meter data. They have suggested that the data generated by
is efficient in performance forecasting and load profiles distribution. In smart meter have been used for the analytics for the electricity demand
2019, Aravind et al. [20] discussed about the smart meter’s roles in prediction. Their aim is to forecasting the usage and price of smart meter
smart grid. They have reviewed regarding the monitoring and prediction data analytics. They have used particle swarm optimization and k-means
system in terms of control utilization. They have mainly focused, smart algorithm for this purpose. In 2019, Sirojan et al. [35] discussed about
metering and home apparatus. In 2019, Bhanse et al. [21] discussed the electrical energy consumption patterns and measurements. They
about the smart distributed electric power transmission system. They have demonstrated the embedded edge computing paradigm suitability.
have designed a secure authentication scheme. It has been designed They have also worked in the direction to overcome the limitations of
based on the verifiable random function (VRF). It has been used for smart meters. They have also explored the impact of sampling frequency
deployment of the AMI. It uses elliptic curve cryptography (ECC). Their and digitization resolution in the smart meter data analytics. For the
approach has been found secure based on the comparison. In 2019, experimentation they have used National Instruments (NI) embedded
Hmielowski et al. [22] discussed about the electrical system efficiency. hardware. In 2020, Pesantez et al. [36] discussed about the water de
They have examined the smart meter technologies. They have also mand forecasting. For this purpose, they have used random forests (RFs),
examined the demographic variables. They have considered a sample of artificial neural networks (ANNs), and support vector regression (SVR).
1035 people from the USA country for the experimentation purpose. Their result shows that the RF and ANN perform better than SVR in all
Their results show that the correlation between people’s perceptions and cases considered. In 2020, Wang et al. [37] discussed about the energy
experiences. In 2019, England and Alouani [23] discussed about the system involvement in terms of running costs associated with oversizing.
control infrastructure and measurement. They have proposed an They have considered residential energy consumption in the UK analysis
internet based multiple load-single smart meter and control (MLSSMC) from the smart meter data. In 2020, Gope [38] discussed about the
infrastructure. It has the capability of monitoring and controlling mul advanced metering infrastructure (AMI). They have proposed an effi
tiple separate loads. The billing and data analysis are automatic through cient privacy-aware multi-factor authenticated key establishment
internet platforms. It is found to be prominent with existing single load scheme (PMAKE) for this purpose. Their scheme is efficient in the
high end smart meters. In 2019, Avancini and Rodrigues [24] discussed physical security of the smart meters. In 2020, Donaldson and Jaya
about intelligent energy networks. They have discussed regarding the weera [39] discussed about the energy via solar photovoltaic (PV) power
challenges for the security-aware smart grid. They have discussed the generation (solar prosumers). They have proposed an approach for the
measurement, control, communication and power synchronization customer identification with PV power generation using net energy
control. In 2019, Mendi et al. [25] demonstrated advanced metering consumption data from smart meters. In 2020, Borovina et al. [40]
infrastructure (AMI) for the electricity distribution networks. It has discussed about the narrow-band power line carrier (PLC) system for
2
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
smart metering error estimation. They have calculated bit error rates Arima and SARIMA
(BER). In 2020, Aerts et al. [41] described about the radiofrequency (RF)
electromagnetic field (EMF) measurements. It has been discussed in Autoregressive integrated moving average (ARIMA) model may be
terms of AMI smart meter infrastructure. In 2020, Roach [42] discussed helpful in time series forecasting. It has been introduced by Box and
about the electricity demand and the management decision making Jenkins in 1976 [51]. It uses the series past values. Accurate forecasting
process. They have presented a mixed effects model. It has been pre is important for cost saving, proper planning and production activities. If
sented in the assessment of building electricity consumption. They have the future value prediction is based on the time series previous values,
considered attribute data for 129 commercial office buildings. The main then it is called univariate time series forecasting. If the series is not used
advantage of his approach is it requires building level demand and for the prediction then it is called multi-variate time series forecasting.
characteristic data. In 2021, Koh et al. [43] proposed a framework for ARIMA is capable to forecast future values based on own past values.
better generalization. It has been achieved without overfitting. The These are lagged and forecast errors lags [52]. There are three main
performance of signal classification was improved due to balanced components of ARIMA. These are p, d, and q. The order of auto
concatenation in the deeper layers. In 2021, Stewart et al. [44] regressive (AR) term is denoted by p. It shows the linear regression
considered the long-term patterns behaviours and contemporary dis model having its own lags and predictors. There is the need of difference
tributions in terms of climate change. They have considered 37 plant (d) to make the predictors independent and so the series may become
species for the experimentation. The variables considered are time-series stationary. It is 0 when the series has been already stationary. The
temperature and precipitation data. Their work is found to be useful in moving average (MA) order has been denoted by q. It shows the number
the context of valuable insights for the plant species understanding in of forecast errors lagged. If p denotes the lags numbers of Y. The Y has
different contemporary distributions for accurate prediction of climate been used as the predictors. Then ARIMA can be shown as the following
change. In 2021, Van et al. [45] discussed about minor deleterious ef with t time series prediction as shown in Eq. (1):
fects in terms of traditional time-series analysis. They have used trial-
Yt = Constant + LY + LFE (1)
masked robust detrending method to prevent potential displacement
effects. It is found to be useful in temporal generalization analysis. In LY: Lags of Y [ It has been extended up to p lags]
2021, Zeng et al. [46] discussed about population mobility in terms of LFE: Lagged forecast errors [It has been extended up to q lags]
COVID-19. For forecasting they have used Poisson count time series The combination used here is a linear combination of lags. So, the
model. Their result shows that the acceptable predictions of COVID-19 main aim is to identify the p, d and q values. The minimum difference
were obtained using social networking. In 2021, Pattanayak et al. [47] d should be selected in order by which the autocorrelation (AC) reaches
proposed a novel probabilistic intuitionistic fuzzy time series forecasting to zero. The p can be determined by the order of the AR. It should be
model. This model was using support vector machine (SVM). They have equal to the lags in the partial autocorrelation (PAC) which crosses the
proposed trend-based discretization to determine the interval numbers limit set significantly. It is also a conditional correlation. Eq. (2) shows
and the universe of discourse. Their model is found to be accurate, the PAC where y is considered as the response variable and the predictor
robust and reliable. From the above literature reviews, it has been found variables are x1, x2 and x3. So, the PAC between y and x3 is shown in Eq.
that the traditional methods mainly focused on univariate data with (2). It is calculated as the correlation between the regression residuals of
temporal dependence. There is also the need of seasonality, trend and y on x1 and x2 with the residuals of x3 on x1 and x2.
scenarios where the dataset adaptation may be variable and increasing
cov(y, x3 |x1 , x2 )
day by day or varied according to the timestamp. So, there is the need PAC = √̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅ (2)
arises of models like SARIMA and LSTM which can be easily clubbed var(y|x1 , x2 )var(x3 |x1 , x2 )
with different learning and decision-based models. So, in terms of time series data, the hth order partial autocorrelation
can be represented as Eq. (3).
Materials and methods
cov(yi , yi− h |yi− 1 , ⋯⋯.., yi− h+1 )
PACforthehthorder = √̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
The dataset considered for this study and experimentation is based var(yi |yi− 1 , ⋯⋯, yi− h+1 )var(yi− h |yi− 1 , ⋯⋯, yi− h+1 )
on the energy consumption readings for a sample of 5,567 London (3)
Households that took part in the UK Power Network Led Low Carbon
The q has been calculated based on the AC. It denotes the error on the
London project between November 2011 to February 2014 [48,49].
lagged forecast. AC can be calculated as the Eq. (4).
ACORN group has been considered for data separation. ACORN is con
∑N− k
sumer classification which segments the population into 62 different (yi − y)(yi+k − y)
types [50]. ACORN is helpful in the consumer characteristics under AC = i=1∑N 2
(4)
i=1 (yi − y)
standing. It is a UK based group. The terminologies are Household id
which is denoted by LCLid, timestamp measurement and the energy y shows the mean of the time series.
consumes (kWh/hh). The number of available households is in peak in k shows the lag. It has been considered for k ≥ 0.
the year 2013. The data collections across household are inconsistent. N shows the complete series value.
So, the energy / household has been used as the target to predict rather If the requirement arises in the time series for the seasonal patterns
than the energy alone. There is also an optional step where energy sum then seasonal term has been added with ARIMA and with seasonal
can be predicted as a whole for each household. ARIMA model becomes (SARIMA). The model can be written as Eq. (5)
The data from the smart meters seem to associate only with the [53,54].
electrical consumption of the households. Moreover, the dataset in ARIMA (p, d, q) × (P, D, Q)S (5)
cludes information on the households in the panel and in which blocks,
half-hourly smart meter measurement, and weather-related information Here (p, d, q) shows the non-seasonal part and (P, D, Q)S shows the
such as temperature, humidity, UV index, visibility, cloud cover, dew seasonal part of the model [53,54]. S shows the period number in a
point and wind speed. season. SARIMA has been used in this paper because ARIMA does not
Sequence of observations can be recorded as the time series data. The support time series with seasonal components and it is used for uni
sequence has been recorded in a regular time interval. The observations variate data containing seasonality and trends.
may be hourly, daily, weekly, monthly, quarterly and annual. Because it So, the following steps have been considered in SARIMA.
is the preparatory step before you develop a forecast of the series [50]. Step 1: If a time series has a varying trend mean over time or sea
sonality it varies at specific timeframes, then it must be converted into
3
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
stationary time series. So, the first step is in the checking for the series which are not relevant. Then the role of input gate is started. In this, the
that it is stationary or not. information is regulated through the sigmoid function and the retained
Step 2: If the time series is not stationary, apply differencing to make information has been fetched. Then, with the help of tanh function a
the time series stationary. Take the first difference and check for sta vector is created. The range of this vector is from − 1 to 1. Then it is
tionary till it stationarized. It should check for the seasonal differencing multiplied to produce the useful information. Then the role of output
as well. So, in the second step differencing mechanism has been applied. gate is started. First, by the help of the tanh function a vector is created.
Step 3: Then validation samples have been created. Then, with the help of sigmoid function the information is regulated and
Step 4: Then AR and MA term have been included based on AC and the retained information has been fetched (Output Squashing). Then
PAC. these values are multiplied to produce the output for the next cell. Adam
Step 5: Then the model is ready for the prediction. optimizer has been used as it is found to be prominent as compared to
Step 6: Validate the model by comparing the predicted values. other stochastic optimization methods. It is found to be useful in
handling sparse and noisy problems [56,57]. It combines the properties
Long short-term memory (LSTM) of AdaGrad and RMSProp [56,57].
Fig. 2 shows the process flowchart of the complete work. It shows the
LSTM is a kind of recurrent neural network (RNN) [54,55]. It has the complete steps of the working mechanism of our approach. Data pre
capability of the earlier stages value remembering. So, the values can be processing has been performed first to remove the missing information
used as the future. and irrelevant data. Then cell state and processing consider the input
LSTM contains four neural network layers and different memory gate output and perform the addition to updates the cell state. It was
blocks called cells. The first neural network layer is sigmoid neural net activated based on 0 and 1 values. Only value with 1 indicator were
layer (0 and 1). The second layer is tanh layer. It shows the cell state. The considered for the further step as the retained value. Model training and
third layer is the language layer to drop the information and finally the testing have been performed for the prediction. Fig. 3 shows the block
output layer. These layers have been discussed in detail with Fig. 1 diagram of the complete procedure. It shows the preprocessing steps
explanation. The cells are helpful in the information retention. Gates is along with the PAC. Then model training has been performed based on
helpful in the manipulations of the memory. Fig. 1 shows the complete ARIMA, SARIMA and LSTM. Final predictions have been made based on
LSTM procedure. Weight matrix shows that it is not updated according weighted average and epochs.
to the time at each step while it is fixed based on the inference. It covers So, the following steps have been considered in LSTM.
the present input along with the past cell status. It has been processed Step 1: Define the LSTM with 50 neurons in the first hidden layer and
through two inputs. First is the current input and the second is the 1 neuron in the output layer for prediction.
previous output in the cell. It has been inputted to the gate for the weight Step 2: Use mean absolute error (MAE) as a loss function and the
matrix multiplication. The sigmoid activation was performed which Adam optimizer which is an extension of stochastic gradient descent.
squishes values between 0 and 1. These values are useful for multipli Step 3: Fit the model for 25 epochs and batch size of 72.
cative factor as 0 is useful for data disappear and 1 is useful to keep the Step 4: Make the prediction and validate.
value same. The information has been removed, which may be not used So, the complete approach can be divided into the following phases:
in the future process. It has been followed by the bias addition. Then it Phase 1: Data collection: Collecting the historical data of energy
has been converted to 0 (forgotten information) and 1 (retained infor consumption of various households.
mation) through the activation process. It can be learned by the Step 2: Data wrangling: After collecting the data, data wrangling is
network. Then cell state and processing came into the picture. It con applied for cleaning and structuring the data.
siders the input gate output and perform the addition to updates the cell Step 3: Exploratory data analysis (EDA): It is an approach to analyze
state (new cell state). The forget gate is used for the information removal the data to summarize its main characteristics using visual methods. It is
4
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
Weight Assignment
• Weight assignment
• Average lags
• Multiplicative weight value
• Duration of the computation during a Quarter
Inspection
• Split ratio
• Epochs
It has been observed from the dataset that the number of households
in which energy data was collected across different days is different. This
could be probably due to the gradually increasing adoption of smart
meters in London, and this could lead to the false interpretation that the
energy for a particular day might be high when it could be that the data
Fig. 2. Process flowchart of the complete work. was only collected from a higher number of houses. The house counts for
each day along with the energy consumption data has been shown in
useful in the trend and correlation analysis. Table 1. Total_Load shows the total energy used in a day. Avg_Energy
Step 4: Feature creation and feature selection: After exploring shows the Total_Load distribution per corresponding household. Table 2
various data features, feature engineering to cater useful information shows the quartile distribution with minimum, median, and maximum
out of the data has been applied. quartile. It shows the complete energy consumption distribution.
Step 5: Machine learning modeling: After feature engineering,
SARIMA and LSTM forecast models have been applied.
Weather information
Results and discussion
Relationship of weather condition with electricity consumption
This section explores the weather features relation in terms of power
In this section, different cases and parameters have been considered
consumption based on temperature, humidity, cloud cover, visibility,
for the result analysis and discussion. The models have been imple
wind speed, UV index and dew point.
mented on Python. The computations were performed on Intel® Core™
1. Temperature
i5–7200 U CPU running at 2.8 GHz with 4 GB RAM. System type is 64-bit
operating system and × 64-based processor.
The parameters considered for the experimentation are as follows: Table 1
General Parameters House counts on day basis and energy consumption data.
Day LCLid Total_Load Avg_Energy
• data size 2011-11-23 13 90.385000 6.952692
• LCLid 2011-11-24 25 213.412000 8.536480
• Day 2011-11-25 32 303.993000 9.499781
2011-11-26 41 420.976000 10.267707
• Total_Load
2011-11-27 41 444.883001 10.850805
• Average_Energy
5
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
Table 2 above it. A positive correlation shows the increase will affect the pre
Energy consumption analysis based on mean, standard deviation, minimum, diction. Negative correlation shows minor effect or it can be discarded.
maximum, 25th percentile, 50th percentile, 75th percentile of the data. For example, the correlation coefficient between average energy and
Measures Total_Load LCLid Avg_Energy dew point has almost negligible correlation and can be discarded. The
Count 829.000000 829.000000 829.000000
correlation coefficient between visibility and uvIndex has positive cor
Mean 43535.325676 4234.539204 10.491862 relation and it should be included for the evaluation. Energy consump
Standard Deviation 20550.594031 1789.994799 1.902513 tion has a high positive correlation with humidity and high negative
Minimum 90.385000 13.000000 0.211766 correlation with temperature. Dew point, UV index displays multi
25% 34665.436003 4084.000000 8.676955
collinearity with temperature, and hence, it has been discarded from
50% 46641.160997 5138.000000 10.516983
75% 59755.616996 5369.000000 12.000690 further analysis. Cloud cover and visibility display multicollinearity
Maximum 84156.135002 5541.000000 15.964434 with humidity, hence discarded. Pressure and moon phase have minimal
correlation with energy consumption, hence discarded. Wind speed has
low correlation with energy, but it does not show multicollinearity. So, it
The temperature and energy consumption plot are shown in Fig. 4. It can be considered for further analysis.
has been observed that the energy and heat have an inverse relationship.
It has been observed based on the peaks that these are appearing with Creating weather clusters
the troughs of the other. It may be possible that the energy consumption The weather information has numerous variables, which might not
may increase through room heater and a geyser like electronic equip be useful. It has been an attempt to generate weather clusters to define
ment. The relationship is non-linear. weather of the day based on the granular weather data like temperature
2. Humidity and humidity etc. The weather clusters have been generated by applying
Humidity and an average consumption of energy show the same k-means and elbow method technique to pick the optimal number of
trend like the temperature. It is shown in Fig. 5. clusters, and visualization for the same. It is shown in Fig. 12. It shows
3. Cloud cover the distribution of different data points based on the range specified. It
The cloud cover also shows the same pattern like the temperature. It shows the distribution as the starting point, intermediate point and end
is shown in Fig. 6. range.
4. Visibility We also extracted UK bank holidays data so that it can be used as a
The visibility factor does not seem to affect energy consumption at forecasting. It creates a holiday indicator (Holiday_ind) (Boolean value i.
all. It is shown in Fig. 7. Since the profile is most likely to be an outdoor e., 0, 1) on weather data. It has been used for the time series analysis and
factor, hence it is unlikely that it increases or decreases the energy forecasting.
consumption within a household.
5. Wind speed Time series analysis and forecasting
Like visibility, wind speed also seems to be an outdoor factor. It is The final data is shown in Table 3. The combination used here is
shown in Fig. 8. It does not affect energy consumption within a linear combination of lags. So, the main aim is to identify the p, d and q
household. values. The minimum difference d should be selected in order by which
6. UV index the AC reaches to zero. The p can be determined by the order of AR. It
UV index has an inverse relationship with energy consumption. It’s should be equal to the lags in the PAC which crosses the limit set
shown in Fig. 9. significantly. It is also a conditional correlation. Fig. 13 shows the AC
7. Dew point graph. It shows the gradual decay. Fig. 14 shows the PAC graph. It in
The dew point is a function of humidity and temperature; therefore, dicates sharp drop after the first lag. This means that most of the higher-
it has the same pattern like the temperature to energy consumption. It is order ACs are adequately explained by k = 1 lag. It has been discussed
shown in Fig. 10. It is a variant of temperature to achieve saturation earlier that AC function is used to measure the correlation between the
point to cool the air with the higher degree of water vapor. time series data with a lagged version of itself but after eliminating the
Then heatmap has been shown in Fig. 11 to show the correlation variations that is already explained by intervening comparison. It is
between weather variables and energy consumption. In this the colour efficient for the measurement of correlation between the time series data
code below 0.0 shows negative value and positive values are shown
6
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
with a lagged version as the weights are same for all timestamps so there observations at the previous cell were not needed to consider again and
is not any variation or minor variations were observed in each timestep again. It reduces the burden of squashing and other complex calculation
so for k time periods the current observation at time t and the in each timestamp. In this paper, SARIMA model has been considered
7
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
first for the daily energy consumption. Table 4 shows the summary of the based on different test results. Ljung-Box (Q) tests the distribution
model used. BIC indicates the Bayesian information criterion. HQIC probability. Heteroskedasticity (H) shows the monitoring of a specific
indicates the Hannan–Quinn information criterion. P shows the auto amount of time for the standard errors. Jarque-Bera (JB) is a goodness-
regression value. The regression coefficient instead of error is shown by of-fit test. Kurtosis is a measure tails difference. The summary of this
z. Table 5 shows the state space model results. Table 6 shows the results model is shown in Table 7. In this paper lags up to 7 days and for hours
8
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
Fig. 11. Correlation heat map of energy consumption with weather variables.
Fig. 12. Weather clusters concerning temperature, humidity and wind speed.
9
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
The lower value of error shows the better fit. Where N is the total
Table 4
number of observations used to build the model. Table 8 shows the error
State space model results, model summary - I.
metrics for the data discussed. It is clear from Table 8 that LSTM per
Dependent Avg_Energy Number of 798 forms better than SARIMA.
vaaibles observations
Mean absolute error (MAE) loss is used for epochs. It shows the error
Model SARIMAX (7,1,1) × Log Likelihood − 649.430 magnitude irrespective of prediction value as shown in Eq. (10).
(1,1,0,12)
Date Tue, 13 Aug 2019 AIC 1326.860
Time 23:31:33 BIC 1392.180
Sample 0 – 798 HQIC 1351.975 Table 6
Covariance Type opg NA NA State space model results, model summary – III.
Ljung-Box (Q) 221.16 Jarque-Bera (JB) 45.24
ai = actual time series Prob(Q) 0.00 Prpb(JB) 0.00
fi = forecast results Heteroskedasticity (H) 0.53 Skew − 0.16
n = number of observations Prob(H) (two sided) 0.00 Kurtosis 4.13
√̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
∑ n
( ŷi − yi )2
RMSE = (7)
i=1
n Table 7
LSTM model Architecture.
ŷi = predictedvalues Layer (type) Output Shape Param #
1∑ n
|fi − ai |
MASE = ∑ ⃒ ⃒ (8) Table 8
n i=1 nj=2 ⃒ai − aj− 1 ⃒
Error metrics.
MASE is beneficial in relative accuracy. MAPE shows the average Metrics SARIMA LSTM
absolute error.
RMSLE 0.06009 0.00101
n ⃒ ⃒ RMSE 0.55065 0.23191
100 ∑ ⃒fi − ai ⃒
MAPE = ⃒ ⃒ (9) MASE 0.58524 0.32456
n i=1 ai ⃒
⃒
MAPE 5.23690 3.22134
Table 5
State space model results, model summary - II.
Coefficient Standard error z P>|z| [0.025] [0.975]
10
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
n ⃒ ⃒
Represents the data point.
1∑ ⃒ ⃒
MAE = ⃒yi − ̂
⃒ y i ⃒⃒ (10)
n i=1
s shows the sample population size.
The split ratio considered for training and testing was 70:30 (A1), Fig. 18 shows the Mean, SD and SEM values for different epochs with
75:25 (A2), 80:20 (A3) and 85:15(A4). A1, A2, A3 and A4 were used as random lags. Fig. 19 shows the Mean, SD and SEM values for different
the shorthand indications for the ratios. The load lags considered here in epochs with random lags. It clearly shows minor deviation with
terms of a single quarter means for 1hrs to 4hrs. It shows the previous increasing epochs (E1 to E10) and after that the values are static. In
load consumption in the specified quarter. In our approach we consid some cases, it shows some of the attributes are more predictive and some
ered lag variations from 1 to 12 because the calculation may be helpful need less attention. An overfitting problem may arise in case of high
in the conversion easily for day, weak and year. The division can be variance and low bias. There are chances that the model may predict
random. It also reduces the error lagged and MA due to the inconsistent differently, but in our case, this is negligible, as several repetitions have
interval. So, in our case the lag values are 1–4 (I1), 1–8(I2), 1–12(I3). I1, been considered along with the consideration of average values. The
I2, I3 and I4 were used as the shorthand indications for the lag values split ratio considered for training and testing here are 70:30 (A1), 75:25
inputs. With each epoch, the errors have been reduced as shown in (A2), 80:20 (A3) and 85:15(A4). The deviation discussed above also
Figs. 15 and 16. It also shows the strength of the LSTM. It is clearly shows that these considered training and testing sets were capable in
observed from Fig. 16 that the average prediction errors in case of prediction and increasing the training set up to a limit may improve the
ARIMA, SARIMA and LSTM decreased if the training set increased but up prediction and decrease the error rates but after some epochs it shows
to some extent and then shows static nature. The reason behind it is the static behavior.
error rates only decreases when the profile match and gain some
knowledge for the modelling. So, there is not any guarantee of the Discussion
performance improvement in case of increasing training set. LSTM is
found to be more prominent with the increasing lags and input data. This paper presented a comparative study and analysis of ARIMA,
Overall LSTM found to be prominent in comparison to ARIMA and SARIMA and LSTM in forecasting time series data. Different cases, pa
SARIMA. It is evident from Fig. 17 that all the models predict spring and rameters and influential factors have been considered for the study and
summer load with the highest accuracy and low error rates. The fore experimentation. The key findings are as follows:
casting error was higher in case of winter and autumn.
Now we have considered Mean, standard deviation (SD) and the 1. Temperature, Humidity, UV index, dew point and cloud cover show
standard error of the mean (SEM) for the variance calculation. It will similar trends. It shows inverse relationship with energy. It may be
validate the variations impact. Mean is the average weight instances by due to increase in energy consumption through some external elec
the total numbers. SD and SEM shows the behavior data distribution and tronic equipment.
characteristics. SD is useful in calculating the accurate dispersion. SEM 2. Visibility and wind speed does not seem to affect energy consump
is helpful in statistical inference. Based on these metrics’ variance can be tion at all. Since the profile is most likely to be an outdoor factor,
calculated for each epoch and lag distribution. The mean, SD, SEM can hence it is unlikely that it increases or decreases the energy con
be calculated as follows (Eqs. (11)–(13)): sumption within a household.
∑
( wi ) 3. The average prediction errors in case of ARIMA, SARIMA and LSTM
mean = (11) decreased if the training set increased but up to some extent and then
n
shows static nature. The error rates only decreases when the profile
√̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
√∑ match according to the knowledge for the modelling. So, there is not
√s
√ (x − x)2
√ any guarantee of the performance improvement in case of increasing
SD = i=1 (12) training set. LSTM is found to be more prominent with the increasing
s− 1
lags and input data.
σ 4. Overall LSTM found to be prominent in comparison to ARIMA and
SEM = √̅̅̅ (13) SARIMA.
n
5. All the models predict spring and summer load with the highest ac
wi is the weight instance. curacy and low error rates. The forecasting error was higher in case
n is the complete numbers.
0.9
0.8
0.7
Average Error Rate
0.6
0.5
ARIMA
0.4
SARIMA
0.3
0.2 LSTM
0.1
0
I1 I2 I3
Models
Fig. 15. MAE comparison based on models.
11
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
0.8
0.7
0.6
0.5
Average Error Rate
0.4
0.3 ARIMA
SARIMA
0.2
LSTM
0.1
0
Spring Summer Autumn Winter
Models
Fig. 18. Mean, SD and SEM values for different epochs with random lags.
12
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
Fig. 19. Mean, SD and SEM values for different epochs with random lags.
of winter and autumn. It may be because of the uniform distribution Declaration of Competing Interest
and more load violations.
6. An overfitting problem may arise in case of high variance and low The authors declare that they have no known competing financial
bias. There are chances that the model may predict differently, but in interests or personal relationships that could have appeared to influence
our case, this is negligible, as several repetitions have been consid the work reported in this paper.
ered along with the consideration of average values.
References
Limitations [1] Jin J, Gubbi J, Marusic S, Palaniswami M. An information framework for creating a
smart city through internet of things. IEEE Internet Things J 2014;1(2):112–21.
[2] Halder, T. A smart grid. In 6th IEEE power india international conference (PIICON)
This experiment can be replicated and enhanced in future by 2014 (pp. 1-6). IEEE.
considering the problem of the smart meters get stopped due to weak [3] Ibrahim Y, Kamel S, Rashad A, Nasrat L, Jurado F. Performance enhancement of
wind farms using tuned SSSC based on artificial neural network. IJIMAI. 2019;5(7):
coverage. In this work, we consider that there is not any issue with the 118–24.
automated collection and the collection may not be affected by the weak [4] Rashed Mohassel R, Fung A, Mohammadi F, Raahemifar K. A survey on advanced
coverage. metering infrastructure. Int J Electr Power Energy Syst 2014;63:473–84.
[5] Nimbargi S, Mhaisne S, Nangare S, Sinha M. Review on AMI technology for smart
meter. In international conference on advances in electronics, communication and
Conclusions computer technology (ICAECCT) 2016 (pp. 21-7). IEEE.
[6] Chakraborty AK, Sharma N. Advanced metering infrastructure: technology and
challenges. In IEEE/PES transmission and distribution conference and exposition
This paper shows the detail study and analysis of SARIMA and LSTM
(T&D) 2016 (pp. 1-5). IEEE.
in forecasting time series data. The practicality and feasibility of [7] Mohammed EA, Mohamed AA, Mitani Y. Genetic-Moth Swarm Algorithm for
implementing the above discussed model are evaluated with the pa Optimal Placement and Capacity of Renewable DG Sources in Distribution Systems.
rameters for the model tuning and pre-processing. It has been done for IJIMAI. 2019;5(7):105–17.
[8] https://www.energy.gov/sites/prod/files/2016/12/f34/AMI%20Summary%
the identification of factors that result in higher consumption of energy 20Report_09-26-16.pdf. Accessed 22 April 2021.
units. The evaluation has been conducted on the feature relevance [9] Rashid MH. AMI smart meter big data analytics for time series of electricity
assessment in real time mode, thus allowing for specific and accurate consumption. In 17th IEEE international conference on trust, security and privacy
in computing and communications/12th IEEE international conference on big data
forecasting of the energy unit requirements. This experiment will science and engineering (TrustCom/BigDataSE) 2018 (pp. 1771-6). IEEE.
contribute to future studies related to response of energy usage planes in [10] Alahakoon D, Yu X. Smart electricity meter data intelligence for future energy
the electricity supply industry, thus resulting in the effective perfor systems: a survey. IEEE Transactions on Industrial Informatics, 12(1):425-36.
[11] Zufferey T, Ulbig A, Koch S, Hug G. Forecasting of smart meter time series based on
mance of smart meters. The study will contribute towards the estab neural networks. In international workshop on data analytics for renewable energy
lishment of accurate predictions and forecasting for the energy unit integration 2016 (pp. 10-21). Springer, Cham.
supply, thus resulting in the accurate identification of consumption [12] Coelho IM, Coelho VN, Luz EJdS, Ochi LS, Guimarães FG, Rios E. A GPU deep
learning metaheuristic based model for time series forecasting. Appl Energy 2017;
trends and optimization of electricity demands, boosting the perfor 201:412–8.
mance of the electricity supply companies. The experimental evaluation [13] Azlan A, Yusof Y, Mohsin MFM. Determining the impact of window length on time
considered various parameters like temperature, humidity, cloud cover, series forecasting using deep learning. International Journal of Advanced
Computer Research. 2019;9(44):260–7.
visibility, wind speed, UV index and dew point. Error rates have been
[14] Said NM, Zin ZM, Ismail MN, Bakar TA. Univariate water consumption time series
calculated based on different metrics along with the MAE loss consid prediction using deep learning in neural network (DLNN). International Journal of
eration. LSTM is found to be more prominent with the increasing lags Advanced Technology and Engineering Exploration. 2021;8(76):473–83.
and input data. It is best in comparison to ARIMA and SARIMA with all [15] Motlagh O, Berry A, O’Neil L. Clustering of residential electricity customers using
load time series. Appl Energy 2019;237:11–24.
the cases. In case of LSTM the average MAE obtained was 0.27 and 0.23 [16] Mehdipour Pirbazari A, Farmanbar M, Chakravorty A, Rong C. Short-term load
respectively in terms of lags and epochs. This work can be extended by forecasting using smart meter data: a generalization analysis. Processes. 2020;8(4):
considering different other computational methodologies along with 484.
[17] Mathiyalagan, P., Shanmugapriya, A., Geethu, A. V. Smart meter data analytics
some real datasets. It can be extended with monthly pattern analysis and using R and Hadoop. In international conference on electro information technology
can be corelated with the seasons for the improvement of accuracy. (EIT) (pp. 623-9). IEEE.
13
A. Kumar Dubey et al. Sustainable Energy Technologies and Assessments 47 (2021) 101474
[18] Do Amaral HL, Maginador JA, Gastaldello DS. Integration of consumption [37] Wang Z, Crawley J, Li FGN, Lowe R. Sizing of district heating systems based on
forecasting in smart meters and smart home management systems. In simposio smart meter data: Quantifying the aggregated domestic energy demand and
brasileiro de sistemas eletricos (SBSE) (pp. 1-6). IEEE. demand diversity in the UK. Energy. 2020;193:116780. https://doi.org/10.1016/j.
[19] Yildiz B, Bilbao JI, Dore J, Sproul A. Household electricity load forecasting using energy.2019.116780.
historical smart meter data with clustering and classification techniques. In [38] Gope P. PMAKE: Privacy-aware multi-factor authenticated key establishment
innovative smart grid technologies-asia (ISGT Asia) (pp. 873-9). IEEE. scheme for advance metering infrastructure in smart grid. Comput Commun 2020;
[20] Aravind VS, Anbarasi MS, Maragathavalli P, Suresh M. Smart electricity meter on 152:338–44.
real time price forecasting and monitoring system. In international conference on [39] Donaldson DL, Jayaweera D. Effective solar prosumer identification using net
system, computation, automation and networking (ICSCAN) (pp. 1-5). IEEE. smart meter data. Int J Electr Power Energy Syst 2020;118:105823. https://doi.
[21] Bhanse P, Mishra B, Jena, D. A novel smart meter authentication scheme for secure org/10.1016/j.ijepes.2020.105823.
smart grid communication. In TENCON 2019-2019 IEEE region 10 conference [40] Borovina D, Zajc M, Mujcic A, Tonello A, Suljanovic N. Error performance analysis
(TENCON) (pp. 1275-9). IEEE. and modeling of narrow-band PLC technology enabling smart metering systems.
[22] Hmielowski JD, Boyd AD, Harvey G, Joo J. The social dimensions of smart meters Int J Electr Power Energy Syst 2020;116:105536. https://doi.org/10.1016/j.
in the United States: Demographics, privacy, and technology readiness. Energy ijepes.2019.105536.
Research & Social Science, 55, 189-197. [41] Aerts S, Van den Bossche M, Vergara X, Odie S, Verloock L, Martens L, et al. Spatial
[23] England BS, Alouani AT. Multiple Loads-Single Smart Meter for Measurement and and temporal assessment of radiofrequency electromagnetic fields emitted by
Control of Smart Grid. In innovative smart grid technologies-asia (ISGT Asia) 2019 smart meters and smart meter banks in urban environments. Environ Res 2020;
(pp. 2440-4). IEEE. 183:109196. https://doi.org/10.1016/j.envres.2020.109196.
[24] Avancini DB, Rodrigues JJPC, Martins SGB, Rabêlo RAL, Al-Muhtadi J, Solic P. [42] Roach C. Estimating electricity impact profiles for building characteristics using
Energy meters evolution in smart grids: a review. J Cleaner Prod 2019;217:702–15. smart meter data and mixed models. Energy Build 2020;211:109686. https://doi.
[25] Mendi YM, Akinc H, Başalan İ, Atlı D, Civelek Y. Design and implementation of org/10.1016/j.enbuild.2019.109686.
smart meters with hybride communication system architecture. In PES innovative [43] Koh BH, Lim CL, Rahimi H, Woo WL, Gao B. Deep temporal convolution network
smart grid technologies europe (ISGT-Europe) 2019 (pp. 1-5). IEEE. for time series classification. Sensors. 2021;21(2):603.
[26] Olivares-Rojas JC, Reyes-Archundia E, Gutiérrez-Gnecchi JA, González- [44] Stewart SB, Elith J, Fedrigo M, Kasel S, Roxburgh SH, Bennett LT, et al. Climate
Murueta JW, Cerda-Jacobo J. A multi-tier architecture for data analytics in smart extreme variables generated using monthly time-series data improve predicted
metering systems. Simul Model Pract Theory 2020;102:102024. https://doi.org/ distributions of plant species. Ecography 2021;44(4):626–39.
10.1016/j.simpat.2019.102024. [45] van Driel J, Olivers CNL, Fahrenfort JJ. High-pass filtering artifacts in multivariate
[27] Van Aubel P, Poll E. Smart metering in the Netherlands: what, how, and why. Int J classification of neural time series data. J Neurosci Methods 2021;352:109080.
Electr Power Energy Syst 2019;109:719–25. https://doi.org/10.1016/j.jneumeth.2021.109080.
[28] Stegner C, Glaß O, Beikircher T. Comparing smart metered, residential power [46] Zeng C, Zhang J, Li Z, Sun X, Olatosi B, Weissman S, et al. Spatial-Temporal
demand with standard load profiles. Sustainable Energy Grids Networks 2019;20: Relationship Between Population Mobility and COVID-19 Outbreaks in South
100248. https://doi.org/10.1016/j.segan.2019.100248. Carolina: Time Series Forecasting Analysis. Journal of medical Internet research.
[29] Rodrigues Junior WL, Borges FAS, Veloso AFdS, Rabêlo RdAL, Rodrigues JJPC. 2021;23(4):e27045. https://doi.org/10.2196/27045.
Low voltage smart meter for monitoring of power quality disturbances applied in [47] Pattanayak RM, Behera HS, Panigrahi S. A novel probabilistic intuitionistic fuzzy
smart grid. Measurement 2019;147:106890. https://doi.org/10.1016/j. set based model for high order fuzzy time series forecasting. Eng Appl Artif Intell
measurement.2019.106890. 2021;99:104136. https://doi.org/10.1016/j.engappai.2020.104136.
[30] Tijani SA, Butler-Purry K. Investigation of approaches for incorporating smart [48] https://www.kaggle.com/jeanmidev/smart-meters-in-london. Accessed 15
meter data in load and PV models in medium voltage power system studies. In September 2019.
texas power and energy conference (TPEC) 2019 (pp. 1-5). IEEE. [49] https://data.london.gov.uk/dataset/smartmeter-energy-use-data-in-london-
[31] Vangelista L, Dell’Anna L, Palazzzoli P. A battery lifetime comparison between households. Accessed 15 September 2019.
LoraWAN and Wireless MBus smart meters. In international black sea conference [50] https://www.machinelearningplus.com/time-series/time-series-analysis-python/.
on communications and networking (BlackSeaCom) 2019 (pp. 1-3). IEEE. Accessed 22 January 2020.
[32] Dubey AK. An efficient variable distance measure k-means [VDMKM] algorithm for [51] Box GE, Jenkins GM, Reinsel GC, Ljung GM. Time series analysis: forecasting and
cluster head selection in WSN. International Journal of Innovative Technology and control. John Wiley & Sons; 2015.
Exploring Engineering. 2019;9(1):87–92. [52] Fathi O. Time series forecasting using a hybrid ARIMA and LSTM model. Velvet
[33] Kallman ME, Frickel S. Nested logics and smart meter adoption: Institutional Consulting 2019.
processes and organizational change in the diffusion of smart meters in the United [53] Chen P, Niu A, Liu D, Jiang W, Ma B. Time series forecasting of temperatures using
States. Energy Res Social Sci 2019;57:101249. https://doi.org/10.1016/j. SARIMA: An example from Nanjing. In IOP conference series: materials science and
erss.2019.101249. engineering 2018 (p. 052024). IOP Publishing.
[34] Suresh M, Anbarasi MS, Jayasre R, Shivani C, Sowmiya P. Smart Meter Data [54] Siami-Namini S, Tavakoli N, Namin AS. A comparison of ARIMA and LSTM in
Analytics Using Particle Swarm Optimization. In international conference on forecasting time series. In international conference on machine learning and
system, computation, automation and networking (ICSCAN) 2019 (pp. 1-5). IEEE. applications (ICMLA) 2018 (pp. 1394-401). IEEE.
[35] Sirojan T, Lu S, Phung BT, Ambikairajah E. Embedded edge computing for real- [55] Patterson J, Gibson A. Deep learning: A practitioner’s approach. ”: O’Reilly Media,
time smart meter data analytics. In international conference on smart energy Inc.“; 2017.
systems and technologies (SEST) 2019 Sep 9 (pp. 1-5). IEEE. [56] Chang Z, Zhang Y, Chen W. Effective Adam-optimized LSTM neural network for
[36] Pesantez JE, Berglund EZ, Kaza N. Smart meters data for modeling and forecasting electricity price forecasting. In2018 IEEE 9th international conference on software
water demand at the user-level. Environ Modell Software 2020;125:104633. engineering and service science (ICSESS) 2018 Nov 23 (pp. 245-248). IEEE.
https://doi.org/10.1016/j.envsoft.2020.104633. [57] Kingma DP, Ba J. Adam: A method for stochastic optimization. arXiv preprint
arXiv:1412.6980. 2014 Dec 22.
14