Coder Social home page Coder Social logo

kimjintae9011 / message_trade Goto Github PK

View Code? Open in Web Editor NEW

This project forked from junukitashepard/message_trade

0.0 1.0 0.0 171.64 MB

Combine a trade/transportation model with MESSAGEix

Python 6.43% R 84.80% Batchfile 0.02% Jupyter Notebook 8.75%

message_trade's Introduction

MESSAGE-TRADE

MESSAGE-TRADE is an extension on the MESSAGEix global energy model. MESSAGE-TRADE allows users to model international trade in fuels bilaterally, instead of as a global pool.

Background

Text is sourced from Shepard, Jun. "Representing Shipping and Transport Networks in Global Energy Models", International Institute for Applied Systems Analysis (2019).

MESSAGEix currently represents the world through 14 regions. Trade is represented through a global pool framework. In this framework, regions with excess energy resources can export to a global pool from which regions that demand that resource can import. Figure 1(a) below illustrates the global pool schema as a map, while Figure 2(a) represents the schema as a flow of energy.

Figure 1(a) Map of Global Pool Schema Figure 1(b) Map of Bilateral Trade Schema
Figure 2(a) Flow of Global Pool Schema
Figure 2(b) Flow of Bilateral Trade Schema

Here, commodities represent the energy resource (e.g. LNG) while the technology represents the movement of the commodity (e.g. LNG exports, LNG imports). The technology is differentiated by commodity but not by location. This is what defines the global pool schema.

Note that while the global pool schema allows us to examine the total exports from/imports to regions, it does not explicitly model the trade flows among them. This explicit bilateral representation is necessary to model trade as a network and to measure security indices like trade portfolio diversity and import dependence.

The bilateral trade representation is illustrated in Figure 1(b) and 2(b).

In order to explicitly delineate bilateral trade flows among regions, we needed to completely reparametrize trade in MESSAGEIX. Note that in the global pool schema, the origin of fuel imports and the destination of fuel exports are not explicit in the commodity or technology. In the bilateral framework we explicitly define the destination of commodity imports (e.g. LNG_weu means LNG imports to Western Europe) and export technologies (e.g. LNG_exp_weu means LNG exports from the given region that are destined for Western Europe). This is illustrated in Figure 2(b).

Directory structure

Imports net calorific data (IEA) (0). Imports bilateral trade data (BACI) and energy balances (IEA) (1-2). Converts weight in BACI data to physical units (TJ) (1). Validates BACI data across IEA. Dashboards can be found in /dashboards/iea_trade_validation.twb (3).

Sets major sea and inland water ports (1-3). creates uniform nodes based on user-defined degrees of separation (2). Runs Floyd-Warshall Algorithm (4-5). Collapses to one shortest route by country pair (7). Aggregates to MESSAGE regions (8).

(Note: not used for analysis) Build matrices of direct and embedded armed conflicts (1) and trade sanctions (2).

For testing only, not used for analysis.

Prepare data (1) and add gravity function variables (2). Run summary statistics (3). Function for gravity-based OLS, used for proceeding scripts (4). LASSO test (4_variable_selection). Compile regression results in Excel workbooks (5). Compile regression results in dataframe, to be used for parameter compilation (6). Add tariff parameters (lo and hi) (7).

All parameters for bilateral schema are compiled in scripts in this directory. User can run run_all.R to compile all parameters. Individual parameterizations can be found in corresponding files.

Contains scenario definitions (scenarios.xlsx), and compilation of GDX files written in Python (compile_scenario.py). User can run compile_scenario.py to compile all scenario GDX files. Initial post-processing (optional) can be done in map_tradeflows.R and region_coordinates.R

Contains all plotting scripts.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

TBD

message_trade's People

Contributors

junukitashepard avatar

Watchers

James Cloos 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.