Giter VIP home page Giter VIP logo

aiyagari's Introduction

Bewley-Huggett-Aiyagari model

We compare the elapsed time for solving the standard Aiyagari model by each code written in Matlab, Python (with or without numba), or Julia.

We run the scripts on a machine with Intel Core i7-4790K (4.0Ghz). To measure the time, we use hyperfine.

For Matlab (R2020a),

hyperfine 'matlab -batch "aiyagari"'

For Python (3.7.4 with Numba 0.45.1),

hyperfine 'python aiyagari.py'

For Julia (1.2.0),

hyperfine 'julia aiyagari.jl'

Results

Julia Python Python-Numba Matlab
Time (mean ± σ): 37.274 s ± 0.239 s 24.002 s ± 0.482 s 31.899 s ± 0.260 s
Range (min … max): 36.961 s … 37.758 s 23.551 s … 24.950 s 31.535 s … 32.215 s
Runs 10 10 10

References

https://www.sas.upenn.edu/~jesusfv/Update_March_23_2018.pdf

https://web.stanford.edu/~maliars/Files/CEPR-DP13210.pdf

Acknowledgement

I thank @yirwk and @yukiyao for improving the python code.

aiyagari's People

Contributors

tkksnk 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.