scieee Open visual document viewer

Comparative Analysis of GDP Forecasting using Ensemble Tree Regression Models: Machine Learning vs. Econometric Models

Coelho, Ricardo Paulo Barbosa de Carvalho Almeida

Abstract

This thesis evaluates whether machine learning can have better results than well-established institutions in forecasting Portugal’s GDP growth using ensemble tree regression models, with the OECD’s economic outlook forecasts for Portugal serving as a benchmark based on data from 1962 to 2022 recovered from OECD and the Federal Reserve’s economic data. The findings reveal that, in general, machine learning did not surpass the forecasts of the OECD. However, machine learning demonstrated the potential for better accuracy at many points, despite a higher propensity for larger errors compared to traditional methods. Among the ensemble tree regression models tested, the gradient boosting regressor consistently provided the best forecasts across all horizons, outperforming the random forest, extreme gradient boosting, and light gradient boosting machine models. The results also suggest that machine learning performs better with a larger volume of data than with higher dimensionality, even if some data points seem irrelevant to forecast future values. This thesis highlights the potential of machine learning in time series forecasting as a complementary tool to traditional methods, rather than a complete replacement.

Full text

Mas e Deg ee P og am in Da a Science and Ad anced Analy ics Compa a i e Analysis o GDP Fo ecas ing using Ensemble T ee Reg ession Models: Machine Lea ning s. Econome ic Models Rica do Paulo Ba bosa de Ca alho Almeida Coelho Mas e Thesis p esen ed as pa ial equi emen o ob aining a Mas e ’s Deg ee in Da a Science and Ad anced Analy ics 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 MDSAA 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 Compa a i e Analysis o GDP Fo ecas ing using Ensemble T ee Reg ession Models: Machine Lea ning s. Econome ic Models by Rica do Paulo Ba bosa de Ca alho Almeida Coelho Mas e Thesis p esen ed as pa ial equi emen o ob aining he Mas e ’s deg ee in Da a Science and Ad anced Analy ics, wi h a specializa ion in Business Analy ics. Supe ised by P o . Jo ge Miguel Ven u a B a o, PhD NOVA In o ma ion Managemen School & Uni e si é Pa is-Dauphine PSL July, 2024 i STATEMENT OF INTEGRITY I he eby decla e ha ing conduc ed his academic wo k wi h in eg i y. I con i m ha I ha e no used plagia ism o any o m o undue use o in o ma ion o alsi ica ion o esul s along he p ocess leading o i s elabo a ion. I u he decla e ha I ha e ully acknowledged he Rules o Conduc and Code o Hono om he NOVA In o ma ion Managemen School. Lisbon, 07/07/2024 ii ABSTRACT This hesis e alua es whe he machine lea ning can ha e be e esul s han well-es ablished ins i u ions in o ecas ing Po ugal’s GDP g ow h using ensemble ee eg ession models, wi h he OECD’s economic ou look o ecas s o Po ugal se ing as a benchma k based on da a om 1962 o 2022 eco e ed om OECD and he Fede al Rese e’s economic da a. The indings e eal ha , in gene al, machine lea ning did no su pass he o ecas s o he OECD. Howe e , machine lea ning demons a ed he po en ial o be e accu acy a many poin s, despi e a highe p opensi y o la ge e o s compa ed o adi ional me hods. Among he ensemble ee eg ession models es ed, he g adien boos ing eg esso consis en ly p o ided he bes o ecas s ac oss all ho izons, ou pe o ming he andom o es , ex eme g adien boos ing, and ligh g adien boos ing machine models. The esul s also sugges ha machine lea ning pe o ms be e wi h a la ge olume o da a han wi h highe dimensionali y, e en i some da a poin s seem i ele an o o ecas u u e alues. This hesis highligh s he po en ial o machine lea ning in ime se ies o ecas ing as a complemen a y ool o adi ional me hods, a he han a comple e eplacemen . KEYWORDS Machine lea ning; Fo ecas ing; GDP; Po ugal; G adien Boos ing Reg esso Sus ainable De elopmen Goals (SDG): iii TABLE OF CONTENTS 1. In oduc ion ............................................................................................................. 1 2. Li e a u e e iew ..................................................................................................... 3 3. Me hodology ........................................................................................................... 6 3.1. Me hodology o he hesis ................................................................................ 6 3.2. OECD’s Me hodology ........................................................................................ 7 4. Da a ......................................................................................................................... 8 5. Machine lea ning echniques and model................................................................ 11 5.1. Ou lie s ........................................................................................................... 11 5.2. Fea u e selec ion ............................................................................................ 12 5.3. G adien Boos ing Reg esso ........................................................................... 13 5.4. Rolling window echnique ............................................................................... 15 5.5. Mul iple s eps ahead app oach ....................................................................... 18 6. Resul s ................................................................................................................... 22 7. Conclusions ............................................................................................................ 26 Bibliog aphical Re e ences.......................................................................................... 27 Appendix A ................................................................................................................. 32 Appendix B ................................................................................................................. 33 Appendix C ................................................................................................................. 34 Appendix D ................................................................................................................. 35 Appendix E ................................................................................................................. 40 Appendix F ................................................................................................................. 42 Appendix G ................................................................................................................. 43 Appendix H ................................................................................................................. 44 i LIST OF FIGURES Figu e 1 – T ain, alida ion, es spli ....................................................................................15 Figu e 2 – C oss alida ion ....................................................................................................16 Figu e 3 – Ancho ed olling window app oach ......................................................................17 Figu e 4 – Non-ancho ed olling window app oach ..............................................................17 Figu e 5 – Linea g aph o OECD’s and Machine Lea nings o ecas s o eal GDP g ow h o Po ugal compa ed wi h eal alues ..............................................................................22 LIST OF TABLES Table 1 - Table o me ics o RMSE, MPE, and R2 o OECD’s and Machine Lea nings o ecas s o eal GDP o Po ugal g ow h compa ed wi h eal alues ..................................... 23 i LIST OF ACRONYMS ADE A bi a ed Dynamic Ensemble AR Au o-Reg essi e ARIMA Au o-Reg essi e In eg a ed Mo ing A e ages BMA Bayesian Model A e aging CPI Consume P ice Index CRISP-DM C oss Indus y S anda d P ocess o Da a Mining GDP G oss Domes ic P oduc IMA In eg a ed Mo ing A e age LGBM Ligh G adien Boos ing Machine MIMO Mul i-Inpu Mul i-Ou pu ML Machine Lea ning MLP Mul i-Laye Pe cep on MPE Mean Pe cen age E o NiGEM Na ional Ins i u e Global Econome ic NN Neu al Ne wo k OECD O ganiza ion o Economic Coope a ion and De elopmen R2 R-squa ed RF Random Fo es Ac onym RMSE Roo Mean Squa ed E o Ac onym SARIMA Seasonal Au o eg essi e In eg a ed Mo ing A e age Ac onym SVM Suppo Vec o Machine Ac onym US Uni ed S a es Ac onym VAR Vec o Au o-Reg essi e Ac onym XGB Ex eme G adien Boos ing 7 A e a comp ehensi e analysis o he indings and he de elopmen o six unique models o each subsequen s ep, i was de e mined ha he mos e ec i e model, which op imizes RMSE, MPE, and R2, is he GBR ac oss all six s eps ahead. The me hodology employed o cons uc hese models adhe ed o he CRISP-DM. This in ol ed he use o ailo ed echniques o ime se ies o ecas ing wi hin supe ised models. These echniques included me hods such as he olling window and he mul iple s eps-ahead di ec s a egy. A mo e de ailed explana ion o hese echniques will be p o ided in sec ion 5. 3.2. OECD’S METHODOLOGY The OECD gene a es wo annual o ecas s, which encompass no only Po ugal's GDP g ow h bu also a a ie y o mac oeconomic a iables o all membe coun ies. These o ecas s a e p esen ed in epo s known as "Economic Ou look". The c ea ion o hese o ecas s is based on a combina ion o model-based analyses, s a is ical indica o models, and e en he judgmen o expe s and pee e iew p ocesses (OECD, 2013). In ecen yea s, he OECD has enhanced i s o ecas ing capabili y by inco po a ing nowcas ing o he cu en and subsequen qua e s. The p ima y ool o o ecas ing consis s o he Na ional Ins i u e Global Econome ic (NiGEM) model. This model is p e e ed o i s eliabili y o e s a is ical models ha u ilize high- equency indica o s o nea - e m o ecas ing (Tu ne , 2016). The da a ha he OECD u ilizes comp ises bo h "so " indica o s, such as business sen imen and consume su eys, and "ha d" indica o s, which include commodi y p ices, exchange a es, and indus ial p oduc ion (OECD, 2013). The o ecas ing p ocess o he OECD is la gely au oma ed, acili a ed by a Fo ecas En y Sys em ha cen alizes he necessa y da a. This sys em enables expe s associa ed wi h di e en coun ies o e i y assump ions, ou pu s, and new in o ma ion. I also allows hem o adjus necessa y pa ame e s o achie e he bes possible esul s. This p ocess akes in o conside a ion bo h da a-d i en p ocesses and expe knowledge o each coun y's cu en economic and geopoli ical en i onmen (OECD, 2013). This combina ion o da a-d i en p ocesses and expe knowledge ensu es a comp ehensi e and accu a e o ecas ing p ocess, conside ing bo h quan i a i e da a and quali a i e insigh s. a ailable. We a e mind ul o hese a ia ions and hei implica ions ( e e o Appendix B o guidance on accessing he la es his o ical da a ele an o OECD o ecas s a he ime). 8 4. DATA The o ecas ing exe cise is based on a comp ehensi e se o qua e ly mac oeconomic da a pe aining o Po ugal, which spans om he hi d qua e o 1962 o he second qua e o 2022. The a iables a e adjus ed o calenda e ec s and seasonali y, linked o he 2016 olume, and measu ed in he na ional cu ency 4 . In o al, he e a e nine a iables, each wi h a ange o 86 o 227 obse a ions. These nine a iables we e selec ed om an ini ial se o 51 h ough a igo ous ea u e selec ion p ocess (see subsec ion 5.2) aimed a maximizing model accu acy. Mos o hese a iables we e d awn om he OECD’s economic ou look da abase (OECD, 2019), as well as o he s udies, including Bolhuis & Rayne 's (2020) o ecas o Tu key’s g ow h and Haque's (2023) o ecas o Uni ed S a es GDP g ow h. The selec ed a iables a e:  Real GDP g ow h o Po ugal.  Real GDP g ow h o Spain.  Real GDP g ow h o F ance.  Real GDP g ow h o he Uni ed Kingdom.  Real GDP g ow h o he Uni ed S a es o Ame ica.  Cu ency spo exchange a e o he US dolla o he na ional cu ency o Po ugal.  Final Consump ion expendi u e o Po ugal.  Recession.  Yea . These a iables s ood ou p ima ily due o hei signi ican ela ionship wi h he a ge . In o ecas ing mos ime se ies, pa icula ly hose exhibi ing s ong au oco ela ion in he a ge a iable, his o ical da a i sel is c ucial (Beaumon e al., 1984). Conside ing ha o he s udies ha e e i ied ha GDP g ow h ha ing a s ong au oco ela ion e ec (A bia & Pi as, 2005), we ocused on u ilizing a iables such as he lag o Real GDP g ow h o Po ugal, ou a ge a iable, while also conside ing pas ecessions and he yea o enhance ou models' unde s anding o he empo al e olu ion o he a ge . Fo he o he a iables, nume ous s udies, bo h empi ical and heo e ical, including hose by Doyle & Faus (2002), demons a e a obus co ela ion be ween GDP g ow h among coun ies, which is inc easingly s eng hened by he apid globaliza ion o he wo ld economy. This co ela ion is pa icula ly e iden among ading pa ne s, as no ed by Jouini (2015), whe e ade plays a pi o al ole in d i ing his associa ion. Gi en ha Spain, F ance, he Uni ed 4 The e a e excep ions o he abo e-men ioned indica ions. In e ms o chain linked alues, OECD u ilizes coun ies' s a is ics, consequen ly, Spain's da a is linked o 2015 olume, F ance's o 2014 he Uni ed Kingdom’s o 2018, and he Uni ed S a es o 2017, a he han being ied o 2016 olume. (OECD ECONOMIC OUTLOOK Da abase In en o y, 2019). 9 Kingdom, and he Uni ed S a es (US) a e Po ugal’s majo expo des ina ions (OECD, 2017), i 's clea why hese ou a iables we e p ominen ly ea u ed. Addi ionally, Anchelache e al. (2015) iden i ies inal consump ion expendi u e as a signi ican p edic o o GDP g ow h in mul iple linea eg ession models. Mo eo e , exchange a es ha e been ecognized as in eg al o a coun y's economic g ow h, s imula ing i s economy (Macdonald, 2010). All he a iables men ioned abo e we e sou ced om he OECD da abank due o hei accessibili y and o ensu e di ec compa abili y wi h hei o ecas s. The only excep ion is he cu ency spo exchange a e o he US dolla o he na ional cu ency o Po ugal, which was e ie ed om he Fede al Rese e Economic Da a. While mac oeconomic da a is eadily a ailable and comes om eliable sou ces, i poses a signi ican challenge o ML due o i s low equency. Typically, his da a is only a ailable down o a qua e ly basis and lacks an ex ensi e his o ical ange. Al hough mos o he a iables used in he inal o ecas da e back o he hi d qua e o 1962, many a iables analysed in ea u e selec ion, such as inal consump ion expendi u e, he ne alue o p ima y income, and many mo e, s a la e . This limi a ion hinde s o ecas ing e o s, especially conside ing ha hal o he models being used, namely GBR and RF, canno handle null alues (Ben éjac e al., 2021). Fu he mo e, ML h i es in da a- ich en i onmen s (Jean e al., 2016). To add ess his issue, h ee con igu a ions o he da a we e de eloped: one including a iables da ing back o he hi d qua e o 1962, ano he om he i s qua e o 1998, and ano he om he i s qua e o 2001 5 . This will allow us o unde s and which is he op imal ade-o be ween obse a ions and he numbe o a iables. Fu he mo e, o gain a deepe unde s anding o how he models espond o he emo al o da a poin s, we will conduc a sensi i i y analysis on he bes models wi h espec o a ious his o ical pe iods. This analysis ocuses on he ime pe iods a he han he exis ence o absence o a iables, as abo e men ioned, o de e mine i concep d i should be inco po a ed in o ou o ecas . Concep d i being he idea ha ecen da a is mo e ele an o unde s anding e ol ing economic dynamics, and emo ing ou da ed da a poin s can imp o e accu acy (Woloszko, 2020). The his o ical pe iods conside ed s a om 1962, he ea lies a ailable da a poin , du ing Po ugal's ascis dic a o ship e a. We also examine da a s a ing om 1979, a ew yea s a e he es ablishmen o he cu en democ a ic s a e. Ano he key pe iod begins in 1998, when Po ugal was well-es ablished in he Eu opean Union. Addi ionally, we conside da a om 2002, ma king he u n o he new cen u y, he implemen a ion o he eu o, and ollowing he 5 I 's impo an o no e ha he a iables used in he da ase da ing back o he hi d qua e o 1962 a e also p esen in he pe spec i es o 1998 and 2001. Addi ionally, he a iables om 1998 a e included in he 2001 con igu a ion. Da a is included in he analysis i i is a ailable. 10 11 h o Sep embe o 2001, e o is a acks in he US. Las ly, we analyse da a s a ing om 2009, in he a e ma h o he 2008 economic ecession (Eu ydice, 2024). A e ex ensi e ea u e selec ion and model e alua ion, he op imal ade-o be ween obse a ions and he numbe o a iables led us o choose he abo e-men ioned ea u es. The insu iciency and low equency o da a conce ning Po ugal's mac oeconomic a iables will be u he elabo a ed upon in sec ion 6 o he pape . Be o e u ilizing he da a o modelling, se e al ans o ma ions we e pe o med, including no maliza ion using he s anda d scale . While his me hod isn' ideal due o one o ou o ecas ing objec i es being he a oidance o un ealis ic assump ions, pa icula ly ega ding he s a iona i y o inancial and economic ime se ies, i is necessa y because no maliza ion imp o es machine lea ning o ecas s. The o he commonly used me hods, such as min-max scaling and decimal scaling, a e e en less sui able as hey equi e knowledge o he minimum and/o maximum alues o a ime se ies, which is imp ac ical o ou ea u es and a ge s since u u e da a may all ou side he ange o he aining da a as indica ed by Ogasawa a e al. (2019). Fu he mo e, we make he con e sion o absolu e alues o hei pe cen age change o acili a e he o ecas ing o he a ge , which in his case is he GDP g ow h a e ( o mo e de ailed in o ma ion ega ding he ea u es, please e e o Appendices C and D). The modelling was de eloped using Py hon, wi h he Sciki -lea n lib a y being u ilized. This lib a y is a popula choice o ML due o i s e iciency and e sa ili y, o e ing a ange o supe ised lea ning algo i hms. 11 5. MACHINE LEARNING TECHNIQUES AND MODEL In his sec ion, we will p o ide a de ailed o e iew o he p ocedu es, me hodologies, and amewo ks ha we e u ilized in he de elopmen o ou models. The sec ion will be di ided in o se e al key componen s. Fi s , we will discuss he handling o ou lie s, o a he , he decision o no handle hem in his con ex . Nex , we will del e in o he p ocess o ea u e selec ion, whe e we will elabo a e on he me hodologies ha we e employed o de e mine he a iables ha we e used in he a ious models. Following his, we will discuss he speci ic model ha was employed in ou s udy. We will hen ou line he hype - uning echnique ha was applied, which in ol ed he use o a olling window app oach. Finally, we will explain how we o ecas ed mul iple s eps. Each o hese componen s plays a c ucial ole in he o e all modelling p ocess, and we will p o ide a comp ehensi e explana ion o each o p o ide a clea unde s anding o ou app oach. 5.1. OUTLIERS In he ealm o ML, a c i ical s ep in he p ep ocessing phase is he iden i ica ion and subsequen handling o ou lie s. These unique da a poin s, despi e hei po en ial a i y, can exe a signi ican in luence on o ecas ing ou comes, o en disp opo iona ely compa ed o o he obse a ions. This in luence becomes pa icula ly p onounced when dealing wi h complex da ase s, such as hose in ol ing mac oeconomic a iables. Ou lie s ha e he po en ial o skew subsequen obse a ions and can p o ide aluable insigh s in o he complex in e play be ween di e en a iables. Fu he mo e, ou lie s ha may seem highly unlikely could s ill mani es in he u u e, he eby a ec ing he accu acy o o ecas s (Boje , 2022; Rožanec e al., 2021). In he con ex o ou esea ch, i 's impo an o no e ha ou aining da a does no include pe iods ha we e in luenced by unp edic able ex e nal economic e en s such as he COVID- 19 pandemic o he con lic in Uk aine. Gi en he low equency o ou da a, we made he conscious decision o e ain all obse a ions, choosing no o emo e any da a poin s based on hem being ou lie s. This decision was made wi h he unde s anding ha hese ou lie s could po en ially p o ide aluable insigh s and con ibu e o he obus ness o ou o ecas ing model. 12 5.2. FEATURE SELECTION In he con ex o ea u e selec ion, we me iculously c a ed a comp ehensi e p ocess. This p ocess was mul i ace ed, in ol ing he e alua ion o ea u e impo ance ou comes de i ed om a a ie y o me hods, he in eg a ion o hese ou comes, he comple e dis ega d o hese ou comes, and he exclusi e conside a ion o he lagged a ge . This in ica e app oach was implemen ed ac oss h ee sepa a e da ase s, each cha ac e ized by di e en quan i ies o obse a ions and ea u es, as desc ibed in he six h pa ag aph o sec ion 4. The need o such di e en ia ion a ose om he di e se ela ionships ha exis be ween ea u es, especially when ewe a iables o obse a ions come in o play (Jo ić e al., 2015). The me hods we employed in ou app oach included Spea man's co ela ion, embedded echniques, and w appe me hods ha le e age decision ees. These me hods we e chosen o e al e na i es such as ecu si e ea u e selec ion, Lasso embedded me hods, and dimensionali y educ ion echniques. The p ima y eason o his selec ion was ha he la e g oup o me hods elies on linea ela ionships be ween a iable (Jo ić e al., 2015). The main d i ing o ce behind ou decision o use ML o e econome ics was ML's abili y o ci cum en he assump ions ha a e deeply ing ained in adi ional s a is ical me hods. The e o e, i we we e o e ain echniques ha a e cen ed a ound linea ela ionships, i would be in di ec con adic ion wi h he undamen al objec i e o his hesis. This objec i e is o explo e and le e age he powe o ML in unde s anding and in e p e ing complex ela ionships be ween a iables, which adi ional s a is ical me hods migh no be able o ully cap u e due o hei inhe en assump ions (Kaushik, 2020). In essence, ou ea u e selec ion p ocess was designed o be obus and lexible, capable o adap ing o he unique cha ac e is ics o each da ase and he complex ela ionships be ween hei ea u es. This app oach allows us o ully ha ness he po en ial o ML in ou esea ch. 13 5.3. GRADIENT BOOSTING REGRESSOR The GBR is a supe ised ML model ha is speci ically designed o eg ession asks. I ope a es using a sequen ial ensemble app oach, which in ol es he u iliza ion o base-lea ne s o i e a i ely e ine i s p edic ions. The unique s eng h o GBR lies in i s abili y o enhance i s o ecas s wi h each i e a ion by lea ning om he e o s o p e ious p edic ions. This i e a i e lea ning p ocess allows GBR o con inuously imp o e i s p edic i e accu acy, making i a powe ul ool o eg ession asks. This p ocess o lea ning om pas e o s and e ining u u e p edic ions is a de ining cha ac e is ic o GBR and is wha dis inguishes i om o he ensemble models (Na ekin & Knoll, 2013). Models like RF, while also being ensemble models, do no possess his i e a i e lea ning capabili y. Ins ead, hey ely on he simple agg ega ion o he ou pu s o hei base-lea ne s, wi hou any mechanism o lea ning om pas e o s o e ining u u e p edic ions. This di e ence in app oach is wha se s GBR apa and con ibu es o i s supe io pe o mance in eg ession asks (Na ekin & Knoll, 2013). The equa ion below illus a es he sum o es ima ion unc ions, he key componen desc ibed abo e. This equa ion ep esen s he cumula i e e ec o he es ima ions, which a e e ined i e a i ely o imp o e he model's p edic ions. Howe e , i 's impo an o no e ha his equa ion does no ye show he sum o he base-lea ne s, which is ano he c ucial pa o he GBR model's ope a ion. 𝑓󰆹(𝑥)= ∑𝑓𝑖  𝑀 𝑖=0 (𝑥), (1) Whe e 𝑓󰆹(𝑥) deno es he es ima ion unc ion, 𝑀 is numbe o i e a ions, and he i s i e a ion is he ini ial guess o he model. Building on he p e ious discussion, he GBR model's ope a ion is unde pinned by se e al key componen s. These include he loss unc ion, he base lea ne , and he numbe o i e a ions. The loss unc ion se es as a me ic, quan i ying he dispa i y be ween he p edic ions gene a ed by he model and he ac ual da a. The base lea ne s, which a e inco po a ed i e a i ely manne o enhance he model's o ecas s, can be cons uc ed using a a ie y o me hods, including decision ees and splines, among o he s (Na ekin & Knoll, 2013). This i e a i e lea ning p ocess is encapsula ed in he equa ion ha ollows. This equa ion demons a es how each i e a ion o he model is compu ed, wi h each new p edic ion being 14 he sum o he p e ious es ima ion unc ion and he p oduc o he base lea ne and he lea ning a e. This equa ion, he e o e, p o ides a ma hema ical ep esen a ion o he GBR model's i e a i e lea ning p ocess, highligh ing how i con inuously e ines i s p edic ions o imp o e accu acy (Na ekin & Knoll, 2013). 𝑓𝑖 = 𝑓𝑖−1  + ρ𝑖ℎ(𝑥,θ𝑖), (2) Whe e 𝑓𝑖  deno es he es ima ion unc ion o he i e a ion 𝑖, 𝑓𝑖−1  he esul o he p e ious i e a ion o he es ima ion unc ion, ρ𝑖 being he lea ning a e associa ed o he base-lea ne o said i e a ion, and ℎ(𝑥,θ𝑖) he base lea ne o he i e a ion. The ope a ional p ocess o he GBR algo i hm can be b oken down in o he ollowing s eps: 1. Ini ializa ion: The es ima ion unc ion is ini ialized wi h a cons an alue, ypically he mean o he a ge a iable. 2. I e a ion Loop: a. Calcula e Nega i e G adien : The nega i e g adien o he loss unc ion wi h espec o he p edic ed alues is compu ed a each i e a ion. b. Fi a New Base Lea ne : A new base lea ne is i ed o he nega i e g adien calcula ed in he p e ious s ep. c. Upda e Es ima ion Func ion: The es ima ion unc ion is upda ed by adding he p edic ion o he new base lea ne , which is mul iplied by a lea ning a e, o he p e ious es ima ion unc ion. GBR s ands ou as an ensemble model ha is highly p o icien a cap u ing complex non-linea unc ions. I s e ec i eness in o ecas ing eal-wo ld da a has been ex ensi ely documen ed. One o he key s eng hs o GBR is i s excep ional lexibili y in cus omiza ion, pa icula ly in he selec ion o loss unc ions and base lea ne s. Howe e , his e sa ili y comes wi h a ade- o in e ms o compu a ional cos . Due o i s i e a i e op imiza ion app oach, GBR is mo e compu a ionally in ensi e compa ed o o he ensemble models such as RF (Na ekin & Knoll, 2013). In ou o ecas ing model, we u ilized he mean squa ed e o loss unc ion. Al hough his is no one o ou p ima y me ics, i assis s in op imizing he RMSE and R2, while also penalizing signi ican e o s. Fu he mo e, we chose decision ees as ou base lea ne s. This choice was 15 made because decision ees do no ely on assump ions o linea i y, hey con ibu e o he di e si y o he model, and hey p o ide compu a ional e iciency (Chicco e al., 2021). 5.4. ROLLING WINDOW TECHNIQUE When i comes o ine- uning pa ame e s o ML models, he e a e a ious app oaches. In his subsec ion, we will s a by desc ibing one o he simples me hods: he ain, alida ion, and es me hod. This will be ollowed by an explana ion o he c oss- alida ion me hod. Finally, we will discuss he olling window echnique, including i s wo a ian s, which is he me hod we u ilized. In he p ocess o enhancing he pe o mance o a model ia hype pa ame e uning, a p e alen me hodology in ol es he di ision o he da ase in o h ee dis inc segmen s: aining, alida ion, and es se s ( e e o Figu e 1). The aining da a se es he pu pose o i ing he model, u ilizing he pa ame e s ha ha e been de ined. On he o he hand, he alida ion se is exclusi ely se aside o he ask o choosing he mos e ec i e model, he eby a oiding any bias ha could po en ially be in oduced i he es se was used o his pu pose. The inal segmen , he es se , is hen employed o assess he pe o mance o he selec ed model when i is exposed o da a ha i has no encoun e ed be o e (Fi & Ga iga, 2010). This app oach ensu es a obus and unbiased e alua ion o he model's abili y o gene alize om he aining da a o unseen da a, which is a c i ical aspec o model pe o mance in p ac ical applica ions. Figu e 1 – T ain, alida ion, es spli . 16 In ci cums ances whe e he a ailable da a is sca ce, such as in ou case, he adi ional app oach o di iding he da a in o aining, alida ion, and es se s can esul in a subs an ial educ ion o aining da a. To coun e ac his issue, he echnique o k- old c oss- alida ion is equen ly u ilized. This me hod de ia es om he igid pa i ioning in o aining, alida ion, and es se s. Ins ead, i in ol es he di ision o he aining da a in o k- olds, which a e gene ally subse s o equal size. Each o hese olds is subsequen ly used as a alida ion se , while he model is ained using he emaining k-1 olds. This p ocedu e is ca ied ou o each old, ensu ing ha e e y da a poin is used o bo h aining and alida ion pu poses ( e e o Figu e 2). Consequen ly, his allows o a mo e comp ehensi e assessmen o he model's pe o mance, wi hou he need o o ei aluable da a (Fi & Ga iga, 2010). Figu e 2 – C oss- alida ion echnique. 23 Table 1 – Table o me ics o RMSE, MPE, and R2 o OECD’s and Machine Lea nings o ecas s o eal GDP g ow h o Po ugal compa ed wi h eal alues. Fo ecas Me ic All ins ances (10 ins ances) 1-2 s eps-ahead Q3-Q4 2019 & Q3-Q4 2022 (4 ins ances) 3-6 s eps-ahead Q1-Q4 2022 (4 ins ances) OECD RMSE 5.8373 1.5432 3.6095 MPE -94.58% 45.99% -282.65% R2 0.0891 -4.0518 -0.0041 ML RMSE 10.0153 0.3279 2.3132 MPE -163.14% 19.59% -448.86% R2 -0.5628 -0.0735 0.5876 No e: he eal alues o Po ugal’s eal GDP g ow h we e e ie ed om he Economic Ou look o Decembe 2023 o OECD. Upon examina ion, i was ound ha each o he six indi idual models, ained o s ep-by- s ep o ecas ing om one o six s eps ahead, achie ed hei highes accu acy using he GBR model. Addi ionally, ou ou o he six models used da a s a ing om 1962. while wo models used da a s a ing om 1998 when only conside ing he ime pe iods o 1962, 1998, and 2001. I was also e i ied ha ou o he six models employed a non-ancho ed me hod o he olling window echnique, whe eas he emaining wo used he ancho ed me hod. Rega ding he model pa ame e s, no speci ic pa e n was obse ed, as each indi idual model p edominan ly used unique se s o maximize hei accu acy in es ing (see Appendix E). Rega ding he sensi i i y analysis ac oss he ime pe iods o 1962, 1979, 1998, 2002, and 2009 o he bes models and espec i e pa ame e s in each s ep-ahead, we obse e ha o he i s s ep-ahead, he bes me ics we e 0.60 o RMSE, -7% o MPE, and 0.29 o R², s a ing om 1962. Fo he second s ep-ahead, he bes me ics we e 0.31 o RMSE, -55% o MPE, and -0.47 o R², s a ing om 1998. Fo he hi d s ep-ahead, he bes me ics we e 0.76 o RMSE, 14% o MPE, and -0.12 o R², s a ing om 1962. Fo he ou h s ep-ahead, he bes me ics we e 0.85 o RMSE, -8% o MPE, and -0.42 o R², s a ing om 1962. Fo he i h s ep-ahead, he bes me ics we e 0.80 o RMSE, 12% o MPE, and -0.25 o R², also s a ing om 1962. Fo he six h s ep-ahead, he bes me ics we e 0.81 o RMSE, -30% o MPE, and -0.28 o R², s a ing om 1998 (see Appendix F). We can e i y ha he op imal ime pe iods a e he same as when analysing wi h 1962, 1998, and 2001, as seen abo e. Al hough i was e i ied ha o mos s eps he bes ime pe iod o conside is s a ing om 1962, we mus conside ha no single ime span maximizes all h ee me ics in es o any o he s eps-ahead. Fo ins ance, in he i s s ep, s a ing om he mos ecen pe iod, ha being 2009, we achie e he lowes RMSE wi h a alue o 0.25. The bes MPE is wi h he da a s a ing in 1962 wi h -7%, and o R², i is s a ing om 1979, wi h a alue o 0.36. We a i ed a he abo e-men ioned conclusions using he same me hod de eloped o ind he op imal 24 pa ame e s and bes model o he o iginal o ecas (see Appendix G). I we we e o only conside RMSE, 2009 would be he bes s a ing poin o all he s eps, showcasing how much he e alua ion me hod can a ec he conclusions o analysis and showing how pa amoun i ’s o ha e an a ay o me ics o analyse (see Appendix F). Gi en he ou comes discussed ea lie we can now discuss an a ay o conclusions and ques ions. We will s a o wi h he mos p ominen ques ion ega ding he inal o ecas and ha will a ec di ec ly i ou hypo hesis was con i med, how did he OECD manage o ou pe o m ML so signi ican ly in he o e all assessmen ? The disc epancy s ems om he p edic ions o he hi d qua e o 2021 when employing one s ep-ahead o ecas . While he OECD nea ly achie ed a pe ec o ecas , displaying a RMSE o 0.27 and a MPE o 2%, he ML model's o ecas s ell sho . The ML model exhibi ed signi ican unde pe o mance wi h a RMSE o 8.71 and a MPE o 70%. So, a e hese esul s, we mus conside why exac ly ML was unable o o ecas he hi d qua e o 2021 in such an e ec i e way as he ones o 2019 and 2022 ela i e o OECD’s o ecas . In add essing he ini ial inqui y, i 's impe a i e o acknowledge ha ML excels in da a- ich se ings. Ou o ecas ing elies on mac oeconomic da a a ailable only qua e ly, which can hinde i s o ecas ing accu acy compa ed o mo e con en ional me hods like hose employed by he OECD (Lim & Zoh en, 2021). In ce ain cases, ML o ecas s may e en pe o m wo se han simple models (Mak idakis e al., 2018). Mo eo e , ML ou comes a e highly sensi i e o a ailable da a; a ious s udies indica e ha he same model can ou pe o m econome ic me hods in speci ic scena ios while unde pe o ming in o he s, depending on he da ase u ilized (Boje , 2022; Woloszko, 2020). I 's wo h men ioning ha while ML was no able o ou pe o m hose o he OECD, as e idenced in ou esul s (see g aph 1 and able 1), hey we e signi ican ly penalized o hei inaccu a e p edic ion o he i s qua e o 2021 ela i e o he OECD's o ecas . Rega ding he o he conclusions, in ou analysis o a ious o ecas ing models, i was consis en ly e iden ha GBR ou pe o med o he models ac oss all o ecas ho izons in e ms o RMSE, MPE, and R2 me ics. Addi ionally, i was e i ied a e sensi i e analysis ha , o he mos pa , he models pe o med bes when u ilizing he g ea es numbe o ins ances as possible, using da a s a ing om 1962 and he use o non-ancho ed olling window echnique. These obse a ions unde sco e he signi icance o concep d i by p io i ising a highe numbe o ins ances o e only conside ing mo e ecen da a. Such happens due o ML models exhibi ing a p e e ence o highe equency da a, as lowe ing he numbe o obse a ions u he de e io a es o ecas accu acy gi en he al eady low equency o economic da a. Despi e he ad an age o ML in iden i ying complex pa e ns wi hou elying on linea assump ions, ou ex ensi e ea u e selec ion p ocess educed he ini ial pool o 51 a iables 25 o jus a ew essen ial ones. Mos o he a iables used demons a ed a s ong linea ela ionship wi h he a ge , as e idenced by Spea man’s co ela ion (check Appendix H). O he s udies, such as Woloszko (2020), ha e eached simila conclusions, no ing ha iden ical ML models pe o m be e wi h a iables ha exhibi linea ela ionships wi h he a ge . In essence, he hesis did no con i m i s hypo hesis o "Can ML echniques, speci ically ensembles o eg ession ees, a i e a be e esul s han OECD’s o ecas o he GDP g ow h o Po ugal?” by e i ying ha ML did no ou pe o m OECD's o ecas s in all h ee me ics (RMSE, MPE, and R2) o en di e en o ecas s spanning he las wo qua e s o 2019, he las wo qua e s o 2021, and he en i e y o 2022 (wi h he las wo qua e s o ecas ed wice). While ML o en su passed OECD p edic ions in a ious cases, i gene ally unde es ima ed o e all economic g ow h, consis en ly displaying lowe MPE alues compa ed o OECD o ecas s. Addi ionally, ML o ecas s occasionally di e ged signi ican ly om ac ual alues, no ably obse ed in he hi d qua e o 2021. Hence, i 's c ucial o subjec ML o ecas ing echniques o ho ough e alua ion agains es ablished benchma ks such as OECD be o e widesp ead adop ion in economic ins i u ions, as ad oca ed in ecen li e a u e (Boje , 2022). 26 7. CONCLUSIONS The objec i e o his hesis was o e alua e whe he ML could su pass o ecas s p oduced by es ablished ins i u ions in o ecas ing Po ugal’s GDP g ow h using ensemble eg ession ee models whils using OECD’s economic ou look as a benchma k. The esul s e eal a complex pic u e o ML's s eng hs and limi a ions in economic o ecas ing. The p ima y indings indica e ha while ML achie ed supe io o ecas s compa ed o he OECD in mos cases, i ul ima ely unde pe o med due o one signi ican ou lie ha de ia ed subs an ially om he ac ual alue. This ou lie unde sco es he sensi i i y o ML models o speci ic da a poin s and hei po en ial o la ge e o s in ce ain scena ios, sugges ing ha ML is, o e all, less eliable han o ecas s p oduced by es ablished ins i u ions. Se e al ac o s con ibu ed o hese esul s. ML models h i e in da a- ich en i onmen s and pe o m be e wi h high equency da a. Howe e , he eliance on qua e ly mac oeconomic da a cons ained hei pe o mance. Addi ionally, al hough ML can cap u e complex pa e ns, he bes -pe o ming models we e hose wi h ewe a iables, ypically exhibi ing s ong linea ela ionships wi h he a ge , hus diminishing ML's ad an ages. Fu he mo e, he s udy ound ha GBR was he mos e ec i e model o o ecas ing Po ugal’s GDP g ow h ac oss all ime ho izons. I also showcased a p e e ence o mo e obse a ion poin s o e a la ge numbe o a iables sugges ing ha ML models alue his o ical da a e en when i appea s less ele an o u u e o ecas s. In conclusion, while ML models ha e shown po en ial in speci ic ins ances, hei o e all pe o mance in his s udy was no be e han o ecas s p oduced by es ablished ins i u ions o GDP g ow h o ecas ing. The indings sugges ha ML should be iewed as a complemen a y ool a he han a subs i u e o es ablished echniques. The mixed esul s highligh he impo ance o benchma king ML o ecas s agains adi ional me hods be o e conside ing hei b oade applica ion in economic o ecas ing. Fu u e esea ch should explo e in eg a ing ML wi h o ecas s p oduced by es ablished ins i u ions o le e age he s eng hs o bo h app oaches, po en ially leading o mo e obus and accu a e o ecas s. 27 BIBLIOGRAPHICAL REFERENCES Asho eh, A., B a o, J. M., & Ayuso, M. (2022). A New Ensemble Lea ning S a egy o Panel Time-Se ies Fo ecas ing wi h Applica ions o T acking Respi a o y Disease Excess Mo ali y du ing he COVID-19 pandemic. Applied So Compu ing. Volume 128, A icle 109422. Anchelache, C., Manole, A., & Anghel, M. (2015). Analysis o inal consump ion and g oss in es men in luence on GDP – mul iple linea eg ession model. h p://www.icaap.o g A bia, G., & Pi as, G. (2005). Con e gence in pe -capi a GDP ac oss Eu opean egions using panel da a models ex ended o spa ial au oco ela ion e ec s. www.isae.i Beaumon , C., Mak idakis, S., Wheelw igh , S. C., & McGee, V. E. (1984). Fo ecas ing: Me hods and Applica ions. The Jou nal o he Ope a ional Resea ch Socie y, 35(1), 79. h ps://doi.o g/10.2307/2581936 Ben Taieb, S., So jamaa, A., & Bon empi, G. (2010). Mul iple-ou pu modeling o mul i-s ep-ahead ime se ies o ecas ing. Neu ocompu ing, 73(10–12), 1950– 1957. h ps://doi.o g/10.1016/j.neucom.2009.11.030 Ben éjac, C., Csö gő, A., & Ma ínez-Muñoz, G. (2021). A compa a i e analysis o g adien boos ing algo i hms. A i icial In elligence Re iew, 54(3), 1937–1967. h ps://doi.o g/10.1007/s10462-020-09896-5 Boje , C. S. (2022a). Unde s anding machine lea ning-based o ecas ing me hods: A decomposi ion amewo k and esea ch oppo uni ies. In e na ional Jou nal o Fo ecas ing, 38(4), 1555–1561. h ps://doi.o g/10.1016/j.ij o ecas .2021.11.003 Boje , C. S. (2022b). Unde s anding machine lea ning-based o ecas ing me hods: A decomposi ion amewo k and esea ch oppo uni ies. In e na ional Jou nal o Fo ecas ing, 38(4), 1555–1561. h ps://doi.o g/10.1016/j.ij o ecas .2021.11.003 Bolhuis, M. A., & Rayne , B. (2020). Deus ex Machina? A F amewo k o Mac o Fo ecas ing wi h Machine Lea ning, WP/20/45, Feb ua y 2020. Bon empi, G., Ben Taieb, S., & Le Bo gne, Y. A. (2013). Machine lea ning s a egies o ime se ies o ecas ing. Lec u e No es in Business In o ma ion P ocessing, 138 LNBIP, 62–77. h ps://doi.o g/10.1007/978-3-642-36318-4_3 28 B a o, J. M. (2021). Fo ecas ing Longe i y o Financial Applica ions: A Fi s Expe imen wi h Deep Lea ning Me hods. In: Kamp M. e al. (eds) Machine Lea ning and P inciples and P ac ice o Knowledge Disco e y in Da abases. ECML PKDD 2021. Communica ions in Compu e and In o ma ion Science, ol 1525. Sp inge , Cham. pp. 232–249. h ps://doi.o g/10.1007/978-3-030- 93733-1_17. B a o, J. M. (2021). Fo ecas ing mo ali y a es wi h Recu en Neu al Ne wo ks: A p elimina y in es iga ion using Po uguese da a. CAPSI 2021 P oceedings 7 (A as da 21ª Con e ência da Associação Po uguesa de Sis emas de In o mação 2021). h ps://aisel.aisne .o g/capsi2021/7/ B a o, J. M. (2022). P icing Pa icipa ing Longe i y-Linked Li e Annui ies: A Bayesian Model Ensemble app oach. Eu opean Ac ua ial Jou nal, 12, 125–159. B a o, J. M., & Asho eh, A. (2023). Ensemble Me hods o Consume P ice In la ion Fo ecas ing. CAPSI 2023 - 23 d Con e ence o he Po uguese Associa ion o In o ma ion Sys ems (23ª Con e ência da Associação Po uguesa de Sis emas de In o mação), pp. 317 336. DOI: 10.18803/capsi. 23.317-336. B a o, J. M., & Ayuso, M. (2021) Fo ecas ing he Re i emen Age: A Bayesian Model Ensemble App oach. In: Rocha Á., Adeli H., Dzemyda G., Mo ei a F., Ramalho Co eia A.M. (eds) T ends and Applica ions in In o ma ion Sys ems and Technologies. Wo ldCIST 2021. Ad ances in In elligen Sys ems and Compu ing, Volume 1365 AIST, pp. 123 – 135. Sp inge , Cham. B a o, J. M., & Ayuso, M. (2021). Linking Pensions o Li e Expec ancy: Tackling Concep ual Unce ain y h ough Bayesian Model A e aging. Ma hema ics, 9(24): 3307, p. 1 27. B a o, J. M., & San os, V. (2021). Back es ing Recu en Neu al Ne wo ks wi h Ga ed Recu en Uni : P obing wi h Chilean Mo ali y Da a. In: Ga cia, M.V., Fe nández-Peña, F., Go dón-Gallegos, C. (eds) Ad ances and Applica ions in Compu e Science, Elec onics, and Indus ial Enginee ing. CSEI 2021. Lec u e No es in Ne wo ks and Sys ems, ol 433, Sp inge , Cham. pp. 159–174. h ps://doi.o g/10.1007/978-3-030-97719-1_9. B a o, J. M., Ayuso, M. (2020). [Mo ali y and li e expec ancy o ecas s using bayesian model combina ions: An applica ion o he po uguese popula ion] P e isões de mo alidade e de espe ança de ida median e combinação Bayesiana de modelos: Uma aplicação à população po uguesa. RISTI - Re is a Ibe ica de Sis emas e Tecnologias de In o macao, E40, 128–144. 29 B a o, J. M., Ayuso, M., Holzmann, R. & Palme , E. (2021). Add essing he Li e Expec ancy Gap in Pension Policy. Insu ance: Ma hema ics and Economics, 99, 200-221. B a o, J. M., Ayuso, M., Holzmann, R., and Palme , E. (2023). In e gene a ional Ac ua ial Fai ness when Longe i y Inc eases: Amending he Re i emen Age. Insu ance: Ma hema ics and Economics 113, 161-184. Chicco, D., Wa ens, M. J., & Ju man, G. (2021). The coe icien o de e mina ion R- squa ed is mo e in o ma i e han SMAPE, MAE, MAPE, MSE and RMSE in eg ession analysis e alua ion. Pee J Compu e Science, 7, 1–24. h ps://doi.o g/10.7717/PEERJ-CS.623 Doyle, B. M., & Faus , J. (2002). An In es iga ion o Co-mo emen s among he G ow h Ra es o he G-7 Coun ies. Eu ydice. (2024). His o ical de elopmen Po ugal’s his o y. Fi, M. O., & Ga iga, G. C. (2010). Pe mu a ion Tes s o S udying Classi ie Pe o mance Ma kus Ojala. In Jou nal o Machine Lea ning Resea ch (Vol. 11). Ga cia J. (2020). Fo ecas ing Po uguese GDP A compa ison o uni a ia e ime se ies models. Goule Coulombe, P., Le oux, M., S e ano ic, D., & Su p enan , S. (2020). How is Machine Lea ning Use ul o Mac oeconomic Fo ecas ing? *. Haque, S. (2023). Jou nal o Ma hema ics and S a is ics S udies Re ail Demand Fo ecas ing Using Neu al Ne wo ks and Mac oeconomic Va iables. h ps://doi.o g/10.32996/jmss Jean, N., Bu ke, M., Xie, M., Da is, W. M., Lobell, D. B., & E mon, S. (2016). Combining sa elli e image y and machine lea ning o p edic po e y. h p://science.sciencemag.o g/ Jouini, J. (2015). Linkage be ween in e na ional ade and economic g ow h in GCC coun ies: Empi ical e idence om PMG es ima ion app oach. Jou nal o In e na ional T ade and Economic De elopmen , 24(3), 341–372. h ps://doi.o g/10.1080/09638199.2014.904394 Jo ić, A., B kić, K., & Boguno ić, N. (2015). A e iew o ea u e selec ion me hods wi h applica ions. Jung, J.-K., Pa nam, M., & Te -Ma i osyan, A. (2018). An Algo i hmic C ys al Ball: Fo ecas s-based on Machine Lea ning, WP/18/230, No embe 2018. 30 Kaushik, M. (2020). Fo ecas ing Fo eign Exchange Ra e: A Mul i a ia e Compa a i e Analysis be ween T adi ional Econome ic, Con empo a y Machine Lea ning & Deep Lea ning Techniques I. I NTRODUCTION. Lim, B., & Zoh en, S. (2021). Time-se ies o ecas ing wi h deep lea ning: A su ey. In Philosophical T ansac ions o he Royal Socie y A: Ma hema ical, Physical and Enginee ing Sciences (Vol. 379, Issue 2194). Royal Socie y Publishing. h ps://doi.o g/10.1098/ s a.2020.0209 Macdonald, R. (2010). THE ROLE OF THE EXCHANGE RATE IN ECONOMIC GROWTH: A EURO-ZONE PERSPECTIVE NATIONAL BANK OF BELGIUM WORKING PAPERS- RESEARCH SERIES. h p://www.nbb.be Maehashi, K., & Shin ani, M. (2020). Mac oeconomic Fo ecas ing Using Fac o Models and Machine Lea ning: An Applica ion o Japan. Jou nal o he Japanese and In e na ional Economies, 58. h ps://doi.o g/10.1016/j.jjie.2020.101104 Mak idakis, S., Spilio is, E., & Assimakopoulos, V. (2018). S a is ical and Machine Lea ning o ecas ing me hods: Conce ns and ways o wa d. PLoS ONE, 13(3). h ps://doi.o g/10.1371/jou nal.pone.0194889 Na ekin, A., & Knoll, A. (2013). G adien boos ing machines, a u o ial. F on ie s in Neu o obo ics, 7(DEC). h ps://doi.o g/10.3389/ nbo .2013.00021 OECD. (2013). Fo ecas ing me hods and analy ical ools. h ps://doi.o g/10.1787/275257320252 OECD. (2017). PORTUGAL TRADE AND INVESTMENT STATISTICAL NOTE. www.oecd.o g/in es men / ade- OECD. (2019). OECD ECONOMIC OUTLOOK Da abase In en o y. h p://www.oecd.o g/eco/ou look/economicou look.h m Ogasawa a, E., Ma inez Leona do, Oli ei a Daniel, Zimb ão Ge aldo, & Ma oso Gisele. (2019). Adap i e No maliza ion: A No el Da a No maliza ion App oach o Non-S a iona y Time Se ies. Rožanec, J., T ajko a, E., Kenda, K., Fo una, B., & Mladenić, D. (2021). Explaining bad o ecas s in global ime se ies models. Applied Sciences (Swi ze land), 11(19). h ps://doi.o g/10.3390/app11199243 Soa es, I. C. (2021). P edic ion o he qua e ly GDP in Po ugal: The applica ion o he machine lea ning ools in p esence o SARS-CoV-2 pandemic. 31 Soybilgen, B., & Yazgan, E. (2021). Nowcas ing US GDP Using T ee-Based Ensemble Models and Dynamic Fac o s. Compu a ional Economics, 57(1), 387–417. h ps://doi.o g/10.1007/s10614-020-10083-5 The Wo ld Bank. (2022). Wo ld De elopmen Repo 2022. h ps://www.wo ldbank.o g/en/publica ion/wd 2022/b ie /chap e -1- in oduc ion- he-economic-impac s-o - he-co id-19-c isis Tu ne , D. (2016). THE USE OF MODELS IN PRODUCING OECD MACROECONOMIC FORECASTS. www.oecd.o g/eco/wo kingpape s U.S. Cem e s o Disease Con ol and P e en ion. (2019). CDC Museum COVID-19 Timeline. h ps://www.cdc.go /museum/ imeline/co id19.h ml Woloszko N. (2020). ADAPTIVE TREES-A NEW APPROACH TO ECONOMIC FORECASTING. Yoon, J. (2021). Fo ecas ing o Real GDP G ow h Using Machine Lea ning Models: G adien Boos ing and Random Fo es App oach. Compu a ional Economics, 57(1), 247–265. h ps://doi.o g/10.1007/s10614-020-10054-w 32 APPENDIX A Table wi h he da a a ailable a he ime o he issue ega ding eal GDP g ow h a e o Po ugal o OECD om pe iod o pe iod, exp essed annually. Da e No embe 2019 Decembe 2021 Decembe 2022 No embe 2023 Di e ence be ween No embe 2023 and alues used o he o ecas Q1-2019 2.33% 3.57% 3.58% 3.52% 1.19% Q2-2019 2.30% 2.28% 2.30% 2.37% 0.06% Q3-2019 - 1.86% 1.82% 1.82% - Q4-2019 - 3.34% 3.32% 3.38% - Q1-2020 - -16.52% -16.32% -16.40% - Q2-2020 - -48.41% -48.09% -48.06% - Q3-2020 - 72.92% 72.41% 72.50% - Q4-2020 - 1.10% 1.49% 1.41% - Q1-2021 - -12.48% -9.89% -9.39% 3.09% Q2-2021 - 19.32% 18.91% 19.03% -0.29% Q3-2021 - - 11.60% 12.47% - Q4-2021 - - 7.98% 7.79% - Q1-2022 - - 9.88% 9.57% -0.31% Q2-2022 - - 0.51% 0.23% -0.28% Q3-2022 - - - 1.98% - Q4-2022 - - - 2.05% - No e: The only alues used o he o ecas we e he wo lags be o ehand, he e o e, he only ele an alues o he o ecas a e he i s and second qua e s o 2019, 2021, and 2022. 39 Enginee ed Taxes on p oduc ion and impo s less subsidies: axes and subsidies on p oduc ion and impo s ne pe cen age Pe cen age change om pe iod o pe iod; adjus ed o calenda and seasonal ac o s; chain-linked 2016 Calcula ion o : (Taxes on p oduc ion and impo s less subsidies: axes on p oduc ion and impo s - Taxes on p oduc ion and impo s less subsidies: subsidies on p oduc ion and impo s) / Taxes on p oduc ion and impo s less subsidies 1998-Q1 o 2022-Q2 No Enginee ed Qua e The qua e being analysed 1960-Q2 o 2022-Q2 No Enginee ed Mon h The mon h being analysed 1960-Q2 o 2022-Q2 No 40 APPENDIX E Table wi h he de ails o he models de eloped conside ing each s ep-ahead. S ep- ahead Model Time pe iod Rolling Window me hod Va iables Pa ame e s 1s GBR 1962-Q3 o 2019-Q2 Ancho ed [Real GDP g ow h o Po ugal, Real GDP g ow h o F ance, Real GDP g ow h o Spain, Real GDP g ow h o Uni ed S a es o Ame ica, Real GDP g ow h o Uni ed Kingdom, Cu ency spo exchange a e o he US dolla o he na ional cu ency o Po ugal, Recession, Yea ] es ima o s: 150 lea ning_ a e: 0.1 max_dep h: 3 min_samples_spli : 3 min_samples_lea : 3 2nd GBR 1998-Q1 o 2019-Q2 Non- ancho ed [Real GDP g ow h o Po ugal] es ima o s: 50 lea ning_ a e: 0.05 max_dep h: 1 min_samples_spli : 2 min_samples_lea : 6 3 d GBR 1962-Q3 o 2019-Q2 Non- ancho ed [Real GDP g ow h o Po ugal, Real GDP g ow h o F ance, Real GDP g ow h o Spain, Real GDP g ow h o Uni ed S a es o Ame ica, Real GDP g ow h o Uni ed Kingdom, Cu ency spo exchange a e o he US dolla o he na ional cu ency o Po ugal, Recession, Yea ] es ima o s: 50 lea ning_ a e: 0.2 max_dep h: 1 min_samples_spli : 3 min_samples_lea : 6 4 h GBR 1962-Q3 o 2019-Q2 Ancho ed [Real GDP g ow h o Po ugal, Real GDP g ow h o F ance, Real GDP g ow h o Spain, Real GDP g ow h o Uni ed S a es o Ame ica, Real GDP g ow h o Uni ed Kingdom, Cu ency spo exchange a e o he US dolla o he na ional cu ency o Po ugal, Recession, Yea ] es ima o s: 50 lea ning_ a e: 0.05 max_dep h: 5 min_samples_spli : 4 min_samples_lea : 6 41 5 h GBR 1962-Q3 o 2019-Q2 Non- ancho ed [Real GDP g ow h o Po ugal, Real GDP g ow h o Spain, Real GDP g ow h o Uni ed S a es o Ame ica, Cu ency spo exchange a e o he US dolla o he na ional cu ency o Po ugal, Recession, Yea , Da e] es ima o s: 150 lea ning_ a e: 0.3 max_dep h: 3 min_samples_spli : 3 min_samples_lea : 3 6 h GBR 1998-Q1 o 2019-Q2 Non- ancho ed [Real GDP g ow h o Po ugal, Final Consump ion expendi u e o Po ugal, Real GDP g ow h o Spain, Real GDP g ow h o Uni ed S a es o Ame ica] es ima o s: 100 lea ning_ a e: 0.1 max_dep h: 3 min_samples_spli : 2 min_samples_lea : 1 42 APPENDIX F Table wi h he sensi i e analysis o he ime pe iods o 1962, 1979, 1998, 2002, and 2009 o each s ep-ahead u ilizing he same models and pa ame e s as in he inal o ecas . S ep-ahead Time pe iod RMSE MPE R2 1s 1962-Q3 o 2019-Q2 0.6024 -6.70% 0.2925 1979-Q1 o 2019-Q2 0.5364 -1196.64% 0.3594 1998-Q1 o 2019-Q2 0.6017 328.51% -4.4709 2002-Q1 o 2019-Q2 0.4491 333.08% -2.2401 2009-Q1 o 2019-Q2 0.2513 71.62% -2.8569 2nd 1962-Q3 o 2019-Q2 0.741 -1871.51% -0.0705 1979-Q1 o 2019-Q2 0.5463 -2630.83% 0.3355 1998-Q1 o 2019-Q2 0.3121 -54.9% -0.4715 2002-Q1 o 2019-Q2 0.4395 220.1858% -2.1016 2009-Q1 o 2019-Q2 0.1899 260.33% -1.2019 3 d 1962-Q3 o 2019-Q2 0.7573 14.2% -0.1182 1979-Q1 o 2019-Q2 0.6697 -1157.53% 0.6975 1998-Q1 o 2019-Q2 0.6975 183.06% -6.3522 2002-Q1 o 2019-Q2 0.7735 -43.17% -8.6078 2009-Q1 o 2019-Q2 0.3637 -125.2% -7.0804 4 h 1962-Q3 o 2019-Q2 0.8534 -8.24% -0.4206 1979-Q1 o 2019-Q2 0.7732 -673.07% -0.3311 1998-Q1 o 2019-Q2 0.7421 178.26% -7.3226 2002-Q1 o 2019-Q2 0.8424 234.64% -10.397 2009-Q1 o 2019-Q2 0.1232 -141.15% 0.0729 5 h 1962-Q3 o 2019-Q2 0.8018 11.59% -0.2536 1979-Q1 o 2019-Q2 0.9297 -1225.96% -0.9244 1998-Q1 o 2019-Q2 1.2379 1074.24% -22.154 2002-Q1 o 2019-Q2 0.7725 177.58% -8.5816 2009-Q1 o 2019-Q2 0.5383 604.34% -16.6966 6 h 1962-Q3 o 2019-Q2 0.9544 340.63% -0.7763 1979-Q1 o 2019-Q2 0.7210 -1152.94% -0.3272 1998-Q1 o 2019-Q2 0.8093 -30,00% -0.2771 2002-Q1 o 2019-Q2 0.7250 679.96% -8.5831 2009-Q1 o 2019-Q2 0.5660 612.86% -18.5687 43 APPENDIX G Me hod used o calcula e he bes model conside ing he me ics RMSE, MPE, and R2. Gi en he di e en scales and complexi ies o he me ics u ilized, we employed a sys em o no malize hem by using an a bi a y benchma k alue: an RMSE o 0.6618, an MPE o 73.33%, and an R2 o -0.1959, which we e he bes alues om he o iginal op imal o ecas om ea lie model de elopmen . I a model ma ches hese alues, i sco es 1; below 1 is be e , and abo e 1 is wo se. Al hough no pe ec due o he a bi a y alues, his me hod helps de i e sensible conclusions. 44 APPENDIX H Spea man’s co ela ion be ween Po ugal’s GDP g ow h and he a iables used in he models. Va iable Co ela ion Final Consump ion expendi u e o Po ugal 0.7065 Real GDP g ow h o F ance 0.5748 Real GDP g ow h o Spain 0.5451 Recession -0.5421 Yea -0.5114 Real GDP g ow h o he Uni ed S a es o Ame ica 0.2174 Real GDP g ow h o he Uni ed Kingdom 0.1406 Cu ency spo exchange a e o he US dolla o he na ional cu ency o Po ugal 0.0663 45