Electricity Consumption Forecasting: A Comparative Model Analysis
摘要
The growing global population and technological advancements have significantly increased the demand for electrical energy. In response, strategic electrical energy planning is essential for ensuring the sustainability of future energy consumption. This study aims to compare the Long Short-Term Memory (LSTM) model by evaluating the number of hidden layers and activation functions to improve electricity price predictions based on weather, climate, and energy data from a comprehensive dataset. A quantitative approach was employed, utilizing computational modeling and secondary data from five major cities in Spain, covering electrical energy generation, total load, prices, weather, and environmental factors from 2015 to 2019. The CRISP-DM framework effectively structured the modeling process. The analysis revealed significant patterns in electricity pricing, with prices rising on weekdays and falling on weekends, reflecting typical consumption habits. An intraday pattern was observed, with higher prices during the day and lower prices at night, aligning with standard working hours. A notable decrease in prices occurred during the traditional “siesta” period in Spain, between 13:30 and 16:30. Data cleaning involved removing empty entries and applying interpolation methods for missing values. Dimensionality reduction through Principal Component Analysis (PCA) reduced the features from 75 to 16 while preserving critical information. Statistical tests confirmed the stationarity of the electricity price data. The comparative analysis demonstrated that the Long Short-Term Memory (LSTM) model, with 50 neurons in the hidden layer and ReLU activation, provided highly accurate price predictions, achieving an \({R}^{2}\) of 0.97 and RMSE with 2.27%.