This project develops machine learning models to predict the Trimmed Mean PCE Inflation Rate using various economic indicators from the Federal Reserve Economic Data (FRED). The analysis covers data from 1995 to 2025 and implements multiple machine learning algorithms to forecast inflation trends.
To build accurate predictive models for inflation rates using historical economic data, enabling better economic forecasting and policy analysis.
The dataset combines 16 economic indicators from FRED with daily frequency from 1995-07-01 to 2025-07-01:
- T10Y3M: 10-Year Treasury Constant Maturity Minus 3-Month Treasury Constant Maturity
- DTB3: 3-Month Treasury Bill Secondary Market Rate
- DGS10: 10-Year Treasury Constant Maturity Rate
- DGS2: 2-Year Treasury Constant Maturity Rate
- DGS3MO: 3-Month Treasury Constant Maturity Rate
- DGS30: 30-Year Treasury Constant Maturity Rate
- DBAA: Moody's Seasoned Baa Corporate Bond Yield
- DAAA: Moody's Seasoned Aaa Corporate Bond Yield
- BAMLH0A0HYM2: ICE BofA US High Yield Index Option-Adjusted Spread
- CCUSMA02RUM618N: USD/RUB Exchange Rate
- CCUSMA02INM618N: USD/INR Exchange Rate
- CCUSMA02GBM618N: USD/GBP Exchange Rate
- CPIAUCSL: Consumer Price Index for All Urban Consumers
- UNRATE: Unemployment Rate
- GDP: Gross Domestic Product
- PCETRIM12M159SFRBDAL: Trimmed Mean PCE Inflation Rate (Target Variable)
- Temporal Alignment: Converted all data to daily frequency using appropriate interpolation methods
- Missing Value Handling: Linear interpolation for continuous data, forward fill for quarterly data
- Data Validation: Comprehensive quality checks ensuring complete date coverage
- Feature Engineering: Correlation analysis and feature selection
- Linear Regression - Baseline model
- Random Forest - Ensemble method with 200 trees
- XGBoost - Gradient boosting with hyperparameter tuning
- Support Vector Machine - RBF kernel with regularization
- Neural Network - Deep learning approach with 2 hidden layers
- R² Score (Coefficient of Determination)
- Root Mean Square Error (RMSE)
- Mean Absolute Error (MAE)
| Model | Train R² | Test R² | Test RMSE | Test MAE |
|---|---|---|---|---|
| Linear Regression | 0.8094 | 0.8168 | 0.3232 | 0.2614 |
| Random Forest | 0.9999 | 0.9999 | 0.0081 | 0.0022 |
| XGBoost | 0.9998 | 0.9996 | 0.0144 | 0.0097 |
| SVM | 0.9881 | 0.9876 | 0.0841 | 0.0667 |
| Neural Network | 0.9941 | 0.9941 | 0.0579 | 0.0440 |
- Random Forest achieved near-perfect prediction accuracy (R² = 0.9999)
- Interest rates show strong negative correlation with inflation
- Exchange rates and CPI demonstrate positive correlation with inflation
- Unemployment rate has the strongest negative correlation (-0.52) with inflation
pip install pandas numpy matplotlib seaborn scikit-learn xgboost tensorflowgit clone https://github.com/yourusername/inflation-rate-prediction.git
cd inflation-rate-prediction- Economic Relationships: Confirmed inverse relationship between interest rates and inflation
- Model Superiority: Tree-based models (Random Forest, XGBoost) outperformed linear models
- Feature Importance: Multiple economic indicators contribute significantly to inflation prediction
- Temporal Patterns: Identified rolling volatility patterns in inflation trends
- Federal Reserve Economic Data (FRED) for providing the economic indicators.
- Scikit-learn, XGBoost, and TensorFlow communities for ML libraries.