Optimising Canada’s Inflation: A Novel Approach Integrating Timeseries and Machine Learning Models A project submitted in partial fulfilment of the requirements of Master of Science in Data Science By Ankita Sandip Shelke Department of Mathematics & Statistics Thompson Rivers University Supervisor Dr. Erfanul Hoque July, 2024 © Ankita Sandip Shelke, 2024 ABSTRACT Inflation, defined as the rise in prices over time, plays a critical role in determining a nation’s economic stability. Careful monitoring and control are required since this phenomenon has an impact on the cost of living in any country. Despite its importance, not much attention has been paid to Canadian inflation research. This study aims to address this gap by forecasting Canada’s inflation using a novel data-driven forecast combination approach. Inflation is influenced by several economic factors, which are reflected in consumer spending patterns. By incorporating various external economic factors such as exchange rates, oil prices, the commodity price index, money supply, interest rates, and unemployment rates; this approach seeks to accurately capture the variations in inflation. This study introduces a simple yet effective data-driven forecast combination approach that integrates implemented time series and machine learning models. The proposed approach bypasses traditional forecasting steps and allows forecast weights to be optimized by minimizing the h-step ahead forecast error sum of squares (FESS). The performance of the proposed approach is evaluated through numerical experiments using simulated data and Canadian inflation data from the Federal Reserve Economic Data and the Bank of Canada. The results demonstrate that the proposed approach outperforms traditional time series and machine learning models, offering superior accuracy and reliability in forecasting inflation. Importantly, the proposed model is robust, showing consistent performance in pre- and postCOVID periods. Key Words: Canada Inflation; Dynamic Regression; Forecast combinations, Machine Learning; Time series ii ACKNOWLEDGEMENTS First and foremost, I extend my heartfelt gratitude to the Gods for bestowing me with everything I need. I would like to express my deepest gratitude to my supervisor, Dr. Erfanul Hoque, for his unwavering belief in my abilities. His guidance and mentorship have been invaluable, boosting my confidence and teaching me essential skills. I am also thankful to the Data Science program at Thompson Rivers University for the opportunity to be a part of this academic journey and to learn crucial data science skills. I am grateful to Dr. Mohamed Tawhid, the current coordinator, and Dr. Qinglin (Roger) Yu, the former coordinator of the MSc Data Science program, for their outstanding support. I want to express my sincere appreciation to the professors at Thompson Rivers University, especially Dr. Mila Kwiatkowska, Dr. Jabed Tomal, Dr. Yue Zhang, Dr. Mateen Shaikh, and Dr. Trent Tucker, for imparting valuable knowledge and strengths. Additionally, I acknowledge the financial support for this research from the Research Accelerate Grant and Internal Research Funds. Special thanks to my son, spouse, parents, and siblings for their constant support and encouragement. iii Contents 1 2 Introduction 1 1.1 The Inflation: An Economic Concern . . . . . . . . . . . . . . . . 1 1.1.1 What is CPI? . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.2 Causes of Inflation . . . . . . . . . . . . . . . . . . . . . 3 1.1.3 Impact on Canadian . . . . . . . . . . . . . . . . . . . . 5 1.1.4 Monetary Policy . . . . . . . . . . . . . . . . . . . . . . 5 1.2 Research Gap and Contribution . . . . . . . . . . . . . . . . . . . 6 1.3 Research Objective . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4 Outline of the Project . . . . . . . . . . . . . . . . . . . . . . . . 9 Literature Review 10 2.1 10 Time-series Models . . . . . . . . . . . . . . . . . . . . . . . . . iv CONTENTS 2.1.1 2.3 3 Autoregressive Integrated Moving Average (ARIMA) Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Dynamic Regression (DR) Models . . . . . . . . . . . . . 11 Machine Learning and Deep Learning Models . . . . . . . . . . . 12 2.2.1 Neural Network Autoregression (NNAR) Models . . . . . 12 2.2.2 Random Forest (RF) Models . . . . . . . . . . . . . . . . 13 2.2.3 Extreme Gradient Boosting (XGBoost) Models . . . . . . 14 Combination Models . . . . . . . . . . . . . . . . . . . . . . . . 14 2.1.2 2.2 v Methodology 19 3.1 20 Time series Models . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 els . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Dynamic Regression (DR) Models . . . . . . . . . . . . . 22 Machine Learning Models . . . . . . . . . . . . . . . . . . . . . 23 3.2.1 Neural Network Autoregression (NNAR) Models . . . . . 23 3.2.2 Neural Network Autoregression with External Variables 3.1.2 3.2 Autoregressive Integrated Moving Average (ARIMA) Mod- (NNARX) Models . . . . . . . . . . . . . . . . . . . . . 26 3.2.3 Random Forest (RF) Models . . . . . . . . . . . . . . . . 28 3.2.4 Extreme Gradient Boosting (XGBoost) Models . . . . . . 29 CONTENTS vi 3.3 Forecast Combination Approaches . . . . . . . . . . . . . . . . . 30 3.3.1 Simple Average (SA) Method . . . . . . . . . . . . . . . 30 3.3.2 Ordinary Least Squares (OLS) Regression Method . . . . 31 3.3.3 The Proposed Approach: A Novel Data-driven Weighted Forecast Combination (DDWFC) Approach . . . . . . . . 32 Evaluation Metrics . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.4.1 Root Mean Squared Error (RMSE) . . . . . . . . . . . . . 37 3.4.2 Mean Absolute Error (MAE) . . . . . . . . . . . . . . . . 38 3.4.3 Mean Absolute Percentage Error (MAPE) . . . . . . . . . 38 3.5 Unbiasedness . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 3.6 Time series Cross Validation . . . . . . . . . . . . . . . . . . . . 40 3.7 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 3.4 4 Data Analysis 46 4.1 Timeseries Cross-Validation Approach . . . . . . . . . . . . . . . 47 4.2 Descriptive Statistics . . . . . . . . . . . . . . . . . . . . . . . . 48 4.3 STL Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.4 Distribution and Transformation of Data . . . . . . . . . . . . . . 51 4.5 Correlation Analysis . . . . . . . . . . . . . . . . . . . . . . . . 54 CONTENTS vii 4.6 Models for Forecast . . . . . . . . . . . . . . . . . . . . . . . . . 56 4.6.1 Time-series Models . . . . . . . . . . . . . . . . . . . . . 56 4.6.2 Machine Learning Models . . . . . . . . . . . . . . . . . 61 4.6.3 Forecast Combination Approaches . . . . . . . . . . . . . 65 4.7 RMSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 4.8 Unbiasedness . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 5 6 Simulation 75 5.1 Simulation Design . . . . . . . . . . . . . . . . . . . . . . . . . 75 5.2 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . 76 Conclusion 82 6.1 Findings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 6.2 Implications for Future Research . . . . . . . . . . . . . . . . . . 84 A Additional Results 95 A.1 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 A.2 The Role of MAPE in DDWFC . . . . . . . . . . . . . . . . . . . 95 List of Figures 1.1 Coffee Price over time. Source: Gioffre, Medium (2022) . . . . . 2 1.2 CPI Basket. Source: Maddy Price, Investopedia (2024). . . . . . . 3 1.3 Causes of Inflation. Source: Melissa Ling, Investopedia (2019). . 4 3.1 An example of a feed-forward neural network with one hidden layer with three neurons. Source: LearnOpenCV . . . . . . . . . 3.2 Schematic diagram of rolling window time series cross-validation for 1-step ahead forecast. . . . . . . . . . . . . . . . . . . . . . . 3.3 25 41 Monthly Inflation Rate of Canada from January 1972 to August 2023 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 3.4 Dynamics of all External Economic Variables . . . . . . . . . . . 45 4.1 Monthly Inflation Rate of Canada from January 1972 to August 4.2 2023 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 STL Decomposition of Inflation Rate . . . . . . . . . . . . . . . . 51 viii LIST OF FIGURES ix 4.3 Distribution of Inflation Rate . . . . . . . . . . . . . . . . . . . . 52 4.4 Boxplot of External Economic Variables . . . . . . . . . . . . . . 53 4.5 ACF Plot of Inflation Rate . . . . . . . . . . . . . . . . . . . . . 54 4.6 Correlation Plot of Inflation Rate and External Variables(Infl=Inflation Rate, IntRt = Interest Rate, MS = Money Supply, ExRt = Exchange Rate, Unemp = Unemployment Rate, OilPr = Oil Price) . . 55 4.7 First Difference of Inflation Rate . . . . . . . . . . . . . . . . . . 57 4.8 ACF plot of Inflation Differenced Series . . . . . . . . . . . . . . 58 4.9 ARIMA Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the ARIMA forecast. . . . . . . . . . . . . . . . . 59 4.10 DR Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the DR forecast. . . . . . . . . . . . . . . . . . . . . . 60 4.11 NNAR Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the NNAR forecast. . . . . . . . . . . . . . . . . . 61 4.12 NNARX Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the NNARX forecast. . . . . . . . . . . . . . . . . 62 LIST OF FIGURES x 4.13 RF Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the RF forecast. . . . . . . . . . . . . . . . . . . . . . 63 4.14 XGB Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the XGB forecast. . . . . . . . . . . . . . . . . . . 64 4.15 Forecast for horizon h = 1 using the DDWFC model. . . . . . . . 69 4.16 Forecast for horizon h = 3 using the DDWFC model. . . . . . . . 70 4.17 Forecast for horizon h = 6 using the DDWFC model. . . . . . . . 71 4.18 Forecast for horizon h = 12 using the DDWFC model. . . . . . . 72 5.1 Forecast for horizon h = 1 using the DDWFC model. . . . . . . . 79 5.2 Forecast for horizon h = 3 using the DDWFC model. . . . . . . . 79 5.3 Forecast for horizon h = 6 using the DDWFC model. . . . . . . . 80 5.4 Forecast for horizon h = 12 using the DDWFC model. . . . . . . 80 List of Tables 4.1 Initial and Forecast Windows for Different Horizons . . . . . . . . 48 4.2 Summary Statistics of Economic Variables . . . . . . . . . . . . . 50 4.3 Weights derived from OLS Regression Method . . . . . . . . . . 65 4.4 Best Combination from the Automated Algorithm 2 for different horizon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 4.5 Weights derived from DDWFC approach . . . . . . . . . . . . . . 68 4.6 RMSE Value for Implemented Models across various Horizons . . 73 4.7 P-values from the Wald test for Implemented Models across various Horizons . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 5.1 Initial and Forecast Windows for Different Horizons . . . . . . . . 76 5.2 Best Combination derived from the Automated Algorithm . . . . 77 5.3 Weights derived from OLS Regression Method . . . . . . . . . . 77 5.4 Weights(W) derived from DDWFC Approach . . . . . . . . . . . 78 xi LIST OF TABLES 5.5 xii RMSE values for Implemented models on Simulated Data . . . . 78 A.1 MAPE values of Implemented Models . . . . . . . . . . . . . . . 96 Chapter 1 Introduction 1.1 The Inflation: An Economic Concern Inflation is the economic phenomenon marked by a decrease in the purchasing power of money, characterized by a general increase in prices for goods and services over time. It can be seen that prices of commodities tend to increase over time and this is illustrated considering a cup of coffee price in figure 1.1. This figure shows in 1970, the price of coffee was 25 cents; in 1980, it was 45 cents; and in 2020, the same cup cost $1. 59. This rise in price is called inflation. It can also be seen in essentials like groceries, housing rent, and energy prices. Inflation reduces the purchasing power of money which means as prices increase the value of money declines that is each unit can purchase a few goods and services. As inflation leads to a decline in the purchasing capacity of the public, it brings down the standard of living and slows the growth of the economy (Fernando, 2024). In this research, our primary purpose is to propose a novel approach to forecast Inflation Rate in Canada by employing advanced modeling techniques. 1 Figure 1.1: Coffee Price over time. Source: Gioffre, Medium (2022) 1.1.1 What is CPI? The Consumer Price Index (CPI) is one of the most important indicators that many countries use to measure the changes in prices of goods and services i.e. inflation. In Canada, the CPI represents the purchasing experiences of Canadians across various products and services and is hence an important indicator of inflation in the country. Overall, the CPI basket is categorized into eight major components: food; shelter; household operations, furnishing, and equipment; apparel and footwear; transportation; medical and personal care; education, communication, and entertainment; and alcoholic beverages and tobacco products and recreational cannabis, as illustrated in the following figure1.2. Every item in a basket is given a weight percentage which represents how much of Canadians’ expenditure corresponds to the specific item. For instance, Canadians pay relatively higher amounts for food and shelter than personal grooming. Thus, a higher weight is given to food and shelter than other categories, which in return provide a maximum contribution towards inflation (BoC, 2021a). The inflation rate is measured as the 12-month percentage change in the CPI. This involves determining the 2 percent change in the CPI of a given month compared to those of the same month in the previous year (Statistics Canada, 2024). Figure 1.2: CPI Basket. Source: Maddy Price, Investopedia (2024). 1.1.2 Causes of Inflation This section aims at describing the causes of inflation. Figure 1.3 illustrates CostPush, Built-In, and Demand-Pull inflation, which are the three primary categories of inflationary factors. • When people have more money to spend, demand for goods increases which results in higher prices of the product, this phenomenon is known as Demand3 Pull Inflation. The main reason for this inflation is a discrepancy between supply and demand caused by increased demand and less supply drives higher prices. • Cost-Push Inflation is experienced due to an increase in manufacturing expenses that are passed on to the final price of the product prices. • When firms raise the pricing of goods and services in response to worker demands for greater salaries to cover the high cost of living, this phenomenon is known as Built-In Inflation (Fernando, 2024). In summary, inflationary pressures arise when demand surpasses supply, production costs grow or wages increase (Globe and Mail, 2023). As a result, prices of the product rise. Figure 1.3: Causes of Inflation. Source: Melissa Ling, Investopedia (2019). 4 1.1.3 Impact on Canadian Recently many countries experienced high inflation after the COVID-19 pandemic mainly due to supply and demand mismatch and rising energy prices. In June 2022, Canada had its highest inflation rate since the early 1980s, reaching 8.1% (Chen and Tombe, 2023). This was caused by unusual shocks from the pandemic and geopolitical events, which created unforeseen challenges the central bank didn’t anticipate (Kryvtsov et al., 2023). Canadians felt the impact of inflation most in higher food prices, housing costs, and transportation expenses. Product prices and wages increased due to unexpected situations which resulted in global issues like supply chain disruptions and rising energy prices. Many found it tough because their wages didn’t keep up with the price hikes of Canada (BoC, 2023a). In response, the central bank employed monetary policy (explained in the next section) by raising interest rates, a mechanism they employ to keep inflation under control. The monetary report shows a positive hope of getting back to the target of a 2% inflation rate of Canada by 2025 (BoC, 2023b). This means it is very important to forecast the inflation rate for the well-being and stability of any country’s economy. 1.1.4 Monetary Policy The objective of Canada’s Monetary Policy is to contribute to the economic and financial well-being of Canadians by fostering a sustainable economy while keeping inflation low, stable, and close to 2%, thereby supporting economic growth and a strong labor market. The policy, established in 1991, targets a 2% inflation rate within a 1% to 3% control range and was renewed in 2021 until 2026. This method has maintained inflation near 2% and contributed to a robust labor market. 5 Both the Bank of Canada and the Government of Canada recognize the necessity of balancing inflation and long-term employment. Flexibility within the 1% to 3% control range allows the Bank to manage labor market and interest rates while keeping inflation stable (BoC, 2021b). Overall, the objective is to keep inflation around 2% to ensure economic stability and job security for the Canadian public while adapting to different economic outcomes and conditions. 1.2 Research Gap and Contribution Inflation has become a hot topic and capturing the attention of researchers. Controlling inflation is crucial for maintaining financial stability, therefore policymakers and economists rely on accurate forecasts to track inflation and make wellinformed decisions to ensure price stability (Pasaogullari and Meyer, 2010). Forecasting macroeconomic indicators such as inflation is challenging due to the complex and dynamic nature of the economy. Researchers have employed many algorithms and methods to create forecasting models for time series data. Initially, statistical models were common. With the availability of massive datasets, increased computer power, and easier access to advanced software, machine-learning techniques have become more popular for forecasting. These algorithms have been used for forecasting time-series data, like GDP growth or inflation (Rodrı́guezVargas, 2020). For forecasting inflation, researchers have used various external variables like interest rates, unemployment rates, exchange rates, etc. Some have utilized timeseries models AutoRegressive Integrated Moving Average (ARIMA), Exponential Smoothing State Space Model (ETS), etc., while some have employed advanced models like Random Forest, Extreme Gradient Boosting (XGBoost), Long Short6 Term Memory (LSTM), etc. Few studies have investigated combining methods for inflation forecasting. Those studies used different methods to combine forecasts but mainly used a simple average combination method. A detailed literature review of the inflation study is provided in Chapter 2. Despite the importance of inflation study, inflation forecasting in Canada has received minimal attention, particularly in terms of including external economic variables and employing advanced machine learning tools. Traditional models like ARIMA often rely on lagged values. However, it is necessary to capture the external economic influences that impact inflation dynamics. To address this gap, our research uses external variables like interest rates, exchange rates, etc. into the inflation forecast models, enhancing the accuracy of the forecast. We also implemented a machine-learning technique to capture the complex nature of the data. Moreover, to the best of our knowledge, dynamic regression models have not been utilized previously to forecast Canadian inflation. This model allows for the inclusion of information from past observations as well as relevant external variables (Hyndman and Athanasopoulos, 2018). We are using this approach in our study, to get a more accurate and reliable inflation forecast. Additionally, research suggests that combining forecasts from different models can significantly improve accuracy (Andrawis et al., 2011). This approach leverages the unique strengths of individual models. While forecast combinations are more common in stock forecasting and typically use a simple average method, we have proposed a novel data-driven combination approach. This method integrates individual forecasts by assigning various weights to them, aiming to provide an optimized inflation forecast for Canada. 7 The Proposed data-driven weighted forecast combination (DDWFC) approach is very effective because it incorporates external economic variables, the power of time series and machine learning techniques, and the robustness of combination forecasting. This approach is effective as it is dependent on the data; which provides different weights to individual models providing maximum weightage to the most accurate forecast. The optimized weights are derived automatically in the algorithm by minimizing h-step ahead Forecast Error Sum Squares (FESS). However, we have to try different combinations of forecasts manually and select the best combination on the basis of the least Root Mean Squared Error (RMSE). Finally, suggested an extra automated algorithm that uses each forecast as input, attempts every possible combination of the forecast, and determines which combination is optimal by minimizing FESS for every horizon. Ultimately, we merge those models that were produced using automated methods over all horizons. Next, to obtain the forecast, apply this combination to our suggested DDWFC model. We are expecting that this comprehensive approach will provide more precise forecasts which will be helpful in policy making and economic planning of the country. 1.3 Research Objective The following are the objectives of this study: • The primary objective of this study is to propose a novel DDWFC approach to enhance the accuracy of Canadian Inflation forecasts across various horizons (h = 1, 3, 6, 12 months). We are also planning to propose an automated method that will find the best combination of forecasts to provide more ac8 curate forecasts. • This proposed approach seeks to incorporate external economic variables such as exchange rates, interest rates, commodity price indices, etc. along with historical inflation data. • By integrating these variables and employing advanced machine-learning techniques, we intend to provide more precise and reliable inflation forecasts. These enhanced forecasts will offer valuable insights to policymakers and economists, to make better-informed decisions to effectively maintain Canada’s inflation. 1.4 Outline of the Project Apart from this brief introduction, the structure of the project is organized as follows. Chapter 2 is on the specifics of the literature reviewed for the study. The methodology is described in Chapter 3. Chapter 4 is dedicated to discussing the results of the undertaken analysis. Chapter 5 focuses on the results of simulated data. Finally, we conclude and propose some ideas about future research in Chapter 6. 9 Chapter 2 Literature Review Forecasting inflation has been an interesting research topic nowadays and it is always a challenging topic. Due to the importance of inflation forecasting in establishing economic stability, there is a constant search for novel ways to improve forecast accuracy. This literature review focuses on research based on time series, machine learning, deep learning, and combination models. 2.1 Time-series Models 2.1.1 Autoregressive Integrated Moving Average (ARIMA) Models Various methods have been developed to forecast and estimate inflation rates. ARIMA models have been used for many days as a research tool in forecasting various macroeconomic indicators. Meyler et al. (1998) focused on utiliz10 ing ARIMA models for forecasting Irish inflation. Their goal was to optimize forecast performance by concentrating more on reducing out-of-sample forecast errors than on maximizing in-sample goodness of fit. Nyoni (2018) conducted a study that employed the ARIMA and Generalized Autoregressive Conditional Heteroskedasticity (GARCH) models to obtain a rigorous analysis of inflation in Kenya. This study has provided valuable insights into inflation trends and has contributed to the development of effective forecasting models. Deka and Resatoglu (2019) utilized the ARIMA model to forecast Turkey’s foreign exchange rate and inflation. It identifies ARIMA(3,1,3) as the best model for forecasting the exchange rate and ARIMA(1,1,4) for predicting inflation. 2.1.2 Dynamic Regression (DR) Models Very few researchers use this method in time-series forecasting. The Dynamic Regression (DR) method is different from the traditional time-series linear regression model. In the time series regression model, errors are assumed to be uncorrelated (i.e, it is white noise) whereas in the DR model, the errors are allowed to contain autocorrelation. In that case, the errors follow an ARIMA model to capture the correlation between lagged values. Hence DR model helps to forecast dependent variables by including external variables as well as lagged values. Shaqiri et al. (2023) successfully implemented a dynamic regression forecast model for customer-specific electricity consumption, utilizing the Seasonal and Trend decomposition method (STL) for accurate estimation of trend and seasonal components. No one has explored this method to forecast inflation. 11 2.2 Machine Learning and Deep Learning Models Traditional time-series models like ARIMA have been widely used for inflation forecasting. However, these models often struggle to capture the complex, nonlinear relationships between economic variables and inflation. Recent advances in machine learning (ML) methods have shown promise in improving the accuracy of inflation forecasts. We can not directly implement machine learning models on the time series data. To effectively apply machine learning models to time series data, feature engineering is essential. This process involves converting raw data into meaningful features that capture temporal patterns and relationships (Tilgner, 2019). Features such as temporal indicators, lagged variables, rolling statistics, and external factors enable models like RF and neural networks to better understand and predict trends in time series data (Gordon, 2023). This preprocessing step enhances the model’s ability to make accurate forecasts by extracting relevant information from the data. Studies have explored various ML techniques, including neural networks, and ensemble methods to forecast inflation more effectively. 2.2.1 Neural Network Autoregression (NNAR) Models The NNAR model is specifically designed for time-series data. Its a neural network model that includes lagged values as input variables to consider the correlation between time-series data (Hyndman and Athanasopoulos, 2018). Therefore, the NNAR model is used to capture the non-linearity of the time series data and it has been used in different sectors like financial, health, etc. Karadzic and Pejovic (2021) assessed the forecasting accuracy of ARIMA, Holt-Winters, and NNAR models for predicting the Harmonized Index of Consumer Prices in the Euro- 12 pean Union (EU) and the Western Balkans. These models are compared using various metrics such as Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Mean Percentage Error (MPE) and Mean Absolute Percentage Error (MAPE) for out-of-sample forecasts. Results reveal that NNAR models offer the most precise forecasts for the Western Balkans, whereas ARIMA models are superior for predicting twelve-month inflation in EU countries. The Holt-Winters method is the second most accurate for both regions. The effectiveness of NNAR models has also been demonstrated in other contexts, such as forecasting COVID19 cases and deaths, where Demir and Kirisci (2022) showed that the NNAR model provides superior performance compared to Seasonal ARIMA (SARIMA) in forecasting COVID-19 monthly cases in Turkey. The strength of NNAR models has been highlighted in forecasting GDP growth rates. According to Almarashi et al. (2024), in the context of Saudi Arabia, NNAR models demonstrated superior performance in predicting the annual GDP growth rate, having lower MAE, RMSE, and MAPE values compared to other models. These studies underscore the model’s reliability and potential application for economic planning and policy formulation. 2.2.2 Random Forest (RF) Models Medeiros et al. (2021) demonstrated that ML models incorporating a large number of covariates outperformed traditional time-series models in predicting U.S. inflation. According to the author, the RF model has gained importance in inflation forecasting due to its exceptional performance. Similar advancements have been observed in GDP forecasting. Yoon (2021) encouraged the use of ML models in macroeconomic forecasting. They explored RF and gradient boosting to forecast GDP growth in Japan. 13 2.2.3 Extreme Gradient Boosting (XGBoost) Models Similarly, various authors Pratap and Sengupta (2019), Li et al. (2023), Araujo and Gaglianone (2023), and Cobbinah and Alnaggar (2024) explored XGBoost to forecast inflation along with other machine learning and time-series models. Araujo and Gaglianone (2023) studied different approaches to forecast inflation and according to the authors, top forecasts are provided by various approaches like combination methods, tree-based methods such as RF and XGBoost, breakeven inflation, and surveys of people’s expectations. 2.3 Combination Models Forecast Combination is an old theme in literature. Several studies such as Stock and Watson (2004), Andrawis et al. (2011) say that combined forecasts provide superior forecasts than individual forecasts. Nowadays, researchers are using this approach in inflation forecasting to improve accuracy. Pratap and Sengupta (2019), Rodrı́guez-Vargas (2020), Jamil (2022),Araujo and Gaglianone (2023) Andrawis et al. (2011) have implemented combination models in inflation forecasting. discussed various methods for combining individual forecasts, including techniques such as the simple average method, variance-based methods, the inverse of the mean square error, rank-based weighting, least squares estimation, etc. All combination methods operate differently depending on the type of data. There is no single combination method that guarantees the most accurate forecast in all situations. Through analysis, we can determine the best combination method. 14 It has been researched that including covariates for forecasting inflation improves accuracy due to the inclusion of more information for explaining the dependent variables. Many research papers like Dion (1999), Paranhos (2021), Medeiros et al. (2021) etc. have included different economic indicators for projecting inflation in their respective countries. For the US, the Federal Reserve Bank of St. Louis. provides a monthly frequency, macroeconomic database called FRED-MD which is widely used for economic research McCracken and Ng (2016). Therefore, many researchers use this dataset to forecast US inflation. This dataset contains various economic variables that help to forecast inflation more accurately. Paranhos (2021), Medeiros et al. (2021), Malladi (2023) and Theoharidis et al. (2023) used the FRED-MD dataset to project US inflation. Dion (1999) tested several variables for their ability to predict the core inflation of Canada. First, they used Granger causality tests for initial screening, followed by bivariate indicator models for forecasting one and two quarters ahead. Then they used ridge regression to combine selected bivariate forecasts into multivariate forecasts optimally. These multivariate models are compared with the benchmark model, Philips curve, autoregressive and naive model. Their study identifies that components of the CPI, the Bank of Canada commodity price index in U.S. dollars, the industrial product price index for electrical products, average resale housing prices in major cities, and the ratio of unfilled orders to shipments in manufacturing are important variables to forecast inflation. Moshiri and Cameron (2000) explored and compared different combined Artificial Neural Network (ANN) models with the ARIMA model, a vector autoregressive model, and a Bayesian vector autoregression model to forecast Canada inflation. They compared inflation forecasts for one, three, and twelve months ahead of hybrid with traditional time-series models and concluded that in some 15 cases, hybrid ANN models can match or outperform traditional models. Pratap and Sengupta (2019) investigated whether machine learning models provide better (Consumer Price Index) CPI forecasts. Authors forecasted CPI inflation in India using traditional time series, machine learning, and deep learning models. They employed modeling techniques like SARIMA, NNAR, Support Vector Machine (SVM), K-Nearest Neighbors (KNN), RF, XGBoost, LSTM, etc. And compared the model’s accuracy with the benchmark model RW. The author also explored different combinations of models. Their finding says that generally, machine learning models outperform the standard statistical models. Additionally, combination models were found to be more effective than individual models. According to them, the simple average method outperforms the inverse RMSE weighted average models. Rodrı́guez-Vargas (2020) tried various advanced machine learning and deep learning models like KNN, RF, XGBoost, LSTM, an average of univariate methods, etc to forecast inflation of Costa Rica on the basis of nineteen macroeconomic variables. They also proposed a combination method that combined univariate KNN, LSTM, and RF. According to their study, the proposed method outperformed individual models and the average univariate forecasts used by the Central Bank of Costa Rica. Their result provides an unbiased forecast for all horizons. Medeiros et al. (2021) implemented machine learning models and used this dataset to improve inflation forecasting accuracy. According to the authors, ML models with numerous covariates outperform traditional benchmarks. They emphasized that the RF model outperformed all other models due to its variable selection method and the ability to capture nonlinear relationships between macroeconomic variables and inflation. Paranhos (2021) utilized neural network models, LSTM model, to forecast inflation for various horizons. Using US data, results 16 showed that neural networks provide better forecasts than standard benchmarks, especially for longer horizons. The LSTM model outperforms traditional feedforward networks at long horizons, due to its capacity to incorporate older information for improved accuracy. Jamil (2022) proposed a hybrid model combining ARIMA and LSTM models to forecast the CPI of six developed countries. The proposed hybrid model outperformed the individual forecast model. Theoharidis et al. (2023) proposed a hybrid deep learning model VAE-ConvLSTM combining Variational Autoencoders and Convolutional LSTM Networks to forecast inflation. Using a public macroeconomic database (FRED-MD) with 134 monthly U.S. time series from January 1978 to December 2019, the authors compared the hybrid model against popular time-series and machine learning benchmarks, including Ridge regression, LASSO regression, RF, Bayesian methods, Vector Error Correction Model (VECM), and multilayer perceptron. The VAE-ConvLSTM model consistently outperformed these benchmarks in out-of-sample performance. Their result is robust and supported by cross-validation and Monte Carlo simulations with different training, validation, and test samples. Araujo and Gaglianone (2023) investigated the application of machine learning methods to enhance inflation forecasting in Brazil. An extensive out-ofsample forecasting exercise is conducted with multiple horizons using a large dataset of 501 series and 50 forecasting methods, including newly proposed ML techniques, traditional time-series models, and forecast combination methods. The results indicate that ML methods often outperform traditional time-series models in terms of mean-squared error. The top-performing forecasts frequently include combinations of methods, tree-based techniques like RF and XGboost, breakeven inflation, and survey-based expectations. Cobbinah and Alnaggar (2024) 17 proposed a novel approach using a deep learning method. They applied a Recurrent Neural Network (RNN) encoder-decoder attention model to forecast the Canadian CPI, demonstrating its superiority over traditional time-series and machine learning methods. In similar manner, by referring to all research papers about inflation from different countries, our research included some important economic external variables and advanced forecasting tools to address the gap in forecasting inflation in Canada. 18 Chapter 3 Methodology This study has implemented different approaches for forecasting Canadian inflation. We projected inflation for different horizons (h = 1, 3, 6, 12 months) which can be useful in planning economic activity. Additionally, we have proposed a DDWFC approach to enhance forecast accuracy and provide findings to policymakers. This chapter will explain the implemented models such as time-series and machine learning, novel approach, time-series cross-validation, evaluation matrix, and data collection. In this context, yt represents the current inflation rate at time t, while ŷt+h denotes the forecasted inflation rate at time t + h. These projections will be for various horizons (h = 1, 3, 6, 12 months), which will allow us to observe the behavior of inflation as the horizon increases. 19 3.1 Time series Models Before implementing any models on the time series data, we should perform some preprocessing steps. It typically involves differencing to stabilize mean values and transformations such as logarithmic scaling to handle variance. We do these types of adjustments and transformations to make the pattern of time-series data more simpler. This helps the model to produce a more accurate forecast (Hyndman and Athanasopoulos, 2018). The following are the different models that were implemented in our research to forecast inflation. 3.1.1 Autoregressive Integrated Moving Average (ARIMA) Models Classical regression is not able to capture the fluctuations of the time-series data fully. To capture the autocorrelation of the data, the ARIMA model is the most commonly used approach in analyzing and forecasting time series data. It is developed by Box and Jenkins (Shumway et al., 2017). The ARIMA model is designed to analyze and forecast time series data by incorporating autoregressive (AR), integrated (I), and moving average (MA) components. The integrated (I) component involves differencing the series to achieve stationarity. Statistical properties of the stationary time series do not depend on the time at which the series is observed. That is data should be from white noise series (Box et al., 2015). The ARIMA full model can be written as: ′ ′ yt′ = c + ϕ1 yt−1 + · · · + ϕp yt−p + θ1 εt−1 + · · · + θq εt−q + εt , (3.1) 20 We call this an ARIMA(p, d, q) model where p represents the order of the AR part, q represents the order of the MA part, and d is the degree of first-order differencing. The differenced series, denoted as yt′ , represents the transformed time series at time t, where differencing is applied to make non-stationary data stationary. The model includes a constant term c, which serves as the intercept. The autoregressive (AR) part of the model is defined by the coefficients ϕ1 , ϕ2 , . . . , ϕp , cor′ ′ ′ , with , . . . , yt−p , yt−2 responding to the lagged values of the differenced series yt−1 p indicating the order of the AR part. In the moving average (MA) part, the coefficients θ1 , θ2 , . . . , θq are associated with the lagged error terms εt−1 , εt−2 , . . . , εt−q , where q is the order of the MA part. The term εt represents the error (white noise) at time t. The appropriate p, d, and q parameters are identified from Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) plots initially. The model parameters are obtained by minimizing the error sum of squares. Then the values of p, d, and q are fine-tuned with the help of Akaike’s Information Criterion (AIC) or Bayesian Information Criterion (BIC) values. Lower AIC/BIC values indicate a better model. For this research, we used ARIMA as a benchmark model to forecast Canadian inflation. The ARIMA() function is utilized from the fable package in R. It tries different combinations p, d, and q and prefers the AIC value to select the best model. Once the model order p, d, and q are identified, the model uses maximum likelihood estimation (MLE) to estimate its parameters. In MLE, it maximizes the probability of obtaining the observed data (Hyndman and Athanasopoulos, 2018). 21 3.1.2 Dynamic Regression (DR) Models The time series models like ARIMA, NAIVE, etc enable the inclusion of past observations but restrict the use of other related information like exchange rates, existing regulatory policies, or shifts in the global economy. On the other hand, the regression models allow for the inclusion of predictors but do not handle time series features leveraged by the ARIMA models. DR models are extensions of traditional linear regression since they also include time series dynamics and other variables that can affect the dependent variable. However, while carrying out the estimations of the coefficients, the DR models consider the error terms as an ARIMA process to account for the autocorrelation within the error terms as opposed to the linear regression models wherein the error terms are assumed to be independent. DR models are particularly advantageous as they combine the forecast ability of the dependent variables while preserving the temporal ordering of observations, which is very essential for the forecast process. The model can be expressed as: ŷt+h = β0 + β1 x1,t + β2 x2,t + . . . + βk xk,t + ηt (3.2) In forecasting the inflation rate at time t + h, the forecasted value is denoted by ŷt+h . The model includes regression coefficients represented by β0 , β1 , . . . , βk , where β0 is the intercept and β1 , . . . , βk are the coefficients for the external variables. The external variables at time t are denoted as x1,t , x2,t , . . . , xk,t . The error term ηt is also modeled using an ARIMA process due to its autocorrelation and non-stationary characteristics. This error term ηt follows an ARIMA structure, which is represented by the equation: (1 − ϕ1 B)(1 − B)ηt = (1 + θ1 B)ϵt (3.3) 22 where B is the backshift operator, defined as Byt = yt−1 , ϕ1 and θ1 are the parameters of the ARIMA model, and ϵt represents white noise. This formulation captures the dynamics of the error term within the ARIMA framework, enabling more accurate forecasting of the inflation rate. In this model, ηt and ϵt are two distinct error terms: ηt is the error in the regression model following an ARIMA process while ϵt is the error in the ARIMA model. The ARIMA structure of ηt guarantees that model residuals are independent and stationary, thus, satisfying the assumptions that are mandatory for reliable forecasting. Estimation of DR models requires validating the stationarity of all the variables in addition to the selection of appropriate values of the parameters of the ARIMA models to produce the best fit and forecast. In this study, we forecasted the Canadian inflation rate, serving as the dependent variable, using external economic variables such as the exchange rate against the US dollar, the unemployment rate, and the interest rate of Canada, along with oil prices, the commodity price index, and Canada’s money supply. The ARIMA() function with predictors is utilized from the forecast package in R to implement the DR model. 3.2 Machine Learning Models 3.2.1 Neural Network Autoregression (NNAR) Models This section explains how to use a NNAR model for time series forecasting. Artificial Neural Networks (ANN), also known as Neural Networks (NN), are computational models inspired by the structure and functioning of the human brain. They enable the modeler to incorporate nonlinear effects or interactions between the de- 23 pendent variable and its predictors. A neural network can be described as a series of “neurons” grouped in layers. The predictors (or inputs) are the first or bottom layer and the dependent variables (or outputs) are the final or top layer. There may also be other layers in between containing “hidden neurons,” thereby making the model complicated. Figure 3.1 shows an example of a feed-forward ANN model with an input layer, a single hidden layer with three neurons, and an output layer. Each connection between neurons is assigned a weight, and each neuron applies an activation function to determine the output, facilitating the learning process (Islam et al., 2019). The neural networks without the hidden layers are called the simplest neural networks and these are equivalent to the linear regressions. If intermediate layers contain hidden neurons, the complexity of the neural network increases and becomes nonlinear. Also known as the multilayer feed-forward network, the structure of the network is such that each layer of nodes receives the input from the previous layer. An output of a node is produced by passing inputs through a weighted linear combination and then through a nonlinear function. In these networks, the coefficients of the predictors are referred to as the weights, and the predictions of the outputs are determined by the weighted sum of the inputs. The weights are chosen by a “learning algorithm” by minimizing a “cost function” like the Mean Squared Error (MSE). NNAR expands the basic ANN framework for time-series forecasting by incorporating lagged values of the dependent variable. An NNAR(p, k) model uses the past p values of the variable, yt−1 , yt−2 , yt−3 , . . . , yt−p , along with k hidden neurons, to predict the next value of the variable, ŷt+h . For example, NNAR(10,6) refers to a model that uses 10 past observations and includes 6 neurons in the single hidden layer to forecast the dependent variable. This relationship is repre- 24 Figure 3.1: An example of a feed-forward neural network with one hidden layer with three neurons. Source: LearnOpenCV sented by the equation: ŷt+h = h(yt , yt−1 , yt−2 , . . . , yt−p ) + ϵt (3.4) where f stands for the function that the neural network aims to learn, while ϵt is the error term which, in this case, is assumed to be homoscedastic. For instance, the input to a hidden neuron j in the NNAR model is computed as: zj = bj + p X wij yt−i (3.5) i=1 where bj is the bias term, and wij are the weights related to each lagged input yt−i . The output of each hidden neuron is then transformed using a nonlinear activation function S(z), such as the sigmoid function: S(z) = 1 1 + e−z (3.6) This nonlinearity also enables the NNAR models to generate the functional forms of the relationships between the variables. The weights wij of the neurons and 25 the biases bj are adjusted with methods that allow minimizing a cost function, the most frequent one being the Mean Squared Error (MSE), in order to achieve precise predictions. We used the NNETAR() function from the forecast package in R to implement NNAR models (Hyndman and Athanasopoulos, 2018). 3.2.2 Neural Network Autoregression with External Variables (NNARX) Models We implemented a NNAR model by including the exchange rate, interest rate, unemployment rate, money supply, commodity price index, and oil price to forecast the inflation rate for Canada. The model can be expressed as: ŷt+h = f (yt−1 , yt−2 , yt−3 , . . . , yt−p , x1,t , x2,t , . . . , xk,t ) + ϵt (3.7) The forecasted inflation rate at time t + h is denoted as ŷt+h . The model utilizes lagged values of the inflation rate, specifically yt−1 , yt−2 , yt−3 , . . . , yt−p , where p represents the number of lags included in the model. In addition, the model accounts for external variables at time t, which include factors such as the exchange rate, interest rate, unemployment rate, money supply, commodity price index, and oil price, denoted as x1,t , x2,t , . . . , xk,t . Including external variables helps capture important economic indicators’ influence on the inflation rate, enhancing the model’s ability to produce accurate and reliable forecasts. RF and XGBoost, powerful ensemble learning methods, have traditionally been used for classification and regression tasks in machine learning. These meth- 26 ods are based on bagging and boosting techniques respectively. ML models, unlike traditional time series models like ARIMA or ETS, cannot directly handle time series data due to the correlations between time-dependent values. To apply machine learning models to time series data, it’s necessary to restructure the data by creating a new dataset that includes lagged values of the time series as predictors. For my analysis, I included 6 lagged values and external economic variables as predictors in the RF and XGB models. Data Generation for Implementing RF and XGB Models: For inflation forecast, we considered various forecast horizons h, including h = 1, h = 3, h = 6, and h = 12. For each forecast horizon, the dataset is generated which is described below. Specifically, if yt represents the actual value at time t, the predictors are as follows: - For h = 1, the predictors are the values from lag 1 to lag 6, i.e., yt−1 , yt−2 , yt−3 , yt−4 , yt−5 , yt−6 . - For h = 3, the predictors are the values from lag 3 to lag 8, i.e., yt−3 , yt−4 , yt−5 , yt−6 , yt−7 , yt−8 . - For h = 6, the predictors are the values from lag 6 to lag 11, i.e., yt−6 , yt−7 , yt−8 , yt−9 , yt−10 , yt−11 . - For h = 12, the predictors are the values from lag 12 to lag 17, i.e., yt−12 , yt−13 , yt−14 , yt−15 , yt−16 , yt−17 . For model evaluation, we utilized rolling window cross-validation with the trainControl() function from the caret package in R. The configuration included specifying the windowSize, which defines the number of periods included in each training window, and h, which indicates the number of periods 27 to forecast ahead. We employed the timeslice method for cross-validation, which partitions the data into sequential training and test sets based on time slices. This approach involves training the model on the initial time window and testing it on subsequent slices, with each slice advancing in time. The fixedWindow = TRUE parameter ensures that the size of the training window remains constant throughout the cross-validation process. Using this setup, we trained the Random Forest model, allowing for a thorough and robust evaluation of its performance across various time periods. This rolling window method effectively captures temporal dependencies and variations in the data over time. 3.2.3 Random Forest (RF) Models RF is an ensemble learning method that uses bagging (Bootstrap Aggregating) to improve the stability and accuracy of machine learning algorithms. Bagging helps to reduce variance by training multiple decision trees (base learners) on different subsets of the training data, and then aggregating their predictions. The RF model combines predictions from multiple decision trees, T (x, Θt ), where x represents the input features (including lagged variables and external variables), and Θt denotes the parameters of the tth tree. The final prediction ŷt+h for a time point t is obtained through the aggregation of individual tree predictions: B 1 X ŷt+h = T (x, Θ(b)t ) B b=1 (3.8) (b) where B denotes the number of trees in the forest, and Θt represents the parameters of the b-th tree. Hyperparameter tuning is essential for enhancing the performance of the RF model, with key hyperparameters including the number of trees (n estimators), the maximum depth of each tree (max depth), and the minimum number of samples required at a leaf node (min samples leaf). 28 Adjusting these parameters allows the model to strike a balance between bias and variance, thus improving its generalization to unseen data. 3.2.4 Extreme Gradient Boosting (XGBoost) Models XGBoost is a powerful ensemble learning method that employs boosting to enhance predictive accuracy. Boosting sequentially trains base learners, with each learner attempting to correct the errors of its predecessor. This process reduces both bias and variance, making XGBoost highly effective for complex datasets. In the context of time series forecasting, XGBoost also requires preprocessing steps such as creating lagged variables and incorporating external factors. The model aims to minimize the residual errors from previous iterations through sequential learning. The forecast for a time point t in XGBoost is the sum of the predictions from all the base learners (trees): ŷt+h = B X fb (x) (3.9) b=1 where K is the number of trees, and bk represents the prediction from the bth tree. Each tree is built to minimize a specified loss function L, typically MSE for regression tasks. Hyperparameter tuning is crucial for optimizing the XGBoost model’s performance. Key hyperparameters include (n estimators), which denotes the number of trees in the model; (max depth), representing the maximum depth of each tree; (learning rate), the step size shrinkage used to prevent overfitting; and (subsample), which refers to the proportion of training data used for each tree. By carefully tuning these hyperparameters, XGBoost can effectively model the temporal dependencies in time series data and provide accurate forecasts. 29 3.3 Forecast Combination Approaches There are many research that used a combination approach to improve accuracy in various fields. It has been witnessed that some researchers said that the combination approach provides better inflation forecast than individual models (Pratap and Sengupta, 2019), (Araujo and Gaglianone, 2023), etc. There are different ways to combine methods like simple average (SA) method, inverse rank method, Ordinary Least Squares (OLS) regression, Constrained Least Squares (CLS) regression, etc (Weiss et al., 2018). In our research, we implemented the SA and OLS combination method. Additionally, we have proposed a novel DDWFC approach which is explained in detail in the below section 3.3.3. 3.3.1 Simple Average (SA) Method The SA method is one of the most straightforward and widely used techniques for combining forecasts from multiple models. This method involves calculating the average of all available forecasts to produce a combined forecast. Despite its simplicity, it has established itself as a robust benchmark in forecasting practices due to its ease of implementation and effectiveness. Mathematically, the combined forecast ŷt+h using the SA method is computed as: M (SA) ŷt+h = 1 X (i) ŷ M i=1 t+h (3.10) (i) where M is the total number of forecasts, and ŷt+h represents the h-step ahead forecast of inflation rate from model i. Despite its simplicity, the SA method provides a reliable and effective approach to combining forecasts, often serving as a valuable benchmark for evaluating the performance of more sophisticated 30 forecasting methods (Weiss et al., 2018). 3.3.2 Ordinary Least Squares (OLS) Regression Method Crane and Crotty (1967) were the first to propose the use of regression for combining forecasts. In this approach, the combined forecast is a linear function of the individual forecasts, with the weights determined through a regression of the forecasts on the actual values. OLS method estimates the weights by minimizing the sum of squared errors. Once the OLS coefficients are estimated, the combined (OLS) forecast ŷt+h ) is given by: (OLS) ŷt+h = α + M X (i) βi ŷt+h + ϵ (3.11) i=1 (i) where ŷt+h represents the combined h-step ahead forecast of inflation rate, ŷt+h are the individual forecasts, βi are the weights to be estimated, α is the intercept, and ϵ is the error term. One advantage of the OLS forecast combination method is that it can produce unbiased combined forecasts due to the inclusion of the intercept term. This means that even if some individual forecasts are biased, the combined forecast can still be unbiased. However, a disadvantage of this method is that it places no restrictions on the combination weights—these weights do not need to sum to one and can even be negative. This can complicate the interpretation of the results (Weiss et al., 2018). 31 3.3.3 The Proposed Approach: A Novel Data-driven Weighted Forecast Combination (DDWFC) Approach Traditional forecasting methods often rely on single models, which may not fully capture the underlying patterns and complexities of the data. In the context of the combination approach, the SA method assigns equal weight to each forecast. However, this approach does not guarantee the best performance in all scenarios. In contrast, the OLS regression method minimizes the RMSE but lacks constraints on the weights, allowing them to be negative, which can be difficult to interpret. To address these issues, we introduced the Data-Driven Weighted Forecast Combination (DDWFC) approach. The idea of a data-driven approach is taken from (Hoque et al., 2021). The DDWFC method is called “data-driven” because it derives weights based on the forecast data itself. This approach calculates a weighted average of forecasts, assigning higher weights to more accurate forecasts. In this manner, DDWFC improves overall forecast accuracy and leverages the strengths of an individual model, resulting in more precise and robust predictions. In the first stage, we generate monthly forecasts using individual models for each of the specified horizons h ∈ {1, 3, 6, 12}. In the DDWFC approach, these forecasts are combined using random weights tailored for each horizon. The steps to generate the forecast for each horizon are performed separately, and the key idea behind the data-driven random weights approach is as follows: we begin with R iterations. In each iteration, a set of m random weights is generated from a uniform distribution on (0, 1). These weights have an equal probability of taking any value within this range and are then standardized to ensure their sum equals one. Then the corresponding DDWFC forecasts are calculated based on the random 32 Algorithm 1 Data-Driven Weighted Forecast Combination (DDWFC) Approach Require: Set of forecasting models {M1 , M2 , . . . , Mm }, time series data {yt }, forecast horizon h Ensure: For each horizon h ∈ {1, 3, 6, 12}: Optimized Weights (Wmopt ) (DDWFCopt ) Optimized Combined Forecast (ŷt+h ) 1: for h ← 1, 3, 6, 12 do 2: for each model Mm in the set of models do 3: Generate h-step ahead forecast ŷt+h (m) 4: end for 5: for r ← 1, . . . , R do 6: for t ← t + h, . . . , n do Wm ∼ Unif(0, 1), m = 1, 2, . . . , M 7: ▷ Generate random m-weights Wm ← PMWmW , m = 1, 2, . . . , M ▷ Standardize the weights to 8: m=1 m sum to 1 DDW F Ch,t ← 9: (m) m=1 Wm ŷt+h , PM m = 1, 2, . . . , M ▷ Compute the DDWFC forecast 10: end for 11: FESS.DDWFCh,r ← 2 t (yt+h − DDW F Ch,t ) P ▷ Compute the forecast error sum of squares (FESS) 12: end for 13: Wmopt ← arg min F ESS.DDW F Ch,r , r = 1, . . . , R ▷ Determine optimal weights based on minimum FESS P opt (m) 14: DDW F Chopt ← M m=1 Wm ŷt+h ▷ Compute optimal combined forecast 15: end for return Wmopt , DDW F Chopt 33 weights, W = (W1 , . . . , Wm ). Then the h-step ahead FESS are computed to get the optimal weights. This process results the FESS values with r sets of random weights and we select the one that yields the minimum FESS. Finally, the optimal weights are used to calculate the inflation forecasts using DDWFC approach. The combined inflation forecasts using DDWFC are computed based on these random weights, denoted as W = (W1 , W2 , . . . , Wm ). We then calculate the hstep ahead forecast errors to identify the optimal weights. To do this, we evaluate the FESS values (FESS1 , FESS2 , . . . , FESSr ) for all R sets of random weights and select the set with the minimum FESS. The weights derived from this minimum FESS are considered optimized and are used to compute the final inflation forecasts. Algorithm 1 details the steps for computing the DDWFC forecast for inflation. Let ŷt+h be the h-step ahead forecast of the inflation rate yt . The DDWFC model is defined as follows: (DDWFC) ŷt+h = M X (m) Wmopt ŷt+h (3.12) m=1 where, M denotes the total number of different models utilized in the forecast combination. Each model m provides an h-step ahead forecast, represented as (m) ŷt+h . The weights assigned to these forecasts are constrained such that their sum P equals 1, i.e., M m=1 Wm = 1, with each weight Wm being non-negative (Wm ≥ 0). For example, if we have 3 models then the DDWFC model can be written as: (DDWFC) ŷt+h (1) (2) (3) = W1opt ŷt+h + W2opt ŷt+h + W3opt ŷt+h (3.13) The proposed DDWFC model innovates by optimizing forecast weights through the minimization of the FESS, thus bypassing traditional forecasting constraints 34 and enhancing forecast accuracy. Additionally, all possible forecast combinations are made manually from the existing individual forecast. The number of possible combinations for M individual forecasts is given by:        M  X M M M M Total no. of Comb. = = + +···+ = 2M − M − 1 k 2 3 M k=2 (3.14) Among these combinations, the one providing the minimum RMSE is considered the optimized combination for forecasting. The optimized weights are then calculated from the minimum FESS. However, manually selecting and evaluating combinations of forecast models is time-consuming and computationally very intensive. Manual selection might not explore all possible combinations. And there is the possibility of human error that may not identify the best combination. As the number of models and combinations increases, the complexity of manual evaluation increases making it impractical. Finally, we automated a process of selecting the best combination of models. The algorithm explores all possible combinations from the given forecasts. For example, with 6 different forecasts, the algorithm evaluates com     binations of 2, 3, 4, 5, and 6 forecasts, using 62 + 63 + 64 + 65 + 66 = 57 combinations in total to find the optimal set. Then for each combination, it calculates optimal DDWFC and FESS; the combination that provides minimum FESS is considered the best combination for the inflation forecast for the given period. In this automated algorithm, we identify the optimal model combination for each forecast horizon. Specifically, for each horizon h, we determine which combination of models provides the best performance. For instance, at horizon h = 1, the optimal combination might be {A, B}; at horizon h = 3, it could be {B, C, D}; at horizon h = 6, {A, B, C}; and at horizon h = 12, {B, C, D}. By analyzing all the recommended best combinations from the automated algorithm 35 Algorithm 2 An Automated Algorithm of the Best Model Combination Selection Require: Set of forecasting models {M1 , M2 , . . . , Mm }, time series data {yt }) Ensure: For each horizon h ∈ {1, 3, 6, 12}: (DDWFCopt ) opt Best Combination, Optimized Weights (Wm ), Optimized Combined Forecast (ŷt+h 1: Let N = 2M − M − 1 ) ▷ Calculate the number of possible combinations excluding single-model combinations 2: for h ← 1, 3, 6, 12 do 3: for each model Mm in the set of models do 4: Generate h-step ahead forecast ŷt+h 5: (m) end for 6: end for 7: for each non-empty combination of models C such that |C| ≥ 2 do 8: 9: for h ← 1, 3, 6, 12 do for r ← 1, . . . , R do for t ← t + h, . . . , n do 10: 11: Wm ∼ Unif(0, 1), m = 1, 2, . . . , M 12: Wm ← PMWmW , m = 1, 2, . . . , M ▷ Standardize the weights to sum to 1 m m=1 PM (m) DDW F CC,h,t ← m=1 Wm ŷt+h , m = 1, 2, . . . , M ▷ Compute the 13: ▷ Generate random m-weights DDWFC forecast 14: end for 15: FESS.DDWFCC,h,r ← P t (yt+h − DDW F CC,h,t ) 2 ▷ Compute the forecast error sum of squares (FESS) 16: end for 17: opt Wm ← arg min F ESS.DDW F CC,h,r , r = 1, . . . , R ▷ Determine optimal weights based on minimum FESS 18: 19: opt DDW F CC,h ← opt (m) m=1 Wm ŷt+h PM FESS.DDWFCC,h ← P  t ▷ Compute optimal combined forecast 2 , h=1,3,6,12 ▷ Compute optimal opt yt+h − DDW F CC,h FESS for each combination of models C 20: end for 21: Best Combination ← arg minC FESS.DDWFCC,h ▷ Determine best combination of models based on minimum FESS 22: end for opt return Best Combination, Wm , DDW F C opt 36 for each horizon, we create a single combined model. This model incorporates the distinct models identified for each horizon from the automated algorithm. In this scenario, the combined DDWFC model would include {A, B, C, D}, with each model being incorporated exactly once. This combined model aims to provide the minimum RMSE and the most accurate forecast, as it allocates more weight to the more accurate forecasts. Algorithm 2 outlines the steps for selecting the best combination model forecast. This automated process not only saves time and effort but also simplifies the implementation of any dataset with available forecasts. Future research could explore the application of DDWFC in various domains. 3.4 Evaluation Metrics Thus, the following evaluation measures are used in this work to compare the effectiveness of the developed forecasting models. These are quantitative measures of forecast accuracy and are very useful when comparing the performance of different models to identify the best one. RMSE, MAE, and MAPE are defined below, where T is the number of observations, yt represents the actual time series value at time t, and ŷt represents the forecast at time t. 3.4.1 Root Mean Squared Error (RMSE) RMSE is a widely used metric that measures the average magnitude of the forecast errors. It is defined as: v u T u1 X t RMSE = (yt − ŷt )2 T t=1 (3.15) 37 RMSE is higher in the sense that it assigns more weight to large error values, making it sensitive to outliers (Hyndman and Athanasopoulos, 2018). 3.4.2 Mean Absolute Error (MAE) MAE measures the average magnitude of the absolute errors between the forecasted and actual values: T 1X MAE = |yt − ŷt | T t=1 MAE is less sensitive to outliers compared to RMSE since it does not square the errors. It provides a straightforward measure of average forecast error magnitude (Hyndman and Athanasopoulos, 2018). 3.4.3 Mean Absolute Percentage Error (MAPE) MAPE expresses the forecast errors as a percentage of the actual values. It is defined as: n 100 X yt − ŷt MAPE = T t=1 yt MAPE is useful for understanding the relative magnitude of errors in the context of the actual values. However, it has limitations when actual values are close to zero, potentially leading to undefined or infinite errors (Hyndman and Athanasopoulos, 2018). 38 These evaluation metrics are crucial for assessing the accuracy and reliability of forecasting models. By comparing RMSE, MAE, and MAPE across different models, researchers can identify which model provides the most accurate forecasts for their specific application. 3.5 Unbiasedness To evaluate the accuracy and potential bias of the combined forecasts, we applied the Wald test across various forecast horizons. For each horizon (h = 1, 3, 6, 12 months) we fitted a linear regression model to compare the forecasts of all implemented models against the actual inflation values. Specifically, for each forecast horizon h, we used the regression model: yt+h = α + β ŷt+h + ϵ (3.16) where yt+h represents the actual inflation values, ŷt+h is the forecast values for the h-step ahead, and α and β are the intercept and slope parameters, respectively. The null hypothesis H0 tested whether the forecasts were unbiased, i.e., α = 0 and β = 1. First, the lm() function is used to model the relationship between the true values and the forecasts. To test whether the forecasts are unbiased, we conducted a Wald test using the linearHypothesis function from the car package in R, which assesses whether the constraints on α and β holds true. The Wald test evaluates whether the estimated parameters significantly deviate from the hypothesized values of α = 0 and β = 1. The p-values obtained from the Wald test indicate 39 whether the null hypothesis can be rejected. A low p-value (p < 0.05) suggests that the forecasts are systematically biased, while a high p-value (p > 0.05) implies that the forecasts are unbiased. 3.6 Time series Cross Validation The Canada inflation study is conducted for different horizons (h = 1, 3, 6, 12 months). For example, • 1-Step Ahead Forecast: A 1-step ahead forecast involves predicting the value of a time series for the next single time period based on previous data. For instance, if the actual values up to December 2023 are given, then the 1-step ahead forecast will be the value of January 2024. • 3-Step Ahead Forecast: A 3-step ahead forecast predicts the value of a time series exactly three periods into the future. For example, if using data up to December 2023 to create a forecast, a 3-step ahead forecast will estimate the value for March 2024. Based on a literature review, Time Series Cross-Validation (TSCV) is a special kind of cross-validation technique for evaluating model performance. Unlike the other types of cross-validation, TSCV retains the order of data points because, in forecasting tasks, future data should not influence past data. This makes it possible for models to be trained with data only up to a certain point and tested on the subsequent data, a procedure that mimics real-life forecasting more accurately. Thus, by maintaining the temporal structure in its testing, TSCV provides robust assessments of a model’s ability to generalize to new data, thereby improving the 40 reliability of the forecasts in time series domains (Hyndman and Athanasopoulos, 2018). For our research, we implemented rolling window cross-validation. It is one of the common time series cross-validation techniques where a fixed-size training window is shifted along the data set. In this approach, at each step, the model learns from the data within the current window and then tests against the data in the next window. This iterative process continues until all data points have been used for both training and evaluation. While, as opposed to other methods which keep the training set fixed, the rolling window cross-validation allows the model to adapt the changes in data over time. This approach ensures that the model’s performance is assessed under realistic conditions, reflecting its ability to generalize across different segments of the time series data (Pal, 2021). Figure 3.2 shows the schematic diagram of a one-step-ahead forecast. 1 2 3 4 5 Dropped Train Test Figure 3.2: Schematic diagram of rolling window time series cross-validation for 1-step ahead forecast. 41 3.7 Data This work is based on monthly time-series data and the required data for Canada inflation forecasting is downloaded from the Federal Reserve Economic Data FRED and the Bank of Canada BoC spanning from January 1972 to August 2023. Inflation is measured in terms of the Consumer Price Index (CPI) which is calculated by Statistics Canada. It is measured as the 12-month percentage change in the Consumer Price Index (CPI) which involves determining the percent change in the CPI of a given month compared to those of the same month in the previous year.  Inflation Rate, yt = CPIt − CPIt−12 CPIt−12  × 100 (3.17) where yt is the inflation rate at month t, CPIt is the CPI for the current month, and CPIt−12 is the CPI for the same month from the previous year. Figure 3.3 represents the trend of the inflation rate from January 1972 to August 2023. There are various external economic variables that impact inflation dynamics. This research has included the following variables for inflation analysis. • Unemployment Rate: Many researchers often use unemployment in inflation forecasting due to its significant relationship with inflation. The Philips curve indicates the inverse relation between inflation and unemployment which is used by many researchers in inflation forecasting (Engemann, 2020). This emphasizes to the importance of unemployment in inflation forecasting. Guirguis et al. (2022) explored the combination of the Phillips curve with global inflation data and was able to provide a more accurate inflation forecast for the US. Changes in the Employment-to-Employment rate influence macroeconomic conditions and policy development (Birinci 42 Figure 3.3: Monthly Inflation Rate of Canada from January 1972 to August 2023 et al., 2022). According to a recent article by Beaudry (2023), countries with higher unemployment rates tend to experience greater volatility in inflation. In order to project inflation, Araujo and Gaglianone (2023) and Barkan et al. (2023) employed the unemployment rate as a covariate in addition to other factors. • Interest Rate: Central banks use interest rates as inflation control tools (Angelina and Nugraha, 2020; BoC, 2023b; Rodrı́guez-Vargas, 2020). This means there is a strong relationship between interest rates and inflation. Bank of Indonesia uses the SBI interest rate as a benchmark interest rate to monitor and control the inflation of Indonesia (Angelina and Nugraha, 2020). Similarly, the BoC uses the overnight rate of Canada (interest rate). A recent article says a high interest rate reduces inflation (Fix, 2023). Mucuk et al. (2023) examined the long-term effect of some covariates like in- 43 terest rate, exchange rate, and money supply, etc. on the inflation of some countries like Haiti, Sudan, Türkiye, and Zambia, which are among the world’s highest-inflation countries according to 2021 data. According to the result, the interest rate is negatively correlated to inflation. • Exchange Rate: Numerous academic papers have examined the complex link between exchange rate pass-through (ERPT) and domestic inflation (Angelina and Nugraha, 2020). Currency rate movements have both direct and indirect effects on the Canada inflation rate (Savoie-Chabot and Khan, 2015). Monitoring exchange rates is crucial for understanding variations in the inflation rate and hence researchers consider exchange rates in inflation forecasting (Rodrı́guez-Vargas, 2020). • Oil Price: The rise in oil prices after COVID and Russia’s invasion of Ukraine had impacted inflation which resulted in an increase in inflation. It is one of the most important external economic variables that influences inflation and thus economic activity of any country. Inflation studies from Rodrı́guez-Vargas (2020), Medeiros et al. (2021), Theoharidis et al. (2023), etc have included oil prices to forecast inflation. • Money Supply: Studies from Angelina and Nugraha (2020),Mucuk et al. (2023) proved money supply is positively related to the inflation. Similarly, Medeiros et al. (2021) and Araujo and Gaglianone (2023) also used money supply as one of the covariates to forecast the inflation of their respective countries. • BCPI: Some studies say that the commodity price index is the leading indicator for inflation or some studies say that there is a weak relation between them. Boughton and Branson (1988) examined the relation between the 44 commodity price index and inflation for G-7 countries. For our research, we included this variable to analyze the impact of BCPI on inflation. Figure 3.4 represents the dynamics of external economic variables that are being used for projecting inflation for various horizons. Figure 3.4: Dynamics of all External Economic Variables Overall, for this research, CPI, the unemployment rate of Canada, the overnight rate of Canada (interest rate), the Canadian exchange rate against the US dollar, the WTI crude oil price, and the M3 money supply of Canada are collected from FRED whereas the Canadian commodity price index (BCPI) sourced from BoC. And aim to forecast the inflation rate using the above-mentioned external economic variables. 45 Chapter 4 Data Analysis The main goal of this study is to forecast inflation in Canada across various time horizons ((h = 1, 3, 6, 12 months) and to provide insights that can be useful for policymakers and economists. The analysis uses a time-series dataset on inflation and external economic variables such as unemployment rates, interest rates, exchange rates, oil prices, money supply, and commodity price indexes to assess their impact on inflation. The dataset covers the period from January 1972 to August 2023, totaling 620 months. For the analysis, the dataset is split into a training set (January 1972 to December 2016) having 540 observations, and a test set (January 2017 to August 2023). Figure 4.1: Monthly inflation rate of Canada over the period, with the red vertical line indicating the division between the training set and the test set. 46 Figure 4.1: Monthly Inflation Rate of Canada from January 1972 to August 2023 4.1 Timeseries Cross-Validation Approach We utilized cross-validation specifically designed for time-series data to develop a robust model. Random partition of the time-series data can not be done, to perform cross-validation due to the temporal nature and autocorrelation between the data. We used rolling window time-series cross-validation (rolling CV) on monthly inflation data across all horizons to ensure reliable forecasts. Rolling CV preserves the chronological order of the data. In this procedure, the training window is kept fixed while the test set consists of a single observation at each iteration. For example, in a 1-step ahead forecast, the initial training window covers the period from January 1972 to December 2016. The model then forecasts the next month. As shown in Figure 3.2, the dark blue represents the training window, the grey box indicates the monthly inflation rate and the yellow part 47 shows the forecast. In the second iteration, the earliest month is dropped from the training window, and one additional month is included at the end, thus moving the training window forward. This process continues until forecasts are generated up to August 2023. This rolling window technique was applied for forecasting horizons of 3, 6, and 12 months. Table 4.1 outlines the forecast periods based on the initial training window and the number of forecast months. Horizon Initial Window (540 months) Forecast Window Total Forecasts (months) h=1 Jan 1972 to Dec 2016 Jan 2017 to Aug 2023 80 h=3 Jan 1972 to Dec 2016 Mar 2017 to Aug 2023 78 h=6 Jan 1972 to Dec 2016 Jun 2017 to Aug 2023 75 h = 12 Jan 1972 to Dec 2016 Dec 2017 to Aug 2023 69 Table 4.1: Initial and Forecast Windows for Different Horizons 4.2 Descriptive Statistics This dataset has been checked for missing values, and none are present. Before implementing and evaluating models, we analyzed the inflation time series. Analyzing the inflation data from 1972 to 2023 provides a comprehensive view of its behavior over different economic regimes and cycles. Figure 4.1 highlights the significant variability in the inflation rate due to various economic events and policy responses. During this period, the maximum inflation rate recorded was 12.9% in December 1974, coinciding with the first oil crisis, which led to a significant increase in energy prices and broad-based inflationary pressures. The high inflation rates of the 1970s and early 1980s contrast sharply with the low and stable inflation experienced from the mid-1990s onwards. The minimum inflation rate 48 was -0.9% in July 2009, following the global financial crisis, which resulted in a severe economic downturn and deflationary conditions. After COVID-19, due to supply chain disruptions, the rise in energy prices, and the Russia-Ukraine invasion, inflation reached 8.1% in June 2022. The summary statistics Table 4.2 shows the distribution and characteristics of inflation and external variables that influence it. These statistics include the mean, median, standard deviation, minimum, maximum, range, skewness, and kurtosis. The mean inflation rate is 4.01%, and the median is 2.70%, indicating a slight positive skew in the inflation distribution. The standard deviation is 3.24%, reflecting moderate fluctuations around the mean. The skewness value of inflation is 1.07. This suggests that the distribution has more frequent lower inflation values, with occasional higher spikes. Kurtosis has a value of 0.12 for inflation, indicating that while there are outliers, they are not extreme enough to heavily influence the overall distribution. In addition to inflation, the external variables also exhibit notable characteristics that influence its behavior. For example, the interest rate has a mean of 5.79% with a standard deviation of 4.27%, indicating considerable variability in monetary policy over time. Other external variables, such as oil prices and unemployment rates, display higher levels of skewness and kurtosis, reflecting significant fluctuations and the presence of extreme values that could potentially impact inflation dynamics. 49 Variable Mean Median SD Min Max Range Skewness Kurtosis Inflation Rate 4.01 2.70 3.24 -0.95 12.90 13.85 1.07 0.12 Interest Rate 5.79 4.75 4.27 0.50 21.03 20.53 0.74 0.03 Money Supply 8.92 7.63 5.03 0.65 28.35 27.70 1.13 1.16 Exchange Rate -0.35 -0.71 6.45 -22.63 24.17 46.80 0.33 1.32 Unemployment Rate 1.06 -2.90 18.85 -41.84 161.11 202.96 3.04 16.83 Oil Price 12.82 4.98 42.45 -74.08 272.93 347.01 1.78 5.19 BCPI 355.92 289.10 161.35 100.00 889.08 789.08 0.95 0.17 Table 4.2: Summary Statistics of Economic Variables 4.3 STL Decomposition “STL is an acronym for Seasonal and Trend decomposition using Loess, while Loess is a method for estimating nonlinear relationships” (Hyndman and Athanasopoulos, 2018). To check seasonality in the data, we performed seasonal decomposition, which breaks down time-series data into trends, seasonal patterns, and residual components. The trend represents the long-term progression or direction in the data, seasonal patterns reflect repeating cycles, and residuals are the random fluctuations or noise. Figure 4.2 shows the seasonal decomposition of Canada’s inflation data. The decomposition reveals that the seasonal component is negligible, with the analysis primarily highlighting the trend and residual components. This suggests that seasonality does not significantly influence Canada’s inflation rate. 50 Figure 4.2: STL Decomposition of Inflation Rate 4.4 Distribution and Transformation of Data When analyzing time-series data, stationarity is a key concept because simpler, stationary series are easier to model and often provide more accurate forecasts. This is achieved through transformations and adjustments to the time-series data. Therefore, we examined the distribution and trend of all time-series used for the inflation analysis. Figure 4.3 shows that the inflation rate distribution is not normal and is positively skewed, with some outliers. This skewness indicates a deviation from normality, which can affect the performance of time-series models. The Box-Cox transformation is designed to stabilize variance and make the data more normally distributed. However, because the inflation series contained negative values, a direct application of the Box-Cox transformation was not fea51 sible, as it requires strictly positive values. To address this issue, we applied a shifted transformation to ensure all values were positive. Specifically, we added a constant to all values in the inflation time-series, calculated as the absolute value of the minimum inflation rate yt plus one. This shifting transformation was applied as (yt′ = yt + |min(y)| + 1), where min(y) is the minimum value in the dataset, and yt′ is the shifted value. This transformation allowed us to use the Box-Cox transformation on the adjusted data. The optimal parameter λ for the Box-Cox transformation was estimated using Guerrero’s method and was found to be approximately 1.05. Since λ close to 1 suggests that the transformation is close to the original data and did not significantly alter the variance. Therefore, we decided to retain the original inflation series for further analysis. Figure 4.3: Distribution of Inflation Rate In time-series analysis, particularly when forecasting inflation, outliers can significantly impact the results and interpretation of models. In our analysis, outliers are present across all external economic variables, including inflation rates. 52 Figure 4.4 depicts the boxplots of these variables, highlighting the presence of outliers. Examples of these outliers include extreme inflation rates during periods of oil crises (1973–1974) or the financial downturn (2020–2021). Outliers often represent critical economic shocks or events that are crucial for accurate inflation forecasting. So, we chose to retain these outliers in our dataset rather than remove them. By including outliers, we can assess the robustness of our forecasting models under extreme conditions. This can be helpful for real-world applications where extreme events are possible. Figure 4.4: Boxplot of External Economic Variables To assess the stationarity of the inflation and external variable time series data, we conducted the Augmented Dickey-Fuller (ADF) test. The ADF test helps determine whether a time series has a unit root, indicating non-stationarity. The inflation rate series (inflation rate) has a p-value of 0.1442, suggesting it is non-stationary and may require further adjustment. Conversely, the money supply (money supply), exchange rate (exchange rate), interest rate (interest 53 rate), unemployment rate (unemployment rate), and oil price (oil price) series all exhibit p-values below 0.01, indicating they are stationary. The BCPI series (bcpi) has a borderline p-value of 0.064, suggesting it is close to stationary. The non-stationarity of the inflation series can also be seen from ACF plot 4.5. This plot reveals significant autocorrelation at various lags, indicating a strong relationship between past and present values. Differencing might make the series stationary. Figure 4.5: ACF Plot of Inflation Rate 4.5 Correlation Analysis The following Figure, 4.6, illustrates the correlation between inflation and external variables. 54 Figure 4.6: Correlation Plot of Inflation Rate and External Variables(Infl=Inflation Rate, IntRt = Interest Rate, MS = Money Supply, ExRt = Exchange Rate, Unemp = Unemployment Rate, OilPr = Oil Price) The Figure reveals a linear relationship between the inflation rate and the interest rate, with a correlation coefficient of 0.722. Similarly, the inflation rate shows a linear relationship with the money supply. However, the interaction between the inflation rate and unemployment rate, exchange rate, oil price, and BCPI is characterized by a non-linear relation. Different modeling approaches will help to capture these relationships and the impact on inflation more accurately. 55 4.6 Models for Forecast Various models were implemented to forecast Canada’s inflation data for different horizons h = 1, 3, 6, 12 using rolling window cross-validation. The results and behavior of each model are detailed below. 4.6.1 Time-series Models ARIMA Model As discussed, inflation time-series data is non-stationary. To effectively implement time-series models, the data must be transformed to achieve stationarity. ARIMA model is a widely used model for forecasting time-series data. In this analysis, we first fitted ARIMA models to the inflation training set and forecasted for various horizons using rolling window cross-validation. The auto.arima() function from the forecast package in R was employed to select the optimal ARIMA model configuration at each iteration automatically. This function takes care of stationarity by incorporating necessary differencing. A notable finding from this process was that, across different iterations, the models selected by auto.ARIMA() consistently included a differencing component (d=1). In time series forecasting differencing is used to achieve stationarity in the data. Figure 4.7 illustrates the differenced time series (d=1) of the inflation rate, demonstrating that the series has achieved stationarity. Figure 4.8 presents the ACF plot of the differenced series, which shows the underlying correlation structure of the stationary series. For different forecasting horizons, the ARIMA models selected were as follows: ARIMA(1,1,0) for horizon 1 (h = 1), 56 ARIMA(0,1,1) for horizon 3 (h = 3), and ARIMA(0,1,1) for horizons 6 (h = 6) and 12 (h = 12). Figure 4.9 illustrates the arima forecast graphs for all horizons. For h = 1, the model provided the best forecast as compared to other horizons. We used the result of the ARIMA model as the benchmark result. Figure 4.7: First Difference of Inflation Rate 57 Figure 4.8: ACF plot of Inflation Differenced Series 58 Figure 4.9: ARIMA Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the ARIMA forecast. Dynamic Regression (DR) Model Unlike the ARIMA model, which only depends on past values of the target variable for forecasting, the DR model integrates the influence of external variables along with lagged values. DR model can include past values due to the inclusion of ARIMA errors. In this study, the external variables incorporated into the model include the unemployment rate, exchange rate, oil price, money supply, interest rate, and BCPI. We used the Arima() function with predictors from the forecast package in R to implement the DR model. To ensure robustness, we employed a 59 rolling window cross-validation technique for each horizon. At every horizon, this method uses different subsets of the data in each iteration, leading to varying residual patterns. Therefore, the model uses different ARIMA errors to capture the changing autocorrelation structures in the residuals at each iteration. The inflation forecast shown in Figure 4.10 across all horizons indicates that the forecasts produced by the DR model closely align with the actual inflation rates. Fluctuations in the external variables significantly impact inflation, and their inclusion allows the DR model to forecast inflation more accurately. By incorporating these factors, the model becomes more responsive to real-world economic conditions, potentially leading to more precise and reliable forecasts. Figure 4.10: DR Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the DR forecast. 60 4.6.2 Machine Learning Models Neural Network Autoregression (NNAR) Model The NNAR model is specifically designed for time series data to capture its nonlinearity and complexity. NNAR utilizes a neural network with a single hidden layer and incorporates lagged values as inputs. In our implementation, we employed the NNETAR() function from the forecast package in R to apply the NNAR methods. We used rolling window cross-validation to forecast Canada’s inflation across horizons h = 1, 3, 6, 12. We implemented both NNAR models with and without external variables. Figure 4.11 shows the forecast of the NNAR model without using an external variable. Figure 4.11: NNAR Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the NNAR forecast. 61 We employed the NNAR model with external variables such as the unemployment rate, exchange rate, oil price, money supply, interest rate, and BCPI. The RMSE values indicate that there is minimal improvement in forecasting accuracy for horizons h = 1 and h = 3, the inclusion of external variables led to notable improvements in accuracy for horizons h = 6 and h = 12. For both models, the most frequently used configurations were NNAR(13,7) or NNAR(26,14) at each iteration. Here, NNAR(26,14) refers to a model that uses 26 past observations and includes 14 neurons in the hidden layer to forecast inflation. Figure 4.12 shows the forecast of the NNAR model including external variables. The forecast graph demonstrates that the NNAR model with external variables performs better than the NNAR model without external variables for all horizons (h = 3, 6, 12), except for the h = 1 forecast. Figure 4.12: NNARX Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the NNARX forecast. 62 Random Forest (RF) Model As the RF model can not be directly implemented on time-series data, six lagged values of inflation rate are included as predictors to capture temporal relationships. Separate datasets were created for each forecast horizon, as detailed in Section 3.2. The RF model was implemented using the randomForest package and trained with the caret package, utilizing rolling window time series cross-validation with a window size of 500. The model was trained using the rf method with an mtry value of 4 and 100 trees (ntree). Figure 4.13 presents the forecasts from the RF model across different horizons. However, as shown in the RMSE table Table 4.6, the RF model did not perform well for shorter horizons. Figure 4.13: RF Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the RF forecast. 63 Extreme Gradient Boosting (XGBoost) Model Similar to the RF model, six lagged values are included as predictors. The XGBoost model was implemented using the xgbTree method from the caret package, with hyperparameters tuned through a grid search. The model was configured with 100 boosting rounds, a maximum depth of 4, a learning rate (eta) of 0.1, and other relevant parameters. Rolling window time series cross-validation with a window size of 500 was used for training, ensuring robust evaluation. Figure 4.14 illustrates the forecasts from the XGBoost model across different horizons, while Table 4.6 presents the RMSE results, showing the XGB model has poor performance than RF model across all horizons. Figure 4.14: XGB Forecast at various horizons from Jan 2017 to Aug 2023. The black line represents the actual Inflation Rate (IR), while the red line shows the XGB forecast. 64 4.6.3 Forecast Combination Approaches Simple Average (SA) Method This is the most common combination method of combining different forecasts. In our analysis, we combined forecasts from the DR, NNAR, NNARX, and XGB models, assigning equal weights to each model. However, the average combination model did not improve accuracy due to the equal contribution of each forecast. Ordinary Least Squares (OLS) Regression Method The combined OLS forecast incorporates forecasts from DR, NNAR, NNARX, and XGB models to get a more precise forecast. This approach allows different weights to be assigned to each model, potentially improving accuracy across various horizons. However, this method derives negative weights, which makes it complicated to interpret the negative contribution of the model and seems unrealistic. Additionally, there is no constraint on the weights. Table 4.3 presents the weights derived using the OLS method. Model Weights h=1 h=3 h=6 h = 12 DR β1 0.775 0.598 0.381 1.419 NNAR β2 0.315 -0.069 -0.017 -0.392 NNARX β3 0.127 -0.097 0.052 -0.039 XGB β4 -0.228 0.895 2.046 2.148 0.988 1.327 2.462 3.135 Sum of Weights Table 4.3: Weights derived from OLS Regression Method 65 We employed the lm() function in R for the OLS regression method. This function, by default, includes an intercept in the regression model. Although this combination method provides an unbiased forecast and yields the minimum RMSE, we have opted not to consider it further due to the negative weights and the lack of constraints on the weights. Proposed Data-driven Weighted Forecast Combination (DDWFC) Approach This paragraph explains the evaluation of the novel approach. Combination methods, such as the SA and OLS, did not yield satisfactory results, with the SA method failing to improve accuracy and OLS producing negative weights. To overcome these limitations, a novel DDDWFC approach was proposed. This method combines forecasts from different models by assigning weights that minimize the FESS. Algorithm 1 outlines the steps involved in the DDWFC approach. Based on Algorithm 1 for the DDWFC approach we chose R=4000 to optimize the weights. From the six models considered (ARIMA, DR, NNAR, NNARX, RF, and XGB), there are a total of           6 6 6 6 6 + + + + = 57 2 3 4 5 6 possible combinations. After manually testing all possible combinations, it was found that the combination of DR, NNAR, NNARX, and XGB yielded the minimum RMSE. The DDWFC method ensures that the weights are positive and sum to 1, allowing the combined forecast to leverage the strengths of each model. Table 4.5 will show the weights derived through the DDWFC method. Notably, the optimized weights heavily favor the DR model, highlighting its significant contribution to forecast accuracy. 66 Manually selecting the optimal models for forecast combinations for each horizon is time-consuming. And there is a possibility of selecting a biased combination due to human error. Hence we employed an automated Algorithm 2 to determine the best set of forecast model combinations. The results obtained from this automated approach are presented in Table 4.4. Horizon Combination RMSE h=1 DR+NNAR+NNARX 0.374 h=3 DR+NNAR+XGB 0.740 h=6 DR+NNARX+XGB 1.172 h = 12 DR+XGB 1.739 Table 4.4: Best Combination from the Automated Algorithm 2 for different horizon As per the automated Algorithm 2, we combine DR, NNAR, NNARX and XGB models using the DDWFC approach. That is, we can write the DDWFC approach as (DDWFC) ŷt+h (DR) (NNAR) = W1opt ŷt+h + W2opt ŷt+h (NNARX) + W3opt ŷt+h (XGB) + W4opt ŷt+h (4.1) The results from this automated algorithm were consistent with those obtained through manual selection. Specifically, Table 4.6 presents the RMSE values for the DDWFC model, which were identical to the outcomes from the automated approach. This automated method proves to be highly efficient, as it minimizes the manual effort required to evaluate different model combinations. It is especially beneficial when dealing with a large number of individual forecasts, making the process of selecting the optimal forecast combination much more manageable and less error-prone. 67 Optimal Weights h = 1 h = 3 h = 6 h = 12 Model DR W1 0.639 0.831 0.783 0.967 NNAR W2 0.250 0.122 0.027 0.003 NNARX W3 0.107 0.007 0.107 0.009 XGB W4 0.004 0.040 0.084 0.022 1 1 1 1 Sum of Weights Table 4.5: Weights derived from DDWFC approach This optimized weight assignment, particularly the emphasis on the Dynamic Regression model, underscores the importance of incorporating external economic variables to enhance forecasting precision. The DDWFC method’s ability to adaptively select and weight models based on historical performance provides a robust and reliable forecasting framework that can guide policymakers and economists effectively. Graphical analysis (Figure 4.15) of the actual inflation rate versus forecasts from the DDWFC models demonstrates that our approach closely aligns with actual values. As the forecast horizon lengthens, uncertainty increases, which explains the greater deviation in forecasts. Nonetheless, the DDWFC method outperforms all other implemented models, offering a more accurate and reliable forecast. 68 Figure 4.15: Forecast for horizon h = 1 using the DDWFC model. Figure 4.15 depicts forecasts for horizon h = 1 using the DDWFC model. The xaxis represents time periods, while the y-axis shows the forecasted inflation rate. The forecast accuracy for the h = 1 horizon is observed to be high, indicating that the DDWFC model performs well in short-term forecasts. 69 Figure 4.16: Forecast for horizon h = 3 using the DDWFC model. Figure 4.16 shows the forecast for horizon h = 3 using the DDWFC model. Compared to h = 1, the forecast error increases, which is typical as forecasting accuracy tends to decline with longer horizons. The DDWFC model still maintains relatively stable performance. 70 Figure 4.17: Forecast for horizon h = 6 using the DDWFC model. Figure 4.17 depicts that, for horizon h = 6, the forecasted values continue to show some increase in error. However, the DDWFC model provides a more accurate forecast compared to other models evaluated, showcasing its robustness even at mid-range horizons. 71 Figure 4.18: Forecast for horizon h = 12 using the DDWFC model. At the horizon, h = 12, Figure 4.18 illustrates the forecast accuracy for the longest period considered. Despite an increase in forecast error, the DDWFC model performs competitively, demonstrating its effectiveness in longer-term forecasting while showing an acceptable level of accuracy. 4.7 RMSE We have evaluated all implemented models using RMSE values across various forecast horizons, as shown in Table 4.6. Among the individual models, the DR model consistently provides the most accurate forecasts across all horizons. In contrast, models such as ARIMA, NNAR, and XGB exhibit increasing errors as the forecast horizon extends, indicating that they are better suited for short-term 72 predictions. When considering combination approaches, the SA method did not improve accuracy beyond what the DR model achieved. Although the OLS model delivers the lowest RMSE values, its use of negative weights in the forecast combination raises concerns about its interpretability and reliability. The proposed DDWFC model shows superior performance, particularly for the 1, 3, and 6month horizons. Overall, DDWFC emerges as the most reliable model across all horizons, with the DR model also demonstrating strong performance, especially for long-term forecasts. Model h = 1 h = 3 h = 6 h = 12 ARIMA 0.491 0.997 1.583 2.455 DR 0.393 0.753 1.203 1.739 NNAR 0.459 1.141 1.885 3.106 NNARX 0.481 1.126 1.713 2.641 RF 0.598 0.970 1.631 2.243 XGB 0.528 1.200 2.005 2.547 SA 0.409 0.883 1.335 2.211 OLS 0.369 0.678 0.887 1.185 DDWFC 0.374 0.741 1.174 1.746 Table 4.6: RMSE Value for Implemented Models across various Horizons 4.8 Unbiasedness To check the unbiasedness of the forecasts, we performed the Wald test. High p-values (p > 0.5) across these models typically indicate that the forecasts are unbiased, whereas low p-values (p < 0.5) suggest significant bias. The p-values 73 of the Wald test for the various models are shown in Table 4.7 and demonstrate that horizons reveal differing degrees of forecast bias. For the ARIMA model, forecasts exhibit significant bias at horizons of 3, 6, and 12 months, though they appear unbiased at the 1-month horizon. The DR model, on the other hand, consistently shows unbiased forecasts across all horizons. Forecasts from the NNAR and NNARX models are biased at the 3, 6, and 12-month horizons. Similarly, the RF model demonstrates bias at the 6 and 12-month horizons. The XGB model generally shows bias except at the 12-month horizon. The SA method produced unbiased forecasts for most horizons except the 12 months. The OLS method results in unbiased forecasts across all horizons. Lastly, the DDWFC method also maintains unbiased forecasts across all horizons. Model h = 1 h = 3 h = 6 h = 12 ARIMA 0.270 0.030 0.001 0.000 DR 0.834 0.776 0.601 0.800 NNAR 0.538 0.013 0.000 0.000 NNARX 0.207 0.008 0.000 0.000 RF 0.303 0.083 0.011 0.001 XGB 0.000 0.000 0.000 0.024 SA 0.236 0.395 0.838 0.018 OLS 1.000 1.000 1.000 1.000 DDWFC 0.775 0.472 0.736 0.850 Table 4.7: P-values from the Wald test for Implemented Models across various Horizons 74 Chapter 5 Simulation In order to evaluate the performance of the proposed DDWFC approach, we also conducted some simulation experiments. We simulated time-series inflation data (Yt ) and other external economic variables—X1t , X2t , X3t , X4t , X5t to evaluate the proposed DDWFC model. 5.1 Simulation Design Simulated inflation rate and external variables are generated using an ARIMA model and each variable has a similar historical pattern as the Canadian inflation dataset. ARIMA model parameters, including AR and MA coefficients and residual variances, is derived from Canadian inflation and other external historical data, ensuring that the simulated series closely mimics the original economic dynamics. The inflation rate(Yt ) was generated with an ARIMA(0,1,0) model, while the X1 and X2 were simulated using ARIMA(2,0,1) and ARIMA(1,1,0) models, respec- 75 tively. The X3 followed an ARIMA(3,1,0) process, the X4 used an ARIMA(5,0,0) model, and the X5 was simulated with an ARIMA(2,0,2) model. The generated data spans 520 monthly observations, covering around 44 years. Our objective is to forecast the inflation rate across various horizons (h = 1, 3, 6, 12 months). To ensure robust forecast accuracy, we employed a rolling window time-series cross-validation technique with a fixed window size of 440 months. The initial training period spans 440 months, and the test period covers 80 months. We implemented the models on the training data and evaluated their performance using RMSE on the test data across various horizons. Table 5.1 shows the number of forecast months generated from the training data. Horizon Initial Window (months) Forecast Window (months) h=1 440 80 h=3 440 78 h=6 440 75 h = 12 440 69 Table 5.1: Initial and Forecast Windows for Different Horizons 5.2 Simulation Results We implemented the automated Algorithm 2 and it identified the best combination for each horizon which can be seen from Table the 5.2. Considering this we combined AR, RF, and XGB to construct the proposed DDWFC model. That is, we can write the DDWFC approach for the simulated data as (DDWFC) ŷt+h (AR) (RF) (XGB) = W1opt ŷt+h + W2opt ŷt+h + W3opt ŷt+h (5.1) 76 Horizon Model Combination RMSE h=1 AR+RF 0.430 h=3 AR+RF 0.710 h=6 AR+XGB 0.928 h = 12 AR+XGB 1.260 Table 5.2: Best Combination derived from the Automated Algorithm We implemented AR, DR, RF, NNAR, XGB, SA, OLS and DDWFC methods on this simulated dataset. Table 5.3 shows the weights derived from OLS method whereas 5.4 eights derived from DDWFC approach. Model Weights h=1 h = 3 h = 6 h = 12 ARIMA β1 0.903 0.600 0.435 0.224 RF β2 0.337 0.482 0.446 1.157 XGB β3 -0.206 0.147 0.499 0.111 1.034 1.230 1.380 1.492 Sum of Weights Table 5.3: Weights derived from OLS Regression Method Table 5.5 presents the RMSE values for all implemented models. While the OLS regression model shows the lowest RMSE values across all horizons, it is not considered the best model due to its limitations. Specifically, it assigns a negative weight for h = 1, and although the weights for h = 3, 6, and 12 are positive, their sum exceeds 1. Following the OLS model, the DDWFC model achieves the 77 Model Optimal Weight h=1 h=3 h=6 h = 12 ARIMA W1 0.9787 0.8320 0.6851 0.3819 RF W2 0.0193 0.1482 0.0260 0.0187 XGB W3 0.0020 0.0198 0.2889 0.5994 1 1 1 1 Sum of Weights Table 5.4: Weights(W) derived from DDWFC Approach next lowest RMSE values. This indicates that our model is robust and capable of delivering superior forecasts across various datasets. Model h = 1 h = 3 h = 6 h = 12 ARIMA 0.432 0.742 1.023 1.605 DR 0.450 0.810 1.140 1.886 NNAR 0.447 0.827 1.199 2.073 RF 1.252 1.258 1.374 1.431 XGB 1.318 1.317 1.334 1.394 SA 0.903 0.959 1.063 1.269 OLS 0.423 0.625 0.725 0.855 DDWFC 0.430 0.710 0.928 1.260 Table 5.5: RMSE values for Implemented models on Simulated Data 78 Figure 5.1: Forecast for horizon h = 1 using the DDWFC model. Figure 5.2: Forecast for horizon h = 3 using the DDWFC model. 79 Figure 5.3: Forecast for horizon h = 6 using the DDWFC model. Figure 5.4: Forecast for horizon h = 12 using the DDWFC model. 80 Figure 5.1 depicts forecasts for horizon h = 1 using the DDWFC model, showing high accuracy that aligns closely with the ARIMA model’s forecast. For horizon h = 3, as shown in Figure 5.2, the DDWFC model maintains better forecasting performance compared to other models, though forecast errors increase relative to h = 1. Figures 5.3 and 5.4 illustrate forecasts for horizons h = 6 and h = 12, respectively. While DDWFC consistently outperforms other models across all horizons, forecast errors tend to grow with longer horizons. Conversely, the RF and XGB models show inferior performance throughout. 81 Chapter 6 Conclusion 6.1 Findings Monetary policy is more effective when it is forward-looking Nyoni (2018). Our findings align with this perspective, demonstrating that the DDWFC method provides a superior forecast over other models. This method has proven robust, even when incorporating the period affected by COVID-19, maintaining consistent performance throughout. The robustness of the DDWFC method underscores its reliability and adaptability in varying economic conditions. DR model outperforms other individual models by providing the lowest RMSE. This advantage is largely attributed to the DR model’s ability to incorporate external economic variables, which significantly enhances its forecasting accuracy. The inclusion of these external variables allows the model to better capture fluctuations and provide more accurate inflation forecasts. Consequently, the DDWFC method assigns greater weight to the DR model in the forecast combination. Both 82 the DR model and the DDWFC approach suggest the benefits of including external variables, highlighting their importance in improving forecast accuracy. By analyzing the extremes of inflation data, we can glean insights into the factors that contribute to both high and low inflation periods. This understanding is crucial for assessing the effectiveness of different policy measures in managing inflation. Such a long-term perspective is vital for developing robust strategies to maintain price stability in the future. Both models suggested adding external variables. Our study also emphasizes the importance of unbiased forecasting. The Wald test results indicate that the forecasts generated by the DDWFC model are unbiased across all horizons, enhancing the reliability of the predictions. Before the COVID-19 period, all models produced comparable forecasts. However, in the post-COVID-19 era, the dynamic regression model, along with the proposed DDWFC model, exhibited superior performance. This distinction underlines the adaptability and robustness of the DDWFC method in capturing and predicting inflation trends amidst unprecedented economic disruptions. These findings offer valuable insights for policymakers. The enhanced prediction reliability and robustness of the DDWFC model empower policymakers to make more informed decisions. Particularly, this model aids in achieving the primary goal of maintaining inflation at the target rate of 2%. The ability to forecast accurately and reliably across different economic scenarios ensures that policymakers can implement timely and effective measures to manage inflation. 83 6.2 Implications for Future Research The findings of this study pave the way for several promising future research directions. One notable avenue is the incorporation of additional external economic variables to further enhance forecast accuracy. Expanding the set of variables could provide a more comprehensive understanding of inflation dynamics and improve model performance. A comparative analysis of the proposed DDWFC model with other forecast combination methods represents another key research direction. Evaluating various combination techniques across different economic contexts will help identify the most effective approaches, refine the DDWFC model, and improve its robustness and accuracy. Moreover, extending the current focus from point forecasting to include volatility forecasting could provide a more nuanced view of inflation dynamics. This extension would offer additional insights into the variability and uncertainty associated with inflation forecasts. In conclusion, the DDWFC method demonstrates robustness and reliability in inflation forecasting, showing superior performance even during periods of economic disruption. By addressing the limitations identified and pursuing the suggested research directions, we can further enhance the model’s effectiveness and contribute to more informed and effective monetary policy decisions. 84 Bibliography Jason Fernando. Inflation: What is it, how it can be controlled, and extreme examples. June 2024. URL https://www.investopedia.com/terms/ i/inflation.asp. BoC. Understanding the consumer price index, May 2021a. URL https://www.bankofcanada.ca/2021/05/understandingconsumer-price-index/. Statistics Canada. Consumer price index: Frequently asked questions. Statistics Canada, 2024. URL https://www.statcan.gc.ca/en/subjectsstart/prices_and_price_indexes/consumer_price_ indexes/faq. The Globe and Mail. Inflation in canada. November 2023. URL https://www.theglobeandmail.com/topics/inflation/#: ˜:text=What%20is%20the%20inflation%20rate,highest% 20in%20nearly%20four%20decades. Yu Chen and Trevor Tombe. The rise (and fall?) of inflation in canada: A detailed analysis of its post-pandemic experience. Canadian Public Policy, 49 (2):197–217, 2023. URL https://www.utpjournals.press/doi/ full/10.3138/cpp.2022-068. 85 Oleksiy Kryvtsov, Jim MacGee, and Luis Uzeda. The 2021–22 surge in inflation. Technical report, Bank of Canada, January 2023. URL chromeextension://efaidnbmnnnibpcajpcglclefindmkaj/https: //www.bankofcanada.ca/wp-content/uploads/2023/01/ sdp2023-3.pdf. BoC. A snapshot of how inflation is affecting canadians, February 2023a. URL https://www.statcan.gc.ca/o1/en/plus/3096- snapshot-how-inflation-affecting-canadians. BoC. Monetary policy report- october 2023, 2023b. URL https://www. bankofcanada.ca/2023/10/mpr-2023-10-25/. BoC. Joint statement of the government of canada and the bank of canada on the renewal of the monetary policy framework, December 2021b. URL https://www.bankofcanada.ca/2021/12/joint-statementof-the-government-of-canada-and-the-bank-of-canadaon-the-renewal-of-the-monetary-policy-framework/. Mehmet Pasaogullari and Brent Meyer. tion: what works best? Simple ways to forecast infla- Economic Commentary, (2010-17), 2010. URL https://www.clevelandfed.org/publications/economiccommentary/2010/ec-201017-simple-ways-to-forecastinflation-what-works-best. Adolfo Rodrı́guez-Vargas. learning methods. Forecasting costa rican inflation with machine Latin American Journal of Central Banking, 1(1-4): 100012, 2020. URL https://www.sciencedirect.com/science/ article/pii/S2666143820300120. 86 Rob J Hyndman and George Athanasopoulos. Forecasting: principles and practice. OTexts, 2018. URL https://otexts.com/fpp3/. Robert R Andrawis, Amir F Atiya, and Hisham El-Shishiny. Combina- tion of long term and short term forecasts, with application to tourism demand forecasting. 886, 2011. International Journal of Forecasting, 27(3):870– URL https://www.sciencedirect.com/science/ article/abs/pii/S0169207010001147?via%3Dihub. Aidan Meyler, Geoff Kenny, and Terry Quinn. Forecasting irish inflation using arima models. 1998. URL https://mpra.ub.uni-muenchen.de/ 11359/. Thabani Nyoni. Modeling and forecasting inflation in kenya: Recent in- sights from arima and garch analysis. 2018. Dimorian Review, 5(6):16–40, URL https://scholar.google.ca/scholar?hl=en&as_ sdt=0%2C5&q=Thabani+Nyoni.+Modeling+and+forecasting+ inflation+in+kenya%3A+Recent+insights+from+arima+ and+garch+analysis.+Dimorian+Review%2C+5%286%29% 3A16%E2%80%9340%2C+2018.+URL&btnG=. Abraham Deka and Nil Gunsel Resatoglu. forecasting foreign exchange rate and consumer price index with arima model: The case of turkey. International Journal of Scientific Research and Management, 7(8):1254–1275, 2019. Fatlinda Shaqiri, Ralf Korn, and Hong-Phuc Truong. Dynamic regression prediction models for customer specific electricity consumption. Electricity, 4 (2):185–215, 2023. doi: 10.3390/electricity4020012. URL https://doi. org/10.3390/electricity4020012. 87 Manuel Tilgner. Time series forecasting with random forest, 2019. URL https://www.r-bloggers.com/2019/09/time-seriesforecasting-with-random-forest/. Posted on September 25, 2019 by Manuel Tilgner in R bloggers — 0 Comments. Joshua Gordon. Practical guide for feature engineering of time series data, June 2023. URL https://dotdata.com/blog/practical-guidefor-feature-engineering-of-time-series-data/. Technical Posts. Vesna Karadzic and Bojan Pejovic. Inflation forecasting in the western balkans and eu: a comparison of holt-winters, arima and nnar models. Amfiteatru Econ, 23:517–532, 2021. URL https://www.ceeol.com/search/ article-detail?id=945646. İbrahim Demir and Murat Kirisci. Forecasting covid-19 disease cases using the sarima-nnar hybrid model. Universal Journal of Mathematics and Applications, 5(1):15–23, 2022. URL https://dergipark.org.tr/en/pub/ ujma/issue/68797/1010490. Abdullah M Almarashi, Muhammad Daniyal, and Farrukh Jamal. Mod- elling the gdp of ksa using linear and non-linear nnar and hybrid stochastic time series models. Plos one, 19(2):e0297180, 2024. URL https://journals.plos.org/plosone/article?id=10. 1371/journal.pone.0297180. Marcelo C Medeiros, Gabriel FR Vasconcelos, Álvaro Veiga, and Eduardo Zilberman. Forecasting inflation in a data-rich environment: the benefits of machine learning methods. Journal of Business & Economic Statistics, 39(1):98– 88 119, 2021. URL https://www.tandfonline.com/doi/full/10. 1080/07350015.2019.1637745. Jaehyun Yoon. Forecasting of real gdp growth using machine learning models: Gradient boosting and random forest approach. Computational Economics, 57 (1):247–265, 2021. URL https://link.springer.com/article/ 10.1007/s10614-020-10054-w. Bhanu Pratap and Shovon Sengupta. Macroeconomic forecasting in india: Does machine learning hold the key to better forecasts? Pratap, B., & Sengupta, S.(2019). Macroeconomic Forecasting in India: Does Machine Learning Hold the Key to Better Forecasts, 2019. URL https://papers.ssrn.com/ sol3/papers.cfm?abstract_id=3852945. Yu-Shan Li, Ping-Feng Pai, and Ying-Lei Lin. Forecasting inflation rates be extreme gradient boosting with the genetic algorithm. Jour- nal of Ambient Intelligence and Humanized Computing, 14(3):2211–2220, 2023. URL https://link.springer.com/article/10.1007/ s12652-022-04479-4. Gustavo Silva Araujo and Wagner Piazza Gaglianone. ing methods for inflation forecasting in brazil: classical models. Machine learn- New contenders versus Latin American Journal of Central Banking, 4(2): 100087, 2023. URL https://www.sciencedirect.com/science/ article/pii/S2666143823000042?via%3Dihub. Maame Cobbinah and Aliaa Alnaggar. An attention encoder-decoder rnn model with teacher forcing for predicting consumer price index. Journal of Data, Information and Management, 6(1):65–83, 2024. URL https://link. springer.com/article/10.1007/s42488-024-00114-3. 89 James H Stock and Mark W Watson. Combination forecasts of output growth in a seven-country data set. Journal of forecasting, 23(6):405–430, 2004. Hira Jamil. Inflation forecasting using hybrid ARIMA-LSTM model. thesis, Laurentian University of Sudbury, 2022. PhD URL https:// onlinelibrary.wiley.com/doi/10.1002/for.928. Richard Dion. Indicator models of core inflation for canada. Technical report, Bank of Canada, 1999. URL https://www.bankofcanada.ca/1999/ 09/working-paper-1999-13/. Livia Paranhos. Predicting inflation with neural networks. 2021. URL https://scholar.google.ca/scholar?hl=en&as_sdt=0% 2C5&q=Livia+Paranhos.+Predicting+inflation+with+ neural+networks.+2021&btnG=. Michael W McCracken and Serena Ng. Fred-md: A monthly database for macroeconomic research. Journal of Business & Economic Statistics, 34(4):574– 589, 2016. URL https://www.tandfonline.com/doi/full/10. 1080/07350015.2015.1086655. Rama K Malladi. Benchmark analysis of machine learning methods to forecast the us annual inflation rate during a high-decile inflation period. Computational Economics, pages 1–41, 2023. URL https://link.springer.com/ article/10.1007/s10614-023-10436-w. Alexandre Fernandes Theoharidis, Diogo Abry Guillén, and Hedibert Lopes. Deep learning models for inflation forecasting. Applied Stochastic Mod- els in Business and Industry, 39(3):447–470, 2023. URL https:// onlinelibrary.wiley.com/doi/10.1002/asmb.2757. 90 Saeed Moshiri and Norman Cameron. Neural network versus econometric models in forecasting inflation. Journal of forecasting, 19(3):201–217, 2000. URL https://onlinelibrary.wiley.com/doi/10.1002/(SICI) 1099-131X(200004)19:3%3C201::AID-FOR753%3E3.0.CO;24. Robert H Shumway, David S Stoffer, Robert H Shumway, and David S Stoffer. Arima models. Time series analysis and its applications: with R examples, pages 75–163, 2017. URL https://link.springer.com/chapter/ 10.1007/978-3-319-52452-8_3. George EP Box, Gwilym M Jenkins, Gregory C Reinsel, and Greta M Ljung. Time series analysis: forecasting and control. John Wiley & Sons, 2015. URL https://scholar.google.ca/scholar?hl=en&as_ sdt=0%2C5&q=George+EP+Box%2C+Gwilym+M+Jenkins%2C+ Gregory+C+Reinsel%2C+and+Greta+M+Ljung.+Time+series+ analysis%3A+forecasting+and+control.+John+Wiley+%26+ Sons%2C+2015.&btnG=. Mohaiminul Islam, Guorong Chen, and Shangzhu Jin. An overview of neural network. American Journal of Neural Networks and Applications, 5(1):7– 11, 2019. URL https://www.researchgate.net/publication/ 337137421_An_Overview_of_Neural_Network. Christoph E Weiss, Eran Raviv, and Gernot Roetzer. Forecast combinations in r using the forecastcomb package. R Journal, 10(2), 2018. Dwight B Crane and James R Crotty. A two-stage forecasting model: Exponential smoothing and multiple regression. Management Science, 13(8):B–501, 91 1967. URL https://pubsonline.informs.org/doi/10.1287/ mnsc.13.8.B501. Md Erfanul Hoque, Aerambamoorthy Thavaneswaran, Srimantoorao S Appadoo, Ruppa K Thulasiram, and Behrouz Banitalebi. A novel dynamic demand forecasting model for resilient supply chains using machine learning. In 2021 IEEE 45th Annual Computers, Software, and Applications Conference (COMPSAC), pages 218–227. IEEE, 2021. URL https://ieeexplore.ieee.org/ document/9529809. Subash Pal. Understanding time series cross validation, 2021. URL https://subashpalvel.medium.com/understanding-timeseries-cross-validation-1929c543d339. Accessed: 2024-08-19. Kristie M. Engemann. What is the phillips curve (and why has it flattened)?, January 2020. URL https://www.stlouisfed.org/open-vault/ 2020/january/what-is-phillips-curve-why-flattened. Hany Guirguis, Vaneesha Boney Dutra, and Zoe McGreevy. The impact of global economies on us inflation: A test of the phillips curve. Journal of Economics and Finance, 46(3):575–592, June 2022. URL https://link. springer.com/article/10.1007/s12197-022-09583-x. Serdar Birinci, Fatih Karahan, Yusuf Mercan, and Kurt See. Labor market shocks and monetary policy. FRB St. Louis Working Paper, October 2022. URL chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/ https://www.bankofcanada.ca/wp-content/uploads/2023/ 10/swp2023-52.pdf. Paul Beaudry. No two ways about it: Why the bank is committed to getting back to 2%. Remarks by Paul Beaudry, Deputy Governor, Alberta School of 92 Business, February 16, 2023, Edmonton, Alberta, February 16 2023. Retrieved from https://www.bankofcanada.ca/speech-url. Oren Barkan, Jonathan Benchimol, Itamar Caspi, Eliya Cohen, Allon Hammer, and Noam Koenigstein. Forecasting cpi inflation components with hierarchical recurrent neural networks. International Journal of Forecasting, 39(3):1145– 1162, 2023. URL https://www.sciencedirect.com/science/ article/pii/S0169207022000607?via%3Dihub. Silvia Angelina and Nugi Mohammad Nugraha. Effects of monetary policy on inflation and national economy based on analysis of bank indonesia annual report. Technium Soc. Sci. J., 10:423, 2020. URL https://heinonline. org/HOL/Page?handle=hein.journals/techssj10& div=38&g_sent=1&casa_token=yCPYfabf1XUAAAAA: Eo9ngRQt5YI4WwGfq5EZbDFJfuaZhqLrY8vlBi2bStxFdXcYRPsJKwrkwwWxeeK6Ly6V collection=journals. Blair Fix. Do high interest rates reduce inflation? a test of monetary faith. Economics from the Top Down, pages 1–18, 2023. Mehmet Mucuk, Sümeyra Evren, et al. What drives inflation in high- inflation countries? evidence from haiti, sudan, türkiye and zambia. Politická ekonomie, 71(3):238–266, 2023. URL https://www.ceeol.com/ search/article-detail?id=1212565. Laurence Savoie-Chabot and Mikael Khan. Exchange rate pass-through to consumer prices: Theory and recent evidence. Technical report, Bank of Canada Discussion Paper, October 2015. URL http://dx.doi.org/doi:10. 34989/sdp-2015-9. 93 James M Boughton and William H Branson. Commodity prices as a leading indicator of inflation, 1988. URL https://www.nber.org/papers/ w2750. 94 Appendix A Additional Results A.1 Tools In the case of the inflation data analysis, R programming language has been used. I have employed the R Studio integrated development environment (IDE) to write and execute the code. It also has features that enable the user to code, debug, and visualize the data. Since we are working with time series data we have used the tsibble (Tidy Temporal Data Frame) data structure to handle time-series data. tsibble is a package in R used in the handling and analysis of temporal data. A.2 The Role of MAPE in DDWFC In our study, the initial approach for optimizing the DDWFC was based on minimizing the FESS. Subsequently, we shifted our optimization criterion to MAPE. The lowest possible MAPE is achieved by adjusting the weights assigned to each 95 model to find the optimal forecast. This adjustment highlights the sensitivity of forecast accuracy to the chosen error metric. Our automated algorithm suggested the combination of ARIMA, DYN, NNAR, RF, and XGB. We implemented the DDWFC approach using this combination. Table A.1 presents the MAPE values for all evaluated models. The proposed DDWFC approach proved to be the best as compared to other implemented models in terms of MAPE. DDWFC approach has the lowest MAPE for all horizons except at h = 1. At h = 1 the OLS method provides a superior forecast. As discussed earlier, we are not considering the OLS regression combination method for final selection as it produces negative weights which are hard to interpret. In real-world applications, this approach proves valuable when MAPE is selected as the preferred evaluation criterion for particular datasets. Model h=1 h=3 h=6 h=12 ARIMA 0.281 0.576 1.034 1.240 DYN 0.273 0.465 0.862 1.002 NNAR 0.296 0.493 0.926 1.196 NNARX 0.363 0.753 1.672 2.342 RF 0.314 0.390 0.590 0.701 XGB 0.321 0.444 0.646 0.772 SA 0.276 0.408 0.755 0.930 OLS 0.256 0.397 0.618 0.716 DDWFC 0.264 0.387 0.584 0.703 Table A.1: MAPE values of Implemented Models 96