Code Monkey home page Code Monkey logo

open-climate-investing's Introduction

open-climate-investing

This project's mission is to make climate investing actionable. It includes both open source software and a free book to help you identify relative value trades, optimize portfolios, and structure benchmarks for climate aligned investing.

The Software

The software is a multi-factor equity returns model which adds a climate factor, or Brown Minus Green, to the popular Fama French and Carhart models. See the short video

This additional Brown Minus Green (BMG) return factor could be used for a variety of climate investing applications, including:

  • Calculate the market-implied carbon risk of a stock, investment portfolio, mutual fund, or bond based on historical returns
  • Determine the market reaction to the climate policies of a company
  • Optimize a portfolio to minimize carbon risk subject to other parameters, such as index tracking or growth-value-sector investment strategies.

Setting It Up

Install the required python modules (use pip3 instead of pip according to your python installation):

pip install -r requirements.txt

Initialize the Database using:

python3 scripts/setup_db.py -R -d

Trying It Out

Let's get the historical stock prices and returns of the MSCI World Index and its constituent sectors:

python scripts/get_stocks.py -f data/msci_etf_sector_mapping.csv 
python scripts/get_stocks.py -f data/msci_constituent_details.csv

Now let's calculate the risk factor loadings for these stocks using 60 months of monthly data at a time:

python scripts/get_regressions.py -d -f data/msci_etf_sector_mapping.csv -s 2010-01-01 -e 2021-01-31 --frequency MONTHLY -n DEFAULT -i 60 -b
python scripts/get_regressions.py -d -f data/msci_constituent_details.csv -s 2010-01-01 -e 2021-01-31 --frequency MONTHLY -n DEFAULT -i 60 -b

Next, let's create a daily version of the BMG climate risk series based on the difference between the stocks XOP (brown) and SMOG (green):

python scripts/bmg_series.py -n XOP-SMOG -b XOP -g SMOG -s 2018-01-01 -e 2022-02-01 --frequency DAILY

Finally, let's calculate the risk factor loadings for stocks using 2 years of daily data. This will take a long time:

python3 scripts/get_regressions.py -d -f data/msci_etf_sector_mapping.csv -s 2018-01-01 -e 2021-01-31 --frequency DAILY -i 730 -n XOP-SMOG -b
python3 scripts/get_regressions.py -d -f data/msci_constituent_details.csv -s 2018-01-01 -e 2021-01-31 --frequency DAILY -i 703 -n XOP-SMOG -b

Viewing the Results

Follow directions from the dashboard README page to look at your results.

The Book

The included free book on climate investing explains both climate investing concepts and how to use this project. You can also read it online at gitbook.

Project Files

  • scripts/ contains the python scripts used to run the models.
  • ui/ contains the dashboard.
  • data/ contains the data files for the models and a list of their sources.
  • R/ contains R scripts which were used to develop the models.
  • book/ is the included book on climate investing.

References

Get Updates

Sign up for our email newsletter to get updates on this book and the Open Climate Investing project.

Disclaimer

This content is published for informational purposes only and not investment advice or inducement or advertising to purchase or sell any security. See full disclaimer and license.

open-climate-investing's People

Contributors

jwickers avatar mattbowler avatar sichen1234 avatar igna43 avatar rybalko avatar hai-yr 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.