GithubHelp home page GithubHelp logo

dianayjin / us-inflation-hedge-strategies Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 49.73 MB

A comparison of commonly used assets to hedge against US inflation.

License: MIT License

Python 3.99% Jupyter Notebook 88.19% Dockerfile 0.07% TeX 7.75%
hedging-strategy inflation investment-strategies

us-inflation-hedge-strategies's Introduction

US inflation hedges

What domestic assets are most useful to US individual investors to hedge against inflation?

Objective

Our analysis aims to calculate the β coefficient for various asset classes to evaluate their performance as inflation hedges. This involves regression analysis where the asset returns are regressed against inflation rates to understand the extent of their correlation and to quantify the hedging capability of each asset class.

Go to walkthrough for our results. Regression Analysis for Gold Regression Analysis for TIP Regression Analysis for VNQ Regression Analysis for ^GSPC

Setup Instructions

  1. API keys: Most data sources require API keys. Store these keys securely using environment variables. We use the dotenv approach for this. Please go to https://data.nasdaq.com/sign-up and https://data.bls.gov/registrationEngine/ to register for access to both APIs.

    • Rename .env.example to .env.
    • Fill in the required API keys or configurations.
    • The application will load these keys automatically.
  2. Run the application with Docker:

    • Our application is Docker enabled, run the application in the terminal: docker-compose up
    • Copy and paste one of the URLs from the terminal into your web browser.
  3. Environment setup: Alternatively, if you do not wish to use Docker, you can follow the steps below to set up a virtual environment.

    • Create a virtual environment: python -m venv venv_name
    • Activate the virtual environment:
      • On Windows: venv_name\Scripts\activate
      • On Linux/Mac: source venv_name/bin/activate
    • Install required libraries: pip install -r requirements.txt
    • Test the virtual environment: python test_environment.py
  4. View results: Navigate to walkthrough in the main branch of the directory for our results.

Notebooks (working files)

Notebooks allow us to easily run the application in 4 stages:

  1. hsj-data: Retrieves datasets based on user inputs
  2. hsj-features: Merges inflation data with asset data and create separate merged datasets for each asset.
  3. hsj-models: Provides insights into how changes in inflation rates may influence the log returns of our four assets.
  4. hsj-visualize: Visualizes results of the regression conducted on all asset classes.

You can find Jupyter notebooks in notebooks.

Project Organization

├── LICENSE
├── README.md          
├── data
│   ├── external       <- Data from third party sources.
│   ├── interim        <- Intermediate data that has been transformed.
│   ├── processed      <- The final, canonical data sets for modeling.
│   └── raw            <- The original, immutable data dump.
|
├── models             <- Model summaries.
│
├── notebooks          <- Jupyter notebooks (working files).
│
├── reports            <- Generated analysis as LaTeX.
│
├── requirements.txt   <- The requirements file for reproducing the analysis environment.
│
├── src                <- Source code for use in this project.
│   ├── __init__.py    <- Makes src a Python module.
│   │
│   ├── data           <- Scripts to download or generate data.
│   │   └── load_data.py    
│   │   └── make_dataset.py
│   │   └── process_data.py
│   │   └── user_input.py
│   │
│   ├── features       <- Scripts to turn raw data into features for modeling.
│   │   └── build_features.py
│   │
│   ├── models         <- Scripts to run model.
│   │   ├── regression_model.py
│   │   └── run_regression.py
│   │
│   └── visualization  <- Scripts to create exploratory and results oriented visualizations.
│       └── visualize.py
│
└── tox.ini            <- tox file with settings for running tox; see tox.readthedocs.io

Project based on the cookiecutter data science project template. #cookiecutterdatascience

us-inflation-hedge-strategies's People

Contributors

dianayjin avatar haniehjebeli avatar andpozzi avatar wzy908 avatar

Watchers

 avatar

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.