Prediction of Peruvian Inflation: Comparing Econometrics and Machine Learning Models with the Inclusion of a Sentiment News Index
This repository contains the code and data for my honor thesis, "Prediction of Peruvian Inflation: Comparing Econometrics and Machine Learning Models with the Inclusion of a Sentiment News Index." The project aims to analyze and predict inflation rates in Peru by leveraging both traditional econometric models (VAR) and modern machine learning techniques (Ridge, Lasso regression and Macroeconomic Random Forest). Additionally, a sentiment news index is incorporated into the models to assess its impact on inflation prediction accuracy.
Inflation Data: Central Reserve Bank of Peru (BCRP)
News Articles: Various Peruvian news websites
The data preprocessing steps include: Cleaning and formatting the inflation data.
I employ several models to predict inflation rates:
VAR (Vector AutoRegression)
Ridge regression
Lasso regression
Macroeconomic Random Forest
For each model, I create two versions: one that includes the sentiment news index and one that does not. This allows me to compare the performance and determine the impact of the sentiment index on inflation prediction.
The results section provides a detailed comparison of the model performances, including accuracy metrics and visualizations of predicted vs. actual inflation rates. I also analyze the significance of the sentiment news index in improving the prediction accuracy.