Code Monkey home page Code Monkey logo

macroeconometrics-and-machine-learning's Introduction

Random Forest for Inflation Forecasting

This project has been realized by Victor Francey and Rémi Hurstel for the course Macroeconometrics and Machine Learning of Professor Anna Simoni.

Installation

To install the libraries we use:

pip install -r requirements.txt

We download the macroeconomic data by using the FRED API (pyfredapi).

FRED API Key

Before using pyfredapi you must have an API key to the FRED API web service. You can apply for one for free on the FRED website.

Then create a file named .env and write FRED_API_KEY="your_api_key". Now save your file.

You can now use the notebook named download !

pyfredapi documentation

You can find the documentation of pyfredapi on this link.

Structure

The repository contains:

  • a folder data which contains the inputs we dowload for the model and the meanings of each of the vairables used as imputs
  • a folder figures which contains some figures showing interessant results
  • a Python notebook download.ipynb which download the macroeconomics data from the FRED website using pyfredapi
  • a R Markdown notebook inflation_forecasting.Rmd wich contains our model and the different fit and forecasts with analysis.

If you just want to see our Random Forest model, you don't need to run the download.ipynb notebook. You only need to use the inflation_forecasting.Rmd file.

Macroeconomics data

List of the data we use:

fred code Description
CPIAUCSL Consumer Price Index for All Urban Consumers: All Items in U.S. City Average
UNRATE Unemployment Rate
FEDFUNDS Federal Funds Effective Rate
M1SL M1
MRTSSM44000USS Retail Sales: Retail Trade
UMCSENT University of Michigan: Consumer Sentiment
PCUOMFGOMFG Producer Price Index by Industry: Total Manufacturing Industries
W875RX1 Real personal income excluding current transfer receipts
M2SL M2
DTCTHFNM Total Consumer Loans and Leases Owned and Securitized by Finance Companies, Level
AMBSL St. Louis Adjusted Monetary Base (DISCONTINUED)
BUSLOANS Commercial and Industrial Loans, All Commercial Banks
PCU311311 Producer Price Index by Industry: Food Manufacturing
BOPGSTB Trade Balance: Goods and Services, Balance of Payments Basis
TWEXMMTH Nominal Major Currencies U.S. Dollar Index (Goods Only) (DISCONTINUED)
USASARTMISMEI Sales: Retail Trade: Total Retail Trade: Volume for United States
IR Import Price Index (End Use): All Commodities
IQ Export Price Index (End Use): All Commodities
IMPGS Imports of Goods and Services
NETEXP Net Exports of Goods and Services
OECDCPALTT01GYM Consumer Price Index: All Items: Total
CMRMTSPL Real Manufacturing and Trade Industries Sales
INDPRO Industrial Production: Total Index
PERMIT New Privately-Owned Housing Units Authorized in Permit-Issuing Places: Total Units
GPDIC1 Real Gross Private Domestic Investment
MTSDS133FMS Federal Surplus or Deficit
POILBREUSDM Global price of Brent Crude
GS10 Market Yield on U.S. Treasury Securities at 10-Year Constant Maturity, Quoted on an Investment Basis
NONBORRES Reserves of Depository Institutions, Nonborrowed
CES0600000007 Average Weekly Hours of Production and Nonsupervisory Employees, Goods-Producing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.