scieee Open visual document viewer

Short-Term Electricity Demand Forecasting with Machine Learning

Madrid, Ernesto Javier Aguilar

Abstract

An accurate short-term load forecasting (STLF) is one of the most critical inputs for power plant units’ planning commitment. STLF reduces the overall planning uncertainty added by the intermittent production of renewable sources; thus, it helps to minimize the hydro-thermal electricity production costs in a power grid. Although there is some research in the field and even several research applications, there is a continual need to improve forecasts. This project proposes a set of machine learning (ML) models to improve the accuracy of 168 hours forecasts. The developed models employ features from multiple sources, such as historical load, weather, and holidays. Of the five ML models developed and tested in various load profile contexts, the Extreme Gradient Boosting Regressor (XGBoost) algorithm showed the best results, surpassing previous historical weekly predictions based on neural networks. Additionally, because XGBoost models are based on an ensemble of decision trees, it facilitated the model’s interpretation, which provided a relevant additional result, the features’ importance in the forecasting.

Full text

ii                             Sho ‐Te mElec ici yDemandFo ecas ingwi h MachineLea ning E nes oJa ie Aguila Mad id Panamacases udy P ojec Wo kp esen edas hepa ial equi emen  o  ob ainingaMas e 'sdeg eeinDa aScienceandAd anced Analy ics  ii  NOVAIn o ma ionManagemen School Ins i u oSupe io deEs a ís icaeGes ãodeIn o mação Uni e sidadeNo adeLisboa  SHORT‐TERMELECTRICITYDEMANDFORECASTINGWITHMACHINE LEARNING Panamacases udy by E nes oJa ie Aguila Mad id   P ojec Wo kp esen edas hepa ial equi emen  o ob ainingaMas e 'sdeg eeinDa aScience andAd ancedAnaly ics,specializa ioninBusinessAnaly ics    Ad iso :NunoMigueldaConceiçãoAn ónio       Ma ch2021  iii ACKNOWLEDGEMENTS I hank all he people who ha e been in e es ed in his p ojec 's p og ess. I mainly hank my pa en s and sis e o hei suppo ; o my ad iso , p o esso Nuno An onio, o accep ing his p ojec o his aluable ime and guidance. Also, I wan o acknowledge my p o esso s and colleagues who helped me de elop as a pe son and a p o essional h oughou my ca ee . i ABSTRACT An accu a e sho - e m load o ecas ing (STLF) is one o he mos c i ical inpu s o powe plan uni s’ planning commi men . STLF educes he o e all planning unce ain y added by he in e mi en p oduc ion o enewable sou ces; hus, i helps o minimize he hyd o- he mal elec ici y p oduc ion cos s in a powe g id. Al hough he e is some esea ch in he ield and e en se e al esea ch applica ions, he e is a con inual need o imp o e o ecas s. This p ojec p oposes a se o machine lea ning (ML) models o imp o e he accu acy o 168 hou s o ecas s. The de eloped models employ ea u es om mul iple sou ces, such as his o ical load, wea he , and holidays. O he i e ML models de eloped and es ed in a ious load p o ile con ex s, he Ex eme G adien Boos ing Reg esso (XGBoos ) algo i hm showed he bes esul s, su passing p e ious his o ical weekly p edic ions based on neu al ne wo ks. Addi ionally, because XGBoos models a e based on an ensemble o decision ees, i acili a ed he model’s in e p e a ion, which p o ided a ele an addi ional esul , he ea u es’ impo ance in he o ecas ing. KEYWORDS Sho -Te m Load Fo ecas ing; Machine Lea ning; Weekly o ecas ; Elec ici y ma ke ; Ex eme G adien Boos ing Reg esso (XGBoos ) INDEX 1. In oduc ion ................................................................................................................ 10 1.1. Backg ound .......................................................................................................... 10 1.2. P oblem and jus i ica ion .................................................................................... 10 1.3. Objec i es ............................................................................................................ 11 2. Li e a u e e iew ........................................................................................................ 12 2.1. Sho -Te m Load Fo ecas ing .............................................................................. 12 2.2. Fo ecas ing Me hods ........................................................................................... 12 2.2.1. Classical S a is ical Time-Se ies models ....................................................... 12 2.2.2. Machine Lea ning Reg ession models .......................................................... 13 2.2.3. Deep Lea ning models .................................................................................. 16 2.2.4. Combined echniques and o he o ecas ing app oaches ........................... 16 3. Me hodology .............................................................................................................. 18 3.1. Ha dwa e and So wa e ...................................................................................... 18 3.2. Da a sou ces, ex ac ion, and ans o ma ion .................................................... 18 3.3. Da a p e-p ocessing............................................................................................. 19 3.3.1. Missing alues and ou lie s .......................................................................... 19 3.3.2. Fea u e Enginee ing ..................................................................................... 19 3.3.3. Fea u e Selec ion .......................................................................................... 19 3.3.4. Da ase spli in o ain and es da ase s ..................................................... 20 3.4. Modelling ............................................................................................................. 21 3.4.1. Machine Lea ning candida e models ........................................................... 21 3.4.2. Models aining and hype pa ame e uning............................................... 23 3.5. E alua ion me ics ............................................................................................... 25 4. Resul s and discussion ................................................................................................ 26 4.1. Fo ecas Resul s ................................................................................................... 26 4.2. Fea u e Impo ance Resul s ................................................................................ 30 4.3. Hype pa ame e Sea ch Resul s .......................................................................... 31 4.4. Benchma king ...................................................................................................... 34 5. Conclusions ................................................................................................................. 35 6. Limi a ions and ecommenda ions o u u e wo ks ................................................. 36 7. Bibliog aphy ................................................................................................................ 37 8. Appendices ................................................................................................................. 44 8.1. Appendix 1. Da a eposi o y ................................................................................ 44 i 8.2. Appendix 2. Da e- ime spli s ............................................................................... 44 8.3. Appendix 3. Hou ly load illus a ion o each aining- es ing pai .................... 45 8.3.1. Tes ing week 1. Week 15, Ap il 2019. Holy week. ....................................... 45 8.3.2. Tes ing week 2. Week 21, May 2019. .......................................................... 45 8.3.3. Tes ing week 3. Week 24, June 2019. .......................................................... 46 8.3.4. Tes ing week 4. Week 29, July 2019. ........................................................... 46 8.3.5. Tes ing week 5. Week 33, Augus 2019. ...................................................... 47 8.3.6. Tes ing week 6. Week 37, Sep embe 2019. ................................................ 47 8.3.7. Tes ing week 7. Week 41, Oc obe 2019. .................................................... 48 8.3.8. Tes ing week 8. Week 44, No embe 2019. Na ional holidays. .................. 48 8.3.9. Tes ing week 9. Week 51, Decembe 2019. Ch is mas. ............................... 49 8.3.10. Tes ing week 10. Week 1, Janua y 2020. Ma y s Day. ........................ 49 8.3.11. Tes ing week 11. Week 6, Feb ua y 2020. ............................................ 50 8.3.12. Tes ing week 12. Week 10, Ma ch 2020. .............................................. 50 8.3.13. Tes ing week 13. Week 20, May 2020. Qua an ine pe iod. .................. 51 8.3.14. Tes ing week 14. Week 24, Jun 2020. Qua an ine pe iod. ................... 51 ii LIST OF FIGURES Figu e 1. Na ional elec ici y load s. Tempe a u e in Panama Ci y. ....................................... 20 Figu e 2. Hyb id model s uc u e. ............................................................................................ 22 Figu e 3. Sliding window ime-based c oss- alida ion. ............................................................ 23 Figu e 4. Box-whiske plo s o each candida e model and he p e-dispa ch load o ecas . (a) MAPE e alua ion esul s; (b) RMSE e alua ion esul s ............................................................................................. 26 Figu e 5. P e-dispa ch and XGB o ecas compa ison wi h he eal load. (a) Week 51, 2019 (21s o 27 h, Dec 2019); (b) Week 10, 2020 (7 h o 13 h, Ma 2019); (c) Week 24, 2020 (13 h o 19 h, Jun 2019) ....................................................................... 29 Figu e 6. Weekly p e-dispa ch s. ML candida es’ models. (a) Hou ly o ecas o Week 15, 2019 (13 h o 19 h, Ap 2019); (b) F equency dis ibu ion o e o by o ecas , o Week 15, Ap 2019 ......................... 30 iii LIST OF TABLES Table 1. Va iables’ desc ip ion and uni s o measu e .............................................................. 18 Table 2. Hype pa ame e space by model ............................................................................... 24 Table 3. E alua ion me ics ...................................................................................................... 25 Table 4. E o s dis ibu ion by model, by me ic ..................................................................... 27 Table 5. E alua ion me ics by model, o each es ing week, and ho izon a e age .............. 28 Table 6. A e age ea u e impo ance by ML model exp essed in pe cen age ........................ 31 Table 7. Hype pa ame e op imiza ion esul s o egula days’ models, by es ing week .... 32 Table 8. Hype pa ame e op imiza ion esul s o holidays’ models, by es ing week ........... 33 ix LIST OF ABBREVIATIONS AND ACRONYMS ANN A i icial Neu al Ne wo ks ARIMA Au o eg essi e In eg a ed Mo ing A e age CND Cen o Nacional de Despacho; Na ional Dispa ch Cen e DL Deep Lea ning KNN K-Nea es Neighbo s Reg esso L h Elec ici y Load in hou h LMA Lags’ Mo ing A e age LSTM Long Sho -Te m Memo y MAPE Mean Absolu e Pe cen age E o ML Machine Lea ning MLR Mul iple Linea Reg ession MWh Megawa -hou P e-disp. His o ical weekly p e-dispa ch o ecas RF Random Fo es Reg esso RMSE Roo Mean Squa ed E o RNN Recu en Neu al Ne wo ks STLF Sho -Te m Load Fo ecas ing SVR Suppo Vec o Reg esso XGB Ex eme G adien Boos ing Reg esso (XGBoos ) 16 2.2.3. Deep Lea ning models Long Sho -Te m Memo y (LSTM) F om all neu al ne wo k’s app oaches, Recu en Neu al Ne wo ks (RNN) a e aking an impo an place in he STLF ield, especially LSTM, because con a y o s anda d eed o wa d neu al ne wo ks, LSTM has eedback connec ions. Which is bene icial o deal wi h ime-se ies o ecas ing applica ions. Many au ho s a e ecen ly using i because o i s ema kable esul s in ime se ies lea ning asks like he hou ly wea he o ecas , and sola i adia ion (Zou e al., 2019). (Yan e al., 2019) a emp o o ecas he nex 24 hou s load om a sma g id. They compa ed he LSTM esul s wi h a back-p opaga ion ANN and SVR, demons a ing ha LSTM can o e a MAPE o 1.9 % agains 3.3 % om ANN and 4.8 % o SVR. The wo k published by (Abbasimeh e al., 2020) add esses he STLF o a u ni u e company wi h a me hod based on a mul ilaye LSTM and compa e i o o he models like ARIMA, exponen ial smoo hing, k-nea es neighbo s eg esso , and ANN. Mo eo e , hei esul s showed ha LSTM pe o med be e in bo h RMSE and MAPE, ollowed by SVM and ANN. A no ewo hy con ibu ion is published by (A e & El awil, 2020), using Swi ze land load and empe a u e da a. Acco ding o hese esea che s, deep lea ning me hods has a supe io pe o mance in elec ici y STLF, howe e , “ he po en ial o using hese me hods has no ye been ully exploi ed in e ms o he hidden laye s uc u es.” Fo his eason, hey e alua e deep-s acked LSTM wi h mul iple laye s o bo h Unidi ec ional LSTM (Uni-LSTM), Bidi ec ional LSTM (Bi-LSTM), and SVR as a baseline model. Thei esul s showed ha Bi-LSTM MAPE was 0.22% agains MAPE abo e 2% o Uni-LSTM and SVR. 2.2.4. Combined echniques and o he o ecas ing app oaches Because XGB p o ides he ea u e impo ance p ope y, he au ho s o Re e ence (Zheng e al., 2017) p oposed a hyb id algo i hm o classi y simila days wi h K-means clus e ing ed by XGB ea u e impo ance esul s. Once he classi ica ion is done, an empi ical mode me hod is used o decompose simila days’ da a in o se e al in insic mode unc ions o ain sepa a ed long sho - e m memo y (LSTM) models, and inally, a ime-se ies econs uc ion om indi idual LSTM model p edic ions. This hyb id model using LSTM pe o med be e o STLF o e 24 and 168 hou s ho izons, a e compa ing wi h ARIMA, SVR, and back-p opaga ion neu al ne wo k using he same simila day app oach as ini ial inpu . (Xue e al., 2019) p oposed a mul i-s ep-ahead o ecas ing me hodology using XGB and SVR o o ecas hou ly hea load, whe e “di ec ” and “ ecu si e” o ecas ing s a egies a e compa ed. The di ec me hod in ol es an independen model o p edic each pe iod on he o ecas ing ho izon, while he “ ecu si e” me hod conside s a unique model ha i e a es one s ep a a ime o e he o ecas ing ho izon, using he p e ious p edic ed s eps as an inpu a iable o he ollowing o ecas ing s ep. Pe o mance is he main disad an age o he di ec s a egy because i needs o ain as many models as desi ed pe iods o o ecas s. The ecu si e s a egy is sensi i e o p edic ion e o s, meaning ha p edic ion e o s will p opaga e along he o ecas ing ho izon. A s udy o o ecas he 10-day s eam low o a hyd oelec ic dam used a decomposi ion-based me hodology o compa e XGB and SVR (Yu e al., 2020). In his s udy, he s eam low ime-se ies we e 17 decomposed in o se en con iguous equency componen s using he Fou ie T ans o m. Then, each componen was o ecas ed independen ly by he SVR o XGB. The s udy esul s showed ha SVR ou pe o med XGB in e ms o e alua ion c i e ia h ough he Fou ie decomposi ion me hodology. Ano he solu ion joining ANN wi h ensemble app oaches is p esen ed by (Khwaja e al., 2020), whe e he au ho s seek o imp o e ANN gene aliza ion abili y using bagging-boos ing. When aining ensembles o ANNs in pa allel, each ensemble uses a boo s apped sample o he aining da a and consis s o aining he ANNs sequen ially, and his me hod educes he STLF e o bu inc eases he compu a ional ime because o he se e al aining p ocedu es. Al e na i ely, o aining se e al ANN sequen ially, (Singh & Dwi edi, 2018) p opose an e olu iona y no el op imiza ion p ocedu e o uning an ANN. Fo ins ance, a oiding he issues ela ed o ANN uning like o e i ing and selec ing he bes ANN a chi ec u e. Thei esul s achie ed a 4.86% MAPE. Based on he esul s om (F. Liu e al., 2006; Zheng e al., 2017), ANN o STLF can ou pe o m o he o ecas ing me hods i a obus hype pa ame e op imiza ion is pe o med o a oid he issues ela ed o ANN uning. The hyb idiza ion o he successi e geome ic ans o ma ions model (SGTM) neu al-like s uc u e is ano he p omising app oach o STLF, as used by (Vi ynskyi e al., 2018) o p edic Libya’s sola adia ion. This app oach demons a ed a highe accu acy han MLR, SVR, RF, and mul ilaye pe cep on neu al ne wo k, besides ha ing a as e aining ime due o he non-i e a i e aining p ocedu e. 18 3. METHODOLOGY 3.1. HARDWARE AND SOFTWARE This p ojec was de eloped on a compu e wi h an i5-9300H p ocesso and 8 Gigaby es o RAM. Colab (Google, 2020) hos ed Jupy e no ebooks se ice, which p o ides wo CPU and 12 Gigaby es o RAM pe session, and Jupy e Lab no ebook ins ances om Google Cloud Pla o m (GCP, 2021) o mo e ex ensi e execu ions, selec ing he 16 CPU and 64 Gigaby es o RAM con igu a ion. All he expe imen s we e de eloped wi h Py hon (Rossum e al., 2009). 3.2. DATA SOURCES, EXTRACTION, AND TRANSFORMATION All da a sou ces o de elop his p ojec a e publicly a ailable; he da a will conside hou ly eco ds om Janua y 2015 un il June 2020 and a e he ollowing: 1. His o ical elec ici y load om Panama, a ailable on daily pos -dispa ch epo s (CND, 2021c), and his o ical weekly o ecas s a ailable on weekly p e-dispa ch epo s (CND, 2021e). 2. Calenda in o ma ion ela ed o holidays, and school pe iod, p o ided by Panama’s Minis y o Educa ion ough O icial Gaze e (Gace a, 2020) and holidays websi es (When On Ea h?, 2021). 3. Wea he a iables, such as empe a u e, ela i e humidi y, p ecipi a ion, and wind speed om h ee main ci ies in Panama, a e ga he ed om Ea hDa a sa elli e da a (GES DISC, 2015). The load da ase s a e a ailable in Excel iles on a daily and weekly basis, wi h hou ly g anula i y. Holidays and school pe iods da a is spa se, along wi h websi es and PDF iles. These pe iods a e ep esen ed wi h bina y a iables, and da e anges a e manually inpu ed in o Excel iles. Bo h Excel da ase s a e impo ed and con e ed in o da a ames (McKinney & Team, 2020). Wea he da a is a ailable on daily Ne CDF iles, which can be ea ed wi h ne CDF (Nadh, 2021) and xa ay (Hoye & Hamman, 2017) o selec he desi ed a iables and subsequen ly con e hese da ase s in o da a ames. Once all da ase s we e in he same da a ame o ma , hey we e me ged on da e- ime index. Finally, he esul o hese s eps is: a ime-se ies wi h he his o ical o ecas along wi h i s da e- ime imes amp as he index, and a da a ame wi h he same imes amp index and 16 columns, one o each o he ollowing ea u es shown in Table 1. Bo h objec s ha e 48,048 eco ds. Whe e sub-index c s ands o ci y, meaning ha wea he a iables a e a ailable o Da id, San iago, and Panama Ci y. Va iable Desc ip ion Uni o measu e Na ional load Na ional elec ici y load, excluding expo s MWh Holiday Holiday bina y indica o - Holiday ID Holiday iden i ica ion numbe - School School pe iod bina y indica o - Temp. 2mc 2 me e s ai empe a u e ºC Hum. 2mc 2 me e s speci ic humidi y % Wind 2mc 2 me e s wind speed m/s P ecipi a ionc To al p ecipi able liquid wa e l/m2 Load Fo ecas His o ical na ional load o ecas , excluding expo s MWh Table 1. Va iables’ desc ip ion and uni s o measu e. 19 3.3. DATA PRE-PROCESSING 3.3.1. Missing alues and ou lie s The e a e no missing alues on he da ase s, and an ini ial ou lie ’s e ision was made by no malizing each a iable. Only a ew low alues on he load we e de ec ed due o hou ly blackou s and damages in he powe g id, bu all eco ds we e kep . 3.3.2. Fea u e Enginee ing The se o a iables used o ain he ML models, also called ea u es, a e ea ed in his sec ion. New a iables ela ed o he da e- ime index a e c ea ed o eed he ML models wi h his ex a in o ma ion abou ime, wi h his being one o he mos c i ical s eps o STLF (X. Liu e al., 2020; Zhang e al., 2019). The new ea u es added o he da ase s a e yea , mon h numbe , day o he mon h, week o he yea , day o he week, he hou o he day, he hou o he week, weekend indica o . All being in ege a iables, excep o he bina y weekend indica o . I is essen ial o cla i y ha Sa u day is conside ed he i s day o he week. Fo ins ance, he i s week o each yea is he i s comple e week s a ing on Sa u day, and his is espec ed o keep he CND epo s calenda s uc u e o u he compa isons. Load weekly lags and load weekly mo ing a e age ea u es we e new calcula ed ea u es ha help o cap u e he mos ecen changes o load (Pin o e al., 2021), keeping he hou ly g anula i y. These we e calcula ed om he second p eceding week un il he ou h week, adding wo mo e ea u es o he cu en da ase . Gi en an hou 𝒉, o o ecas he load 𝑳 a his hou 𝑳𝒉, he load’s lags can be deno ed as 𝑳𝒉−𝒊, whe e 𝒊 emains in he hou ly g anula i y. Following his no a ion, he included lag ea u es a e: 𝑳𝒉−𝟏𝟔𝟖, 𝑳𝒉−𝟑𝟑𝟔, 𝑳𝒉−𝟓𝟎𝟒 and 𝑳𝒉−𝟔𝟕𝟐 which co esponds o he p e ious week, he second las , hi d las and ou h las week’s load. The lags’ mo ing a e ages (LMA) a e calcula ed om he weekly lags ollowing equa ion (1). The independen a iable 𝒎 ep esen s he ea lies week o conside , and 𝒏 s ands o he la es week o conside in he mo ing a e age. Following equa ion (1), he conside ed LMA we e 𝑳𝑴𝑨𝒉(𝟏,𝟑) and 𝑳𝑴𝑨𝒉(𝟏,𝟒). 𝑳𝑴𝑨𝒉(𝒎,𝒏)=∑𝑳𝒉−𝟏𝟔𝟖𝒎+𝑳𝒉−𝟏𝟔𝟖(𝒎+𝟏)+⋯ + 𝑳𝒉−𝟏𝟔𝟖(𝒏−𝟏)+𝑳𝒉−𝟏𝟔𝟖𝒏 𝒏 𝒎𝒏−𝒎+𝟏 ; 𝑤ℎ𝑒𝑟𝑒 𝒎≥𝟏∧ 𝒏>𝒎 (1) 3.3.3. Fea u e Selec ion The decision o which a iables should be used o ain he ML models is c i ical o ob ain good esul s. This p ocess, known as ea u e selec ion, also educes compu a ion ime, dec eases da a s o age equi emen s, simpli ies models, e ades he cu se o dimensionali y, and enhances gene aliza ion, a oiding o e i ing (Eseye e al., 2019). Fo hese easons, se e al ea u e selec ion echniques we e pe o med along wi h he STLF s a e-o - he-a (Beci o ic & Coso ic, 2016; X. Liu e al., 2020); and he p oblem unde s anding o selec essen ial ea u es. The explo ed Fea u e Selec ion echniques we e: ea u e a iance, co ela ion wi h he a ge , edundancy among eg esso s (Han e al., 2011), and ea u e impo ance acco ding o he de aul models mul iple linea eg ession, decision ee eg esso , andom o es eg esso , and ex eme g adien boos ing eg esso . 20 A e ha ing 28 eg esso s and a de ined a ge , he ea u e selec ion analysis showed ha 10 eg esso s would signi ican ly con ibu e o o ecas . Consequen ly, he bes eg esso s a e: ▪ 𝐿𝒉−𝟑𝟑𝟔 ▪ 𝐿𝒉−𝟓𝟎𝟒 ▪ 𝐿𝒉−𝟔𝟕𝟐 ▪ 𝐿𝑀𝐴𝒉(𝟏,𝟒) ▪ 𝑑𝑎𝑦_𝑜𝑓_𝑡ℎ𝑒_𝑤𝑒𝑒𝑘𝒉 ▪ 𝑤𝑒𝑒𝑘𝑒𝑛𝑑_𝑖𝑛𝑑𝑖𝑐𝑎𝑡𝑜𝑟𝒉 ▪ ℎ𝑜𝑙𝑖𝑑𝑎𝑦_𝑖𝑛𝑑𝑖𝑐𝑎𝑡𝑜𝑟𝒉 ▪ ℎ𝑜𝑙𝑖𝑑𝑎𝑦_𝐼𝐷𝒉 ▪ ℎ𝑜𝑢𝑟_𝑜𝑓_𝑡ℎ𝑒_𝑑𝑎𝑦𝒉 ▪ 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒_2𝑚_𝑖𝑛_𝑃𝑎𝑛𝑎𝑚𝑎_𝑐𝑖𝑡𝑦𝒉 The empe a u e was an essen ial wea he a iable due o i s posi i e ela ionship wi h elec ici y load (Boya, 2019), as illus a ed in Figu e 1. This igu e shows he ypical load ange, om 800 o 1600 MWh, and a empe a u e ange be ween 23 and 33 ºC. The dashed line iden i ies he linea equa ion (2): 𝑳𝒉= 4.8 ∙ 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒_2𝑚_𝑖𝑛_𝑃𝑎𝑛𝑎𝑚𝑎_𝑐𝑖𝑡𝑦𝒉−867.5 (2) Which indica es ha 1 °C inc ease in empe a u e ep esen s a 74.8 MWh elec ici y load inc ease. Figu e 1. Na ional elec ici y load s. Tempe a u e in Panama Ci y. 3.3.4. Da ase spli in o ain and es da ase s Be o e spli ing he da a in o aining and es da ase s, he hou ly eco ds a he beginning and he end o he ho izon a e d opped i hey do no belong o a comple e 168 hou s weekly block o consis ency on aining, alida ion, and es ing. A e his, 283 comple e weeks a e a ailable wi h hou ly eco ds. The da ase is spli in o ain and es , keeping he ch onological eco ds. Reco ds a e so ed by da e- ime index, always lea ing he las week o es ing and he emaining olde da a o aining. Based on his logic, he e a e 14 pai s o ain- es da ase s selec ed. Twel e pai s, ha ing a es ing week o each mon h o he las yea o eco ds be o e he 2020 qua an ine s a ed due o he COVID-19 pandemic, and wo mo e a e he qua an ine began. To no e, he o icial lockdown in Panama s a ed on Wednesday, 25 Ma ch o 2020, which co esponds o week 12—2020 (La Es ella de Panamá, 2021). Mo e de ails abou he 14 ain- es pai s a e a ailable in appendices 2 and 3. 0 400 800 1200 1600 2000 22 24 26 28 30 32 34 36 Elec ici y load (MWh) Tempe a u e in Panama ci y (ºC) 21 These c i e ia es he models unde egula and i egula condi ions since he qua an ine pe iod p esen ed a lowe demand wi h a ypical hou ly p o iles. The selec ed es ing weeks also included ypical days and holidays o es he models on di e en condi ions h oughou he yea . As men ioned in he backg ound sec ion, he planning p ocess is weekly done, ypically s a ing e e y Wednesday o o ecas he week s a ing on Sa u day as he i s day o he weekly planning ho izon. So, he a ailable eco ds o o ecas ing usually a e upda ed e e y Tuesday a midnigh , hen execu ed on Wednesdays o he planning 168 hou s ho izon ha s a s e e y Sa u day and inishes on each F iday. Fo his eason, he o ecas should conside a leas a gap o 72 hou s o unseen da a be o e he i s pe iod o p edic . 3.4. MODELLING 3.4.1. Machine Lea ning candida e models S udies ha e shown ha many decision-make s exhibi an inhe en dis us o au oma ed p edic i e models, e en i hey a e p o en o be mo e accu a e han human o ecas e s (Die o s e al., 2015). One way o o e come “algo i hm a e sion” is o p o ide hem wi h in e p e abili y (Be simas e al., 2019). Fo hese easons, he cu en p ojec explo es a se o candida e ML models ha ha e been p o en as o ecas e s wi hin he STLF s a e-o - he-a , bu also models ha can o e a ce ain le el o in e p e abili y. The candida e ML models conside ed in his p ojec a e Mul iple Linea Reg ession (MLR), k-nea es neighbo s eg esso (KNN), epsilon-suppo ec o eg ession (SVR), andom o es eg esso (RF), and ex eme g adien boos ing eg esso (XGB). All hese es ima o s we e execu ed using a pipeline wi h a de aul Min–Max scale as he i s s ep. These ML models, he pipeline s uc u e, and he scale s we e om sci-ki lea n (Ped egosa e al., 2011), excep o XGB (XGB De elope s, 2021). MLR uses wo o mo e independen a iables o p edic a dependen a iable by i ing a linea equa ion. This me hod’s assump ions a e ha : he dependen a iable and he esiduals a e no mally dis ibu ed, he e a e linea ela ionships be ween he dependen and independen a iables, and no collinea i y should exis be ween eg esso s. Since MLR can include many independen a iables, i can p o ide an unde s anding o he ela ionships (Zhang e al., 2019), bu i p esen s he disad an age o being sensi i e o ou lie s. KNN is no ypical o STLF. Ne e heless, hei esul s can be in e p e ed, and some esea che s used i as a baseline model (Johannesen e al., 2019). The KNN me hod sea ches o he k mos simila ins ances; when he k mos simila samples a e ound, he a ge is ob ained by local in e pola ion o he a ge s associa ed wi h he k ound ins ances (Abbasimeh e al., 2020). The main disad an age o his me hod is ha i ends o o e i , and i has ew hype pa ame e s o change his si ua ion. SVR is a eg ession e sion o he Suppo Vec o Machine (SVM) which was ini ially designed o classi ica ion p oblems (Vine & Zhedano , 2011). In con as o o dina y leas squa es o MLR, he objec i e unc ion o SVR is o minimize he L2-no m o he coe icien ec o , no he squa ed e o . The e o e m is hen cons ained by a speci ied ma gin ε (epsilon). SVR is equen ly used o STLF wi h he linea (X. Liu e al., 2020) o adial basis unc ion (RBF) ke nel (Cao e al., 2020), iden i ying load pa e ns be e han o he linea models (Amin & Hoque, 2019). 22 RF is an ensemble lea ning me hod wi h gene aliza ion abili y. I i s many decision ees on a ious sub-samples o he da ase and uses a e aging o imp o e he o ecas and a oid o e i ing. Fo hese easons, i seems sui able o STLF, bu he ew esea che s ha conside his model ha e demons a ed a weak pe o mance on hei esul s (Pin o e al., 2021). XGB is ano he ensemble ML algo i hm based on g adien boos ing lib a y, bu enhanced and designed o be highly e icien , lexible, and po able (XGB De elope s, 2021). P o iding a o wa d s age-wise addi i e model ha i s eg ession ees on many s ages while he eg ession loss unc ion is minimized. Due o i s ecen de elopmen , XGB is no a ma u ed STLF me hod, hough, esea che s a e s a ing o use i , showing ou s anding pe o mances agains adi ional me hods (J. Cai e al., 2020; Had i e al., 2019). In STLF, o ecas ing holidays’ load is one o he mos challenging p oblems due o he lack o eco ds, he low equency o hese e en s, and hei unusual consump ion pa e ns. A way o imp o e he holidays’ o ecas s accu acy is o de elop and ain a pa icula model specialized in o ecas ing holidays (Zhu e al., 2021), along wi h ano he model o non-holidays. This p ojec conside ed a hyb id model ha me ges he weekly o ecas s o non-holidays and holidays, as illus a ed in Figu e 2. This hyb id model s uc u e was applied o each candida e algo i hm. Thus, each hyb id model is composed o wo models wi h he same eg ession algo i hm. The main eason o de elop a hyb id model was o ain he holidays’ model only wi h holidays’ eco ds and including he la ges numbe o eco ds possible. Fo ecas nex week Regula days’ Holidays’ model Weekly o ecas Do no il e eco ds T ain model wi h weekly ime- based c oss- alida ion: las 2.8 yea s Fo ecas whole week Keep only holidays and d op holidays indica o ea u e T ain model wi h daily ime- based c oss- alida ion: all holidays’ eco ds included Fo ecas holidays Hyb id model Join o ecas s, eplacing holidays’ model o ecas o e egula days' model o ecas . Figu e 2. Hyb id model s uc u e. 23 3.4.2. Models aining and hype pa ame e uning Once he aining and es ing weeks pai s we e de ined, models we e ained wi h he ea lies ain- es pai , ollowing he o wa d sliding window app oach (Sugia awan & Ha a i, 2019) o ime-based c oss- alida ion (He man-Sa a , 2021). The idea o ime-based c oss- alida ion is o i e a i ely spli he aining se in o wo olds a each s ep, always keeping he alida ion se ahead o he aining se . This p ocess o de ining olds, aining he model, p edic ing he alida ion old, and e alua ing he model pe o mance while changing hype pa ame e s and mo ing he aining/ alida ion se s u he in o he u u e is illus a ed in Figu e 3. Figu e 3. Sliding window ime-based c oss- alida ion. The egula days’ model’s sliding window cha ac e is ics a e 149 weeks (2.8 yea s) o aining/ alida ion. Wi hin hose, 64 a e alida ion weeks, excluding he las 72 hou s om each alida ion old o comply wi h he h ee-day unknown gap when o ecas ing he weekly demand on eal condi ions; inally, he o wa d s ep on he aining/ alida ion p ocess is one week (168 hou s). Fo he holidays’ model, only holidays eco ds a e kep , and he sliding window conside s all holidays eco ds a ailable since he yea 2015 (as shown in Figu e 2). The o ecas ing ho izon o he holidays’ model is 24 hou s; o ins ance, he sliding window p ocess also conside s o ecas ing a holiday du ing he aining p ocess. The hype pa ame e uning was pe o med wi h Op una op imiza ion amewo k (Akiba e al., 2019), keeping he sliding window a ibu es. The models’ uning p ocess consis s o maximizing he “nega i e mean oo squa ed e o ” (-RMSE) while sampling he de ined hype pa ame e space wi h he T ee- s uc u ed Pa zen Es ima o (TPE) algo i hm (Be gs a e al., 2011). The op imiza ion s udies we e cons ained o 30 ials, which implies ha 30 di e en hype pa ame e combina ions a e explo ed in he aining p ocess. On each ial, o each pa ame e , TPE i s one Gaussian Mix u e Model (GMM) 𝒍(𝒙) o he se o pa ame e alues associa ed wi h he bes objec i e alues, and ano he GMM 𝒈(𝒙) o he emaining pa ame e alues (Op una, 2018a). Then TPE chooses he pa ame e alue 𝒙 ha maximizes he a io 𝒍(𝒙)/𝒈(𝒙). I is aluable o men ion ha as a i s ial o add ess his STLF ask, all candida e’s models we e ained wi h a wo-s ep andomized and g id-sea ch c oss- alida ion app oach as sugges ed by (Die ich e al., 2020), bu i esul ed compu a ionally oo expensi e. To educe he compu a ional wo k and execu ion ime, bu wi hou losing quali y on esul s, Op una hype pa ame e op imiza ion was chosen; aiming o simula e he models' upda es along he ime by aining each candida e model be o e o ecas ing each es ing week. 24 This hype pa ame e uning was pe o med indi idually o bo h models inside he Hyb id mode: he egula ’s days model and he holidays’ model. The hype pa ame e op imiza ion was pe o med o each es ing week, aiming o p edic each es ing week wi h upda ed models along he ime. The explo ed hype pa ame e space o each algo i hm is shown in Table 2. The absen pa ame e s we e conside ed wi h hei de aul alue, and he hype pa ame e spaces a e exp essed in e ms o he ial me hod om Op una, which desc ibes mo e p ecisely he explo ed dis ibu ions and anges o alues o each pa ame e (Op una, 2018b). Model Hype pa ame e Hype pa ame e space KNN n_neighbo s sugges _in ('n_neighbo s', 3, 50, 2) weigh s sugges _ca ego ical('weigh s', ['uni o m', 'dis ance']) me ic sugges _ca ego ical('me ic', ['minkowski', 'euclidean', 'manha an']) lea _size sugges _in ('lea _size', 1, 50, 5) SVR ke nel sugges _ca ego ical('ke nel', ['linea ', ' b ']) epsilon sugges _loguni o m('epsilon', 0.0001, 10) C sugges _loguni o m('C', 0.001, 3000) ol ial.sugges _uni o m(' ol', 1×10−5, 1×10−2) gamma sugges _ca ego ical('gamma', ['scale', 'au o']) RF c i e ion mse n_es ima o s sugges _in ('n_es ima o s', 40, 200, 20) max_samples sugges _disc e e_uni o m('max_samples', 0.6, 0.9, 0.05) max_dep h sugges _in ('max_dep h', 7, 21, 3) ccp_alpha sugges _loguni o m('ccp_alpha', 1×10−6, 1×10−3) andom_s a e 123 XGB e al_me ic mse n_es ima o s sugges _in ('n_es ima o s', 300, 500, 50) max_dep h sugges _in ('max_dep h', 3, 7) subsample sugges _disc e e_uni o m('subsample', 0.6, 0.9, 0.05) colsample_by ee sugges _disc e e_uni o m('colsample_by ee', 0.6, 0.9, 0.05) colsample_byle el sugges _disc e e_uni o m('colsample_byle el', 0.6, 0.9, 0.1) colsample_bynode sugges _disc e e_uni o m('colsample_bynode', 0.6, 0.9, 0.1) lea ning_ a e sugges _loguni o m('lea ning_ a e',0.0001, 0.1) min_child_weigh sugges _in ('min_child_weigh ', 1, 7, 2) gamma sugges _loguni o m('gamma', 0.00001, 2) lambda sugges _loguni o m(' eg_lambda', 1, 5) alpha sugges _loguni o m(' eg_alpha', 0.00001, 2) andom_s a e 123 Table 2. Hype pa ame e space by model. 25 3.5. EVALUATION METRICS This p ojec add esses many e alua ion me ics o sys ema ically e alua e he ML models’ pe o mance, including he adi ional me ics o ML o ecas ing, as well as o he speci ic me ics o STLF. These e alua ion me ics and hei o mula ion a e lis ed in Table 3. Whe e 𝑨 is a weekly se o ac ual hou ly load alues, 𝑭 is a weekly se o o ecas ed hou ly alues, and subindex 𝒉 s ands o a speci ic hou . Fo his p ojec , all es ing se s we e whole weeks wi h 168 hou s, so 𝒏 is equal o 168. Me ic De ini ion Equa ion Uni MAPE Mean Absolu e Pe cen age E o 𝑀𝐴𝑃𝐸= 1 𝑛∑ |𝐴ℎ−𝐹ℎ 𝐴ℎ| 𝑛 ℎ=1 ×100% % RMSE Roo Mean Squa e E o 𝑅𝑀𝑆𝐸= √1 𝑛∑(𝐴ℎ−𝐹ℎ)2 𝑛 ℎ=1 MWh Peak Peak Load Absolu e Pe cen age E o 𝑃𝑒𝑎𝑘= |max(𝐴)−max(𝐹) max(𝐴)|×100% % Valley Valley Load Absolu e Pe cen age E o 𝑉𝑎𝑙𝑙𝑒𝑦= |min(𝐴)−min(𝐹) min(𝐴)|×100% % Ene gy Ene gy Absolu e Pe cen age E o 𝐸𝑛𝑒𝑟𝑔𝑦= |∑𝐴ℎ 𝑛 ℎ=1 −∑𝐹ℎ 𝑛 ℎ=1 ∑𝐴ℎ 𝑛 ℎ=1 |×100% % Table 3. E alua ion me ics. 32 Model yea 2019 2020 week no. 15 21 24 29 33 37 41 44 51 1 6 10 20 24 mon h Ap May Jun Jul Aug Sep Oc No Dec Jan Feb Ma May Jun KNN n_neighbo s 41 31 31 31 41 31 31 37 31 37 37 31 29 35 weigh s dis . dis dis dis dis dis dis dis dis dis dis dis dis dis me ic manh . manh . manh . manh . manh . manh . manh . manh . manh . manh . manh . manh . manh . manh . lea _size 11 1 1 1 16 16 1 46 46 1 16 16 21 46 SVR ke nel b b b b b b b b b b b b b b epsilon 2.48927 8.25782 0.00082 0.01421 0.00033 0.00092 0.02024 0.86639 0.00013 6.93334 0.00014 0.02678 7.16092 0.02286 C 415.13 409.21 299.93 304.05 318.07 332.74 331.23 367.35 315.65 2938.91 296.54 307.96 243.53 308.42 ol 0.00694 0.00350 0.00868 0.00780 0.00853 0.00811 0.00012 0.00876 0.00024 0.00931 0.00293 0.00772 0.00072 0.00882 RF n_es ima o s 140 140 100 80 120 200 180 180 200 180 200 200 200 180 max_samples 0.60 0.65 0.70 0.70 0.60 0.65 0.70 0.70 0.65 0.65 0.60 0.60 0.60 0.60 max_dep h 10 10 10 13 13 13 10 13 13 10 13 13 10 10 ccp_alpha 1.59×10−4 2.33×10−6 2.86×10−5 1.50×10−5 9.16×10−5 9.83×10−4 3.87×10−6 1.68×10−4 1.19×10−6 8.10×10−5 1.73×10−5 3.65×10−6 3.54×10−4 9.72×10−4 XGB n_es ima o s 350 400 350 400 500 400 600 550 350 600 500 600 600 550 max_dep h 5 4 4 5 4 5 4 5 5 5 5 5 4 4 subsample 0.75 0.75 0.70 0.65 0.65 0.75 0.65 0.65 0.60 0.75 0.75 0.65 0.70 0.75 colsample_by ee 0.75 0.70 0.65 0.80 0.70 0.60 0.75 0.80 0.60 0.60 0.70 0.70 0.75 0.65 colsample_byle el 0.70 0.90 0.80 0.65 0.70 0.85 0.80 0.60 0.75 0.60 0.90 0.65 0.85 0.85 colsample_bynode 0.70 0.75 0.80 0.60 0.65 0.70 0.90 0.60 0.90 0.70 0.85 0.85 0.75 0.75 lea ning_ a e 0.050016 0.066828 0.057397 0.030956 0.051173 0.039766 0.036783 0.022305 0.052250 0.041089 0.042121 0.027303 0.027487 0.021568 min_child_weigh 7 3 3 7 7 1 7 3 5 3 1 7 7 3 gamma 1.7696 0.9889 0.0440 0.1366 0.0039 5.81×10−5 1.65×10−3 1.71×10−4 0.9251 7.12×10−4 0.0220 1.34×10−3 1.35×10−5 0.8903 lambda 1.1940 1.4665 3.1788 1.1477 3.6228 3.6026 2.5763 1.6005 3.2689 3.7203 2.6808 1.7332 1.0280 3.6871 alpha 1.0194 0.1336 0.0457 0.0209 2.94×10−3 0.0183 3.00×10−3 4.55×10−4 0.0338 7.46×10−5 7.47×10−4 9.20×10−5 0.0738 0.2525 Table 7. Hype pa ame e op imiza ion esul s o egula days’ models, by es ing week. 33 Model yea 2019 2020 week no. 15 21 24 29 33 37 41 44 51 1 6 10 20 24 mon h Ap May Jun Jul Aug Sep Oc No Dec Jan Feb Ma May Jun KNN n_neighbo s 25 25 33 21 15 27 21 15 39 39 21 29 21 29 weigh s dis . dis dis dis dis dis dis dis dis dis dis dis dis dis me ic manh . manh . manh . manh . manh . manh . manh . manh . manh . manh . manh . manh . manh . manh . lea _size 1 11 1 26 46 26 21 1 26 6 46 16 11 26 SVR ke nel b b b b b b b b b b b b b b epsilon 0.00264 0.00045 0.00017 9.45318 6.31538 1.09855 5.73192 0.00023 0.20928 0.90036 2.22753 8.30718 0.00029 0.62205 C 2802.99 626.41 460.37 807.35 303.19 257.51 609.51 248.33 149.49 151.74 142.09 111.01 2774.43 234.76 ol 0.00794 0.00852 0.00967 0.00998 0.00185 0.00361 0.00556 0.00671 0.00540 0.00417 0.00991 0.00606 0.00321 0.00592 RF n_es ima o s 100 100 140 200 100 200 100 200 80 100 140 140 100 100 max_samples 0.80 0.80 0.80 0.60 0.80 0.80 0.80 0.80 0.60 0.80 0.80 0.80 0.80 0.80 max_dep h 19 13 19 16 16 16 16 19 19 13 19 19 16 19 ccp_alpha 2.24×10−5 5.31×10−5 1.51×10−6 4.70×10−5 6.03×10−5 8.83×10−4 2.24×10−5 4.45×10−5 2.09×10−5 2.84×10−4 7.46×10−6 4.46×10−5 8.40×10−6 1.06×10−4 XGB n_es ima o s 300 500 500 300 500 300 500 500 300 450 350 450 500 300 max_dep h 4 6 4 5 7 4 7 4 6 7 4 6 4 7 subsample 0.80 0.90 0.60 0.80 0.75 0.80 0.70 0.75 0.90 0.70 0.80 0.70 0.60 0.85 colsample_by ee 0.70 0.90 0.90 0.65 0.75 0.60 0.60 0.80 0.90 0.65 0.80 0.65 0.70 0.90 colsample_byle el 0.80 0.90 0.90 0.80 0.90 0.80 0.90 0.90 0.70 0.90 0.80 0.90 0.80 0.80 colsample_bynode 0.90 0.80 0.90 0.90 0.90 0.90 0.80 0.70 0.90 0.80 0.80 0.90 0.90 0.60 lea ning_ a e 0.059702 0.022990 0.099259 0.096232 0.058822 0.046665 0.026215 0.046144 0.096558 0.031292 0.072094 0.090842 0.065184 0.090743 min_child_weigh 5 3 7 3 3 5 5 5 7 7 7 3 3 3 gamma 2.86×10−3 1.47×10−3 0.0464 6.64×10−4 2.29×10−3 0.5343 3.46×10−5 2.52×10−3 1.20×10−5 3.40×10−5 1.8331 0.4352 1.93×10−5 0.0833 lambda 3.6348 1.2237 1.1215 1.0615 1.6029 1.4756 3.2333 4.3853 1.6743 1.0481 1.2192 2.0430 1.6593 1.7202 alpha 4.44×10−5 2.85×10−3 1.11×10−3 3.07×10−4 6.56×10−4 1.99×10−5 8.60×10−5 1.61×10−3 9.33×10−5 1.06×10−4 1.62×10−4 4.51×10−3 9.24×10−4 6.46×10−4 Table 8. Hype pa ame e op imiza ion esul s o holidays’ models, by es ing week. 34 4.4. BENCHMARKING The esul s ob ained in his p ojec can be in e p e ed om he pe spec i e o any ime-se ies o ecas ing esea ch using ML echniques since he s anda d ML me hodologies o STLF we e applied o ain and e alua e esul s, as exposed in he li e a u e e iew. Fo example, he selec ed ea u es ac oss he STLF ield o s udy ma ch his p ojec ’s bes ea u es: he load’s lags, he hou o he day, and empe a u e. Holidays and weekends’ bina y indica o s also con ibu e since hey help de e mine a high o low load ange. In con as wi h mos o he s udies whe e esea che s o ecas 24 o 48 hou s, his p ojec add essed a 168-hou ho izon, conside ing a 72-hou gap be o e he i s o ecas ing pe iod. A second di e en ia ion is he implemen a ion o a hyb id model o enhance he holidays’ o ecas ; wi hin he weekly o ecas ing ho izon. Besides he ypical MAPE and RMSE e alua ion me ics, his p ojec p oposed load peak, load alley, and ene gy e alua ion as seconda y, p ac ical me ics ha analys s can easily moni o . Ano he dis inc ion o his p ojec is he di e si y o es ing pe iods, p esen ing STLF o egula wo king days, holidays, and i egula pe iods du ing he 2020 qua an ine. This p ojec ’s mos impo an dis inc ion is compa ing he o icial weekly p e-dispa ch o ecas as a baseline and alida ing he esul s. As exposed in he in oduc ion sec ion, his p ojec ’s di ec implica ion is o ecas ing Panama’s na ional load. Howe e , hese models can be ained and applied o coun ies o egions wi h simila condi ions. 35 5. CONCLUSIONS This p ojec ’s main objec i es we e o e alua e cu en Panama’s o icial load o ecas and de elop a se o Machine Lea ning models o imp o e his o icial load o ecas . Fo ins ance, he models we e de eloped and benchma ked wi h da a and p e ious o ecas s om Panama’s powe sys em. This p ojec p esen ed a no el hyb id me hodology o imp o e he weekly STLF o ecas o he Panama case s udy o add ess he o ecas ing ask, keeping a 72-hou gap. A se o i e p o en algo i hms ac oss he esea ch ield we e chosen o de elop he hyb id models and subsequen ly compa e hei esul s agains he o icial o ecas ing ool eco ds on di e se es ing weeks. Resul s along 14 es ing weeks con i med he sui abili y o he XGB algo i hm o he hyb id me hodology. Fi s , o ime e iciency on aining and p edic ing; second, o lexibili y due o he pa ame e space; and hi d, o he ease o p o iding ce ain in e p e abili y h ough i s ea u e impo ance p ope y. Fo he abo e-exposed easons, his p ojec makes se e al signi ican con ibu ions o he ield o s udy. Fi s , i shows ha models buil wi h XGB ha e supe io pe o mance o models buil wi h o he algo i hms. Second, i con i ms ha empe a u e plays an impo an ole in STLF. Thi d, i demons a es he excellen pe o mance o ML models by o ecas ing o a longe ho izon han ypical esea ch; and e en wi h a h ee-day gap o da a be o e he o ecas . Las ly, his p ojec iden i ies public da a ha o he esea che s can use o imp o e a amed o ecas ing ask. De ails abou his p ojec da ase eposi o y a e a ailable in Appendix 1. This p ojec also has se e al p ac ical implica ions. The i s and main implica ion is o eplace he cu en o ecas ing ool o he Panama case s udy, hus allowing Panama o educe cos s and imp o e STLF pe o mance. Second, his model could be ained and applied in o he coun ies o egions wi h simila condi ions. Fu he mo e, he posi i e impac s o p o iding a mo e accu a e STLF will educe he planning unce ain y added by he in e mi en enewable p oduc ion and subsequen ly be close o he op imal hyd o- he mal cos s scheduled in he weekly uni commi men . This hi d p ac ical implica ion leads o a ou h: o he speci ic case o he Panama ene gy spo ma ke , because i is a ma ginalis ma ke , accu a e STLF can also educe he hou ly ene gy p ice unce ain y in he wholesale elec ici y ma ke . 36 6. LIMITATIONS AND RECOMMENDATIONS FOR FUTURE WORKS Fu u e wo k wi hin his speci ic esea ch can include mo e his o ical load eco ds o ain models in pa icula si ua ions, like holidays. Ano he app oach o enhance o ecas s is o classi y load p o iles using clus e ing echniques p io aining (Zheng e al., 2017), and use s acking echniques o enhance he o ecas accu acy, e en hough i inc eases he aining and p edic ing ime (Massaoudi e al., 2021). In he pa icula case s udy o Panama’s na ional load, he e a e special consume s named au o- gene a o s: he Panama Canal and Mine a Panama (CND, 2021a). These consume s ha e a signi ican load, bu as hei agen ’s name sugges s, hey supply hei own demand wi h hei own powe plan s mos o he ime, excep o scheduled main enance pe iods on hei powe plan s o un o eseen una ailabili y on hei powe plan s (CND, 2021d). Those agen s will consume ene gy om he na ional powe sys em du ing hose e en s, causing an ex a inc ease in he na ional load. I his addi ional load can be scheduled, i is be e o ack he elec ici y load by consume and o ecas only he esiden ial, comme cial, and indus ial load, hen add au o-gene a o s i needed. This load seg ega ion a oids dis o ions on he load o ecas , as s a ed in au o-gene a o s me hodology (CND, 2021b). In his con ex , ano he esea ch a enue o de elop STLF by consume s eme ges, bu i equi es da a wi h his seg ega ion. Since DL models a e ou o his p ojec scope, and DL models equi e mo e eco ds han ML models, unidi ec ional and bidi ec ional LSTM we e no compa ed in he esea ch. Howe e , u u e s udies should e alua e hese algo i hms’ pe o mance ha ha e p o en good o STLF (A e & El awil, 2020). Simila ly, non-i e a i e ANN-based algo i hms can be explo ed due o hei good pe o mance and low aining ime, like (Vi ynskyi e al., 2018) compa ed wi h a se o ML models. Al hough he e a e cu en ly se e al wea he o ecas s a ailable wi h hou ly g anula i y (Visual C ossing, 2021), because he empe a u e is c ucial o STLF, i is ad isable o coun wi h an accu a e empe a u e o ecas o eed his STLF model. Hence, a empe a u e o ecas model can complemen his p ojec . I is ad ised o do a weekly load pa e ns e ision since consump ion pa e ns can change in he u u e. An example o ab up changes on he hou ly load p o ile was exposed in his p ojec du ing he 2020 qua an ine pe iod. Howe e , o he ending consump ion pa e ns (Ande sen e al., 2019), like echa ging mo e elec ic ehicles and ha ing mo e sola p oduc ion behind- he-me e , will p oduce esiden ial and comme cial hou ly consump ion changes. This e ision implies ha o ecas ing models should be upda ed mo e o en, and e en ha hey need o be mo e obus . A possible solu ion o o e come hese issues is o au oma ically enable he models o lea n wi h new da a e e y week by deploying he “Champion-Challenge ” app oach (Abbo , 2014). A weekly hype pa ame e uning is execu ed o upda e he models and make hem compe e o ensu e he bes pe o mance along ime. The inal goal o STLF is o educe he unce ain y on eal- ime dispa ch o hyd o- he mal powe plan s because he wind and sola a ms a e non-dispa chable powe plan s. Consequen ly, ano he way o educe he planning unce ain y and complemen he STLF is by p o iding an accu a e o ecas o wind and sola p oduc ion and o he non-dispa chable powe plan s, i any. 37 7. BIBLIOGRAPHY Abbasimeh , H., Shabani, M., & Youse i, M. (2020). An op imized model using LSTM ne wo k o demand o ecas ing. Compu e s and Indus ial Enginee ing, 143(July 2019), 106435. h ps://doi.o g/10.1016/j.cie.2020.106435 Abbo , D. (2014). Applied P edic i e Analy ics. P inciples and echniques o he p o essional da a analys . (p. 372). Indianapolis, IN, USA: John Wiley & Sons, Inc. Adeoye, O., & Spa a u, C. (2019). Modelling and o ecas ing hou ly elec ici y demand in Wes A ican coun ies. Applied Ene gy, 242(Ma ch), 311–333. h ps://doi.o g/10.1016/j.apene gy.2019.03.057 Aguila Mad id, E., & Valdés Bosquez, L. (2017). Impac o wind and pho o ol aic gene a ion inpu in Panama ; Impac o de la en ada de la gene ación eólica y o o ol aica en Panamá. I+D Tecnológico, 13(1), 71-82. Re ie ed om h ps:// e is as.u p.ac.pa/index.php/id- ecnologico/a icle/ iew/1440 Akiba, T., Sano, S., Yanase, T., Oh a, T., & Koyama, M. (2019). Op una: A nex -gene a ion hype pa ame e op imiza ion amewo k. A Xi , 2623–2631. h ps://doi.o g/10.1145/3292500.3330701 Al-Musaylh, M. S., Deo, R. C., Adamowski, J. F., & Li, Y. (2018). Sho - e m elec ici y demand o ecas ing wi h MARS, SVR and ARIMA models using agg ega ed demand da a in Queensland, Aus alia. Ad anced Enginee ing In o ma ics, 35(No embe 2017), 1–16. h ps://doi.o g/10.1016/j.aei.2017.11.002 Alex J., S., & Schölkop , B. (2004). A u o ial on suppo ec o eg ession. S a is ics and Compu ing, 14, 199–222. h p://dx.doi.o g/10.1088/1751-8113/44/8/085201 Amin, M. A. Al, & Hoque, M. A. (2019). Compa ison o ARIMA and SVM o sho - e m load o ecas ing. IEMECON 2019 - 9 h Annual In o ma ion Technology, Elec omechanical Enginee ing and Mic oelec onics Con e ence, 205–210. h ps://doi.o g/10.1109/IEMECONX.2019.8877077 Amjady, N. (2001). Sho - e m hou ly load o ecas ing using ime-se ies modeling wi h peak load es ima ion capabili y. IEEE T ansac ions on Powe Sys ems, 16(4), 798–805. h ps://doi.o g/10.1109/59.962429 Ande sen, F. M., Henningsen, G., Mølle , N. F., & La sen, H. V. (2019). Long- e m p ojec ions o he hou ly elec ici y consump ion in Danish municipali ies. Ene gy, 186, 115890. h ps://doi.o g/10.1016/j.ene gy.2019.115890 A e , S., & El awil, A. B. (2020). Assessmen o s acked unidi ec ional and bidi ec ional long sho - e m memo y ne wo ks o elec ici y load o ecas ing. Elec ic Powe Sys ems Resea ch, 187(Ap il), 106489. h ps://doi.o g/10.1016/j.eps .2020.106489 Ba aka , E. H., & Al-Qasem, J. M. (1998). Me hodology o weekly load o ecas ing. IEEE T ansac ions on Powe Sys ems, 13(4), 1548–1555. h ps://doi.o g/10.1109/59.736304 38 Beci o ic, E., & Coso ic, M. (2016). Machine lea ning echniques o sho -Te m load o ecas ing. 4 h In e na ional Symposium on En i onmen F iendly Ene gies and Applica ions, EFEA 2016. h ps://doi.o g/10.1109/EFEA.2016.7748789 Be gs a, J., Ba dene , R., Bengio, Y., & Kégl, B. (2011). Algo i hms o hype -pa ame e op imiza ion. Ad ances in Neu al In o ma ion P ocessing Sys ems 24: 25 h Annual Con e ence on Neu al In o ma ion P ocessing Sys ems 2011, NIPS 2011, 1–9. Re ie ed om h ps://pape s.nips.cc/pape /2011/ ile/86e8 7ab32c d12577bc2619bc635690-Pape .pd Be simas, D., Dela ue, A., Jaille , P., & Ma in, S. (2019). The P ice o In e p e abili y. h ps://a xi .o g/abs/1907.03419 Boya, C. (2019). Analyzing he ela ionship be ween empe a u e and load demand in he egions wi h he highes elec ici y consump ion in he epublic o Panama. P oceedings - 2019 7 h In e na ional Enginee ing, Sciences and Technology Con e ence, IESTEC 2019, 132–137. h ps://doi.o g/10.1109/IESTEC46403.2019.00-88 Cai, J., Cai, H., Cai, Y., Wu, L., & Shen, Y. (2020). Sho - e m Fo ecas ing o Use Powe Load in China Based on XGBoos . 3, 1–5. h ps://doi.o g/10.1109/appeec48164.2020.9220335 Cai, Y., Xie, Q., Wang, C., & Lu, F. (2011). Sho - e m load o ecas ing o ci y holidays based on gene ic suppo ec o machines. 2011 In e na ional Con e ence on Elec ical and Con ol Enginee ing, ICECE 2011 - P oceedings, 1, 3144–3147. h ps://doi.o g/10.1109/ICECENG.2011.6057627 Cao, L., Li, Y., Zhang, J., Jiang, Y., Han, Y., & Wei, J. (2020). Elec ical load p edic ion o heal hca e buildings h ough single and ensemble lea ning. Ene gy Repo s, 6, 2751–2767. h ps://doi.o g/10.1016/j.egy .2020.10.005 Chapagain, K., & Ki ipiyakul, S. (2018). Sho -Te m Elec ici y Demand Fo ecas ing wi h Seasonal and In e ac ions o Va iables o Thailand. IEECON 2018 - 6 h In e na ional Elec ical Enginee ing Cong ess, Ma ch 2009, 2018–2021. h ps://doi.o g/10.1109/IEECON.2018.8712189 CND-si . (2021, Ma ch 2). Sis ema de In o mación en Tiempo Real. Re ei ed om h p://si .cnd.com.pa/m/pub/sin.h ml CND. (2021a, Ma ch 2). In o me de Planeamien o Ope a i o - Semes e I 2020. Re ei ed om h ps://si iop i ado.cnd.com.pa/In o me/Download/36121?key=VXd9e23Z9JRA5aIUR21R- P8gocoGOMqd So79FduN CND. (2021b, Ma ch 2). Me odologías de De allle (ene o 2021). Me odologías de De alle. Re ei ed om h ps://www.cnd.com.pa/index.php/ace ca/documen os/no mas CND. (2021c, Ma ch 2). Pos -dispa ch – Ope a ions Repo s. Re ie ed om h ps://www.cnd.com.pa/index.php/in o mes/ca ego ia/in o mes-de-ope aciones? ipo=60 CND. (2021d, Ma ch 2). Reglas Come ciales. Reglas Come ciales Pa a El Me cado Mayo is a de Elec icidad. Re ei ed om h ps://www.cnd.com.pa/index.php/ace ca/documen os/no mas 39 CND. (2021e, Ma ch 2). Weekly p e-dispa ch – Ope a ions Repo s. Re ei ed om h ps://www.cnd.com.pa/index.php/in o mes/ca ego ia/in o mes-de- ope aciones? ipo=68&anio=2019&semana=0 Die ich, B., Wal he , J., Weigold, M., & Abele, E. (2020). Machine lea ning based e y sho e m load o ecas ing o machine ools. Applied Ene gy, 276(Feb ua y), 115440. h ps://doi.o g/10.1016/j.apene gy.2020.115440 Die o s , B. J., Simmons, J. P., & Massey, C. (2015). Algo i hm a e sion: People e oneously a oid algo i hms a e seeing hem e . Jou nal o Expe imen al Psychology: Gene al, 144(1), 114–126. h ps://doi.o g/10.1037/xge0000033 Do, L. P. C., Lin, K. H., & Molná , P. (2016). Elec ici y consump ion modelling: A case o Ge many. Economic Modelling, 55, 92–101. h ps://doi.o g/10.1016/j.econmod.2016.02.010 Du a, S., Li, Y., Venka a aman, A., Cos a, L. M., Jiang, T., Plana, R., To djman, P., Choo, F. H., Foo, C. F., & Pu gen, H. B. (2017). Load and Renewable Ene gy Fo ecas ing o a Mic og id using Pe sis ence Technique. Ene gy P ocedia, 143, 617–622. h ps://doi.o g/10.1016/j.egyp o.2017.12.736 Eseye, A. T., Leh onen, M., Tukia, T., Uimonen, S., & Milla , R. J. (2019). Machine Lea ning Based In eg a ed Fea u e Selec ion App oach o Imp o ed Elec ici y Demand Fo ecas ing in Decen alized Ene gy Sys ems. IEEE Access, 7, 91463–91475. h ps://doi.o g/10.1109/ACCESS.2019.2924685 Fe nandes, R. S. S., Bichpu iya, Y. K., Rao, M. S. S., & Soman, S. A. (2011). Day ahead load o ecas ing models o holidays in Indian con ex . 2011 In e na ional Con e ence on Powe and Ene gy Sys ems, ICPS 2011, 1–5. h ps://doi.o g/10.1109/ICPES.2011.6156652 Fe ei a, P. M., Cuambe, I. D., Ruano, A. E., & Pes ana, R. (2013). Fo ecas ing he Po uguese elec ici y consump ion using leas -squa es suppo ec o machines. IFAC P oceedings Volumes (IFAC-Pape sOnline), 3(PART 1), 411–416. h ps://doi.o g/10.3182/20130902-3-CN-3020.00138 Fe ei a, P. M., Ruano, A. E., & Pes ana, R. (2010). Imp o ing he iden i ica ion o RBF p edic i e models o o ecas he Po uguese elec ici y consump ion ? IFAC P oceedings Volumes (IFAC- Pape sOnline), 1(PART 1), 208–213. h ps://doi.o g/10.3182/20100329-3-p -3006.00039 Gace a. (2020). Busqueda A anzada Gace a. Gace a O icial. Re ei ed om h ps://www.gace ao icial.gob.pa/Busqueda-A anzada GCP. (2021). AI Pla o m No ebooks | Google Cloud Pla o m. Re ie ed om h ps://cloud.google.com/ai-pla o m-no ebooks GES DISC. (2015). Global Modeling and Assimila ion O ice (GMAO) (2015), MERRA-2 a g1_2d_sl _Nx: 2d,1-Hou ly,Time-A e aged,Single-Le el,Assimila ion,Single-Le el Diagnos ics V5.12.4, G eenbel , MD, USA. Changes; Global Modeling and Assimila ion O ice (GMAO). h ps://doi.o g/10.5067/VJAFPLI1CSIV 40 Google. (2020). Colabo a o y – Google. Colabo a o y F equen ly Asked Ques ions. Re ie ed om h ps:// esea ch.google.com/colabo a o y/ aq.h ml Had i, S., Nai malek, Y., Najib, M., Bakhouya, M., Fakh i, Y., & Ela oussi, M. (2019). A compa a i e s udy o p edic i e app oaches o load o ecas ing in sma buildings. P ocedia Compu e Science, 160, 173–180. h ps://doi.o g/10.1016/j.p ocs.2019.09.458 Han, J., Kambe , M., & Pei, J. (2011). Da a Mining. Concep s and Techniques, 3 d Edi ion, pp. 99-110 (The Mo gan Kau mann Se ies in Da a Managemen Sys ems). He man-Sa a , O. (2021, Ma ch 2). Time Based C oss Valida ion. Time Based C oss Valida ion. Re ie ed om h ps:// owa dsda ascience.com/ ime-based-c oss- alida ion-d259b13d42b8 HITACHI-ABB. (2021, Ma ch 2). Nos adamus. Sho - e m enewable, demand and p ice o ecas ing. Re ie ed om h ps://www.hi achiabb-powe g ids.com/cn/en/o e ing/p oduc -and- sys em/ene gy-po olio-managemen / ading-and- isk-managemen /nos adamus Hossein, S., & Mohammad, S. S. (2011). Elec ic Powe Sys em Planning. (p. 10). Be lin, Heidelbe g, Ge many: Sp inge . Hoye , S., & Hamman, J. J. (2017). xa ay: N-D labeled A ays and Da ase s in Py hon. Jou nal o Open Resea ch So wa e, 5. h ps://doi.o g/10.5334/jo s.148 Johannesen, N. J., Kolhe, M., & Goodwin, M. (2019). Rela i e e alua ion o eg ession ools o u ban a ea elec ical ene gy demand o ecas ing. Jou nal o Cleane P oduc ion, 218, 555–564. h ps://doi.o g/10.1016/j.jclep o.2019.01.108 Khwaja, A. S., Anpalagan, A., Naeem, M., & Venka esh, B. (2020). Join bagged-boos ed a i icial neu al ne wo ks: Using ensemble machine lea ning o imp o e sho - e m elec ici y load o ecas ing. Elec ic Powe Sys ems Resea ch, 179(June 2019), 106080. h ps://doi.o g/10.1016/j.eps .2019.106080 La Es ella de Panamá. (2021, Ma ch 2). Cua en ena en Panamá. Calles Desie as En El P ime Día de Cua en ena To al En Panamá Po COVID-19. Re ei ed om h ps://www.laes ella.com.pa/nacional/200325/calles-desie as-p ime -dia-cua en ena- o al- panama-co id-19 Lebo sa, M. E., Sigauke, C., Be e, A., Fildes, R., & Boylan, J. E. (2018). Sho e m elec ici y demand o ecas ing using pa ially linea addi i e quan ile eg ession wi h an applica ion o he uni commi men p oblem. Applied Ene gy, 222(Decembe 2017), 104–118. h ps://doi.o g/10.1016/j.apene gy.2018.03.155 Li, C. (2020). Designing a sho - e m load o ecas ing model in he u ban sma g id sys em. Applied Ene gy, 266(Janua y), 114850. h ps://doi.o g/10.1016/j.apene gy.2020.114850 Liao, X., Cao, N., Li, M., & Kang, X. (2019). Resea ch on Sho -Te m Load Fo ecas ing Using XGBoos Based on Simila Days. P oceedings - 2019 In e na ional Con e ence on In elligen T anspo a ion, Big Da a and Sma Ci y, ICITBS 2019, 675–678. h ps://doi.o g/10.1109/ICITBS.2019.00167 41 Liu, F., Findlay, R. D., & Song, Q. (2006). A neu al ne wo k based sho e m elec ic load o ecas ing in On a io Canada. CIMCA 2006: In e na ional Con e ence on Compu a ional In elligence o Modelling, Con ol and Au oma ion, Join ly wi h IAWTIC 2006: In e na ional Con e ence on In elligen Agen s Web Technologies ..., 0–6. h ps://doi.o g/10.1109/CIMCA.2006.17 Liu, X., Zhang, Z., & Song, Z. (2020). A compa a i e s udy o he da a-d i en day-ahead hou ly p o incial load o ecas ing me hods: F om classical da a mining o deep lea ning. Renewable and Sus ainable Ene gy Re iews, 119(No embe 2019), 109632. h ps://doi.o g/10.1016/j. se .2019.109632 Liu, Y., Luo, H., Zhao, B., Zhao, X., & Han, Z. (2019). Sho -Te m Powe Load Fo ecas ing Based on Clus e ing and XGBoos Me hod. P oceedings o he IEEE In e na ional Con e ence on So wa e Enginee ing and Se ice Sciences, ICSESS, 2018-No em, 536–539. h ps://doi.o g/10.1109/ICSESS.2018.8663907 Massaoudi, M., Re aa , S. S., Chihi, I., T abelsi, M., Ouesla i, F. S., & Abu-Rub, H. (2021). A no el s acked gene aliza ion ensemble-based hyb id LGBM-XGB-MLP model o Sho -Te m Load Fo ecas ing. Ene gy, 214, 118874. h ps://doi.o g/10.1016/j.ene gy.2020.118874 McKinney, W., & Team, P. D. (2020). pandas: powe ul Py hon da a analysis oolki Release 1.1.4. h ps://doi.o g/10.5281/zenodo.3509134 Mo ales-España, G., La o e, J. M., & Ramos, A. (2013). Tigh and compac MILP o mula ion o s a - up and shu -down amping in uni commi men . IEEE T ansac ions on Powe Sys ems, 28(2), 1288–1296. h ps://doi.o g/10.1109/TPWRS.2012.2222938 Nadh, K. (2021, Ma ch 2). ne CDF4 API documen a ion. Ne CDF4 API Documen a ion. Re ie ed om h ps://unida a.gi hub.io/ne cd 4-py hon/ Omidi, A., Ba aka i, S. M., & Ta akoli, S. (2015). Applica ion o nusuppo ec o eg ession in sho - e m load o ecas ing. 20 h Elec ical Powe Dis ibu ion Con e ence, EPDC 2015, Ap il, 32–36. h ps://doi.o g/10.1109/EPDC.2015.7330469 Op una. (2021a, Ma ch 2). TPE Sample — Op una 2.5.0 documen a ion. Re ei ed om h ps://op una. ead hedocs.io/en/s able/ e e ence/gene a ed/op una.sample s.TPESample .h ml Op una. (2021b, Ma ch 2). T ial — Op una 2.5.0 documen a ion. Re ei ed om h ps://op una. ead hedocs.io/en/s able/ e e ence/gene a ed/op una. ial.T ial.h ml Pa e akis, N. G., Mocanu, E., Gibescu, M., S appe s, B., & Van Als , W. (2017). Deep lea ning e sus adi ional machine lea ning me hods o agg ega ed ene gy demand p edic ion. 2017 IEEE PES Inno a i e Sma G id Technologies Con e ence Eu ope, ISGT-Eu ope 2017 - P oceedings, 2018- Janua, 1–6. h ps://doi.o g/10.1109/ISGTEu ope.2017.8260289 48 8.3.7. Tes ing week 7. Week 41, Oc obe 2019. 8.3.8. Tes ing week 8. Week 44, No embe 2019. Na ional holidays. 49 8.3.9. Tes ing week 9. Week 51, Decembe 2019. Ch is mas. 8.3.10. Tes ing week 10. Week 1, Janua y 2020. Ma y s Day. 50 8.3.11. Tes ing week 11. Week 6, Feb ua y 2020. 8.3.12. Tes ing week 12. Week 10, Ma ch 2020. 51 8.3.13. Tes ing week 13. Week 20, May 2020. Qua an ine pe iod. 8.3.14. Tes ing week 14. Week 24, Jun 2020. Qua an ine pe iod. Page | i