Tag Archives: community

REVISITED: Julia vs Python Speed Comparison: Bootstrapping the OLS MLE

By: Bradley Setzler

Re-posted from: https://juliaeconomics.com/2014/06/19/revisited-julia-vs-python-speed-comparison-bootstrapping-the-ols-mle/

I originally switched to Julia because Julia was estimating a complicated MLE about 100-times faster than Python. Yesterday, I demonstrated how to bootstrap the OLS MLE in parallel using Julia. I presented the amount of time required on my laptop to bootstrap 1,000 times: about 21.3 seconds on a single processor, 8.7 seconds using four processors.

For comparison, I translated this code into Python, using only NumPy and SciPy for the calculations, and Multiprocessing for the parallelization. The Python script is available here. For this relatively simple script, I find that Python requires 110.9 seconds on a single processor, 66.0 seconds on four processors.

Thus, Julia performed more than 5-times faster than Python on a single processor, and about 7.5-times faster on four processors.

I also considered increasing the number of bootstrap samples from 1,000 to 10,000. Julia requires 211 seconds on a single processor and 90 seconds on four processors. Python requires 1135 seconds on a single processor and 598 seconds on four processors. Thus, even as the size of the task became greater, Julia remained more than 5-times faster on one processor and around 7-times faster on four processors.

In this simple case, Julia is between 5- and 7.5-times faster than Python, depending on configuration.


Bradley J. Setzler

Julia Attracts an International Audience

By: Bradley Setzler

Re-posted from: https://juliaeconomics.com/2014/06/18/julia-attracts-an-international-audience/

I created this site 2 days ago to help economists learn Julia. I am pleasantly surprised that so many share this interest. Below, see the number of views of this site over these 2 days by country. Hopefully, all of this momentum in favor of Julia will speed its accumulation of useful packages and documentation.

Please, do not hesitate to comment or email me with ideas to improve the codes I post or ideas of worthwhile codes to work on next. Thank you for visiting this site.


JuliaEconomics_Stats_1JuliaEconomics_Stats_2

 


Bradley J. Setzler

 

UPDATE: A Comparison of Programming Languages in Economics

By: Bradley Setzler

Re-posted from: https://juliaeconomics.com/2014/06/16/update-a-comparison-of-programming-languages-in-economics/

Here, you can find the latest version of the paper and all of the codes used in A Comparison of Programming Languages in Economics, by S. Boragan Aruoba and Jesús Fernández-Villaverde.

This is the paper that convinced me to give Julia a try.


Bradley J. Setzler