Giter Club home page Giter Club logo

synthrade's Introduction

Synthrade: Synthetic model simulator of World Trade Networ

Authors: Javier Garcia-Algarra (U-TAD, Spain) Mary Luz Mouronte-Lopez (UFV, Spain) Javier Galeano (UPM, Spain)

Description

This repository contains the code of Synthrade simulator and input data.

Prerequisites

R 3.2 or newer Python 3.0 or newer git bash installed

Reproducibility

  • Download or Clone the repository
  • Run scripts from command line with Rscript

Getting original data

[CAUTION: This step takes a long time to run. Original .tsv files are huge and we do not provide it in this repository. We recommend to skip this preprocessing step]

  • Download .tsv files from OEC [https://atlas.media.mit.edu/en/] and store them in raw_data directory
  • Run python scripts CalcTotalYears_sitc.py & CalcTotalYears_hs07.py Results: File TODOSYYYY.csv, where YYYY is the year. TODOSYYYY.csv files may be found at data/raw_data

Creation of bipatrite trade matrices

  • Run script create_raw_trade_matrix.R init_year end_year. Creates files RedAdyComYYYY.txt inside data/ directory. Each file stores the global ammount of trade among exporters (rows) and importers (columns), for one year.
  • Run script filter_matrixes.R init_year end_year. Results: RedAdyComYYYY_FILT.txt files.

Run the synthetic model

  • Run script synthetic_model.R init_year end_year num_experiments . This procedure is CPU intensive, try to run it in batch mode. Results: RedAdyComYYYY_FILT_W_N.txt files, where YYYY is the year and N the number of experiment.

Compute goodness of fit

  • Run script compute_gof_distributions.R init_year end_year. Results are stored in results

Plots

  • Run script paint_lillies_test.R
  • Run script paint_KS_plots.R
  • Run script paint_matrix.R init_year end_year
  • Run script paint_density_plots.R init_year end_year FS
  • Run script compute_strength_degree_slopes.R init_year end_year

synthrade's People

Contributors

jgalgarra avatar ghostdatalearner avatar

Watchers

James Cloos avatar Javier Galeano avatar  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.