This project is an end-to-end analysis of macroeconomic indicators using data from the Federal Reserve Economic Data (FRED) API. The goal is to explore how key economic variables interact over time and to extract meaningful insights about economic cycles, monetary policy, and market behavior.
The analysis is conducted in Python using a notebook-based workflow, with a strong focus on clarity, reproducibility, and real-world analytical thinking.
- Retrieve and analyze macroeconomic data directly from the FRED API
- Study relationships between key economic indicators
- Understand the impact of monetary policy on markets
- Identify patterns during recessionary periods
- Build a clean and reproducible data analysis workflow
FRED ECONOMIC PROJECT/
│
├── fred_env/ # Virtual environment (not tracked in Git)
├── fred_econ.ipynb # Main analysis notebook
├── .env # Stores API key (not shared)
|
├── analysis_images/ # Stores all the EDA Visualization Images
| └── cpi_index.png
| └── federal_funds_rate.png
| └── gdp_growth_cycle.png
| └── gdp_growth_rate.png
| └── nominal_vs_real_gdp.png
| └── s&p500_during_recession.png
| └── s&p500_index.png
| └── stock_market_vs_federal_funds.png
| └── unemployment_rate_recession.png
| └── us_gdp.png
| └── us_unemployment_rate.png
| └── yield_curve_speed.png
|
├── .env.example # Template for environment variables
├── .gitignore # Files ignored by Git
├── requirements.txt # Project dependencies
├── README.md # Project documentation
├── LICENSE # License file
All data is sourced from the FRED (Federal Reserve Economic Data) API.
Key indicators analyzed include:
- Consumer Price Index (CPI)
- Federal Funds Rate
- 10Y–2Y Treasury Yield Spread
- S&P 500 Index
- Unemployment Rate
- GDP Growth
git clone https://github.com/WizardNox/FRED-Economic-Data-Analysis.git
cd fred-economic-projectpython -m venv fred_env
source fred_env/bin/activate # Mac/Linux
fred_env\Scripts\activate # Windowspip install -r requirements.txtCreate a .env file in the root directory:
FRED_API_KEY=your_api_key_hereYou can refer to .env.example as a template.
jupyter notebook fred_econ.ipynbThe analysis follows a structured workflow:
- Pulled time-series data directly from the FRED API
- Ensured consistent date ranges across indicators
- Handled missing values
- Aligned datasets for comparative analysis
- Visualized trends over time
- Compared indicators across economic cycles
- Interest rates vs stock market performance
- Yield curve vs recession periods
- Inflation vs unemployment dynamics
- Inflation Trends (CPI) Understanding long-term inflation behavior and spikes
- Monetary Policy (Federal Funds Rate) Studying how interest rates change over time
- Yield Curve Analysis (10Y–2Y Spread) Identifying inversion periods and their implications
- Stock Market vs Interest Rates Examining how equity markets react to rate changes
- Unemployment During Recessions Tracking labor market stress during downturns
- GDP Growth & Economic Cycles Understanding expansion and contraction phases
A correlation matrix was used to understand relationships between variables.
Key observations:
- GDP growth and unemployment move in opposite directions
- Interest rates and stock market often move inversely
- Inflation and interest rates are positively related
- Yield curve behavior reflects expectations about future economic conditions
- The U.S. economy shows strong long-term growth despite short-term shocks
- A major disruption occurs in 2020 with falling GDP and rising unemployment
- The stock market crashes during this period but recovers quickly
- Interest rates are cut to near zero during the crisis to support the economy
- Inflation rises sharply after 2021, leading to aggressive rate hikes
- The yield curve inverts during this period, signaling possible slowdown
- Over time, the economy stabilizes and continues growing
- Python
- Jupyter Notebook
- Pandas
- Numpy
- Matplotlib
- Plotly
- FRED API
- Sensitive information (API keys) is stored in
.envand excluded via.gitignore .env.exampleis provided for easy setuprequirements.txtensures consistent dependency management
-
This project focuses on building a structured approach to economic data analysis — not just plotting indicators, but understanding how they interact and what they imply about the broader economy.
-
The emphasis is on clarity, reproducibility, and developing an analytical mindset that can be applied to real-world financial and economic problems.
This project helped me understand how macroeconomic indicators interact and how economic shocks affect different parts of the economy. It also improved my skills in data analysis, visualization, and working with real-world datasets using Python.
This project is licensed under the terms of the LICENSE file.





