9 ms·
Federal Reserve Bank of NY converts major economic model to Julia
- chollida1 11y agoCool, despite Julia replacing matlab here, it looks like the biggest loser to Julia's rise might be Octave. Matlab will always have its proponents, that will use it no matter what, but if Julia keeps encroaching on this territory, I'm not sure where that leaves Ocatve. To the model discussed in this paper, check out this series of blog posts for more information: http://libertystreeteconomics.newyorkfed.org/2014/09/forecasting-with-the-frbny-dsge-model.html#.VRnNb1bdIeE http://libertystreeteconomics.newyorkfed.org/2014/09/forecas... Essentially the model is a work in progress that is continually updated each quarter. It attempts to model at a macro economic level, the interactions between Banks, consumers, Companies, Governments and households. Once the model has solved for the general equilibrium of how those 5 agencies interact the model can then be used to "shock" a particular factor, such as interest rates, to determine how this might affect the interaction between these agents. Its a fairly well respected model, and the fact that the US is one of the few countries to release such a large amount of financial data is one reason why the US is still a leader in economic theory.
- wyager 11y ago> Matlab will always have its proponents I honestly can't understand why. I'm currently in a computer vision class that uses Matlab, and it's literally the worst language I've ever used in my life. The design is nonsensical, bordering on malicious I've always thought that the biggest problem with python was that as programs get bigger, you're likely to run into some confusion due to the lack of static typing and substantial use of implicit conversion (e.g. "Truthy" and "falsy" values), but python has nothing at all on Matlab. Just last night, a matrix I constructed using the expression "[x, y, (x+scale), (y+scale)]" inexplicably had dimensions 1x8 instead of the visually obvious 1x4, but only after a few hours of matlab slowly evaluating this expression thousands of times without any trouble. I suspect this has something to do with matlab's horrible ambiguous matrix concatenation syntax.
- krapht 11y agoLibraries. Inertia. The IDE is actually far more polished than Spyder. It makes things easier for non-programmers with many wizards, and excellent help files. The toolboxes are uniformly fairly high quality. I should mention again the help files. Matlab documentation is comprehensive and far better than any of its competitors. There are many research institutions and workplaces where the cost of the tool isn't really thought about at all. In fact, the cost of Matlab and toolbox fees is a small fraction of a senior scientist/engineer's total compensation. The main competitor is Python. However, using a general purpose programming language is often too hard for non-programming oriented scientists. They are not able to compile a Python package on Windows, never mind actually package and distribute their work to colleagues. On Windows, if the package isn't in one of the distributions like Anaconda, it may as well not exist.
- baldfat 11y ago> The main competitor is Python I would say that it really is R. Python while a good choice is a fraction of the size of R and R as a domain specific language excels in its own realm. Using R with RStudio and sticking with Hadley Wickham universe with Functional Programming makes R shine. There is a reason why so many companies invest in R.
- krapht 11y agoI think your perspective is too small. R is a DSL for data and statistics. Matlab is used in academia and industry across all engineering disciplines, where data and statistics is but a small subset of its total capabilities. You will never be able to use R to model a Kalman filter, calculate stresses in a beam, or simulate engine control logic. I refer you to Matlab's toolbox list. http://www.mathworks.com/products/ http://www.mathworks.com/products/
- Hansi 11y agoSorry you are wrong especially about your first example. For the other two yes there aren't built in toolboxes to handle those but it can be done. R has a lot of packages + it's a language so anyone can effectively write anything: https://cran.r-project.org/web/views/ https://cran.r-project.org/web/views/
- jordigh 11y ago> it looks like the biggest loser to Julia's rise might be Octave. It's not a competition. Julia is our friend, not a rival to Octave. We're on good terms with their developers. Occasionally we share ideas and patches back and forth when it makes sense. They've asked me for help with their Octave benchmark and I've gladly provided it. Octave being unnecessary is Octave's ultimate goal. When nobody cares about Matlab, probably nobody will care about Octave either. But as long as people care about Matlab, Octave will be relevant. Or perhaps, in a perfect world, enough people will stop caring about Matlab that Octave can start leading in fixing the biggest stupidities in the programming language (we already do this to some degree, but keep relenting and replicating Matlab's bugs because code depends on those bugs). If Julia is gaining the minds of people in scientific computing, great. It's going to take them away from Matlab and Octave to equal degree. If we can all do our computing unfettered by proprietary licenses, I don't care if it means we end up using Octave or Julia as long as we stop using Matlab. And many of Matlab's alleged proponents keep turning to Octave. Octave still fills a niche that Julia does not: being able to use Matlab code freely.
- placeybordeaux 11y agoIt's good to see people that have a goal beyond wanting their personal project to succeed, but rather to keep the original reason they started the project at the for front. Too often large enterprises and projects forget the reason they were started and simply try to keep themselves relevant.
- jordigh 11y agoWell, Octave wasn't started with the goal to take down Matlab. That became a goal later in the project's lifetime as it became clear that users were demanding it.
- CptMouse 11y agoAs someone forced to do matlab/octacve in college, this is incredibly refreshing to hear. My respect for the octave team just went up considerably.
- 11y ago
- josu 11y agoThis is an anecdote about a big Matlab proponent who switched sides. I learned Matlab from my Econ 101 professor 8 years ago. He was a big Matlab proponent, and he knew all the econ tools inside out. We kept in touch, since he has been one of the best professors I've ever had. So, fast forward to 2 years ago, I sent him an email asking about this [1] Quantitative Economics course by Sargent and Stachurski based on python. He told me that it looked interesting and that he would give it a try and tell me what he thought. This was his first approach to Python. Two months later he sends me an email telling me that he's ditched Matlab for good, he's taken a couple MOOC python courses and that he is having a lot of fun with Python. He also praised the community and all the open source tools. He also told me to get away from the Sargent and Stachurski course, that they add too much complexity to the explanations just for the sake of looking more Nobel-prize-winner like. [1] http://quant-econ.net/ http://quant-econ.net/
- otoburb 11y ago>>He also told me to get away from the Sargent and Stachurski course, that they add too much complexity to the explanations just for the sake of looking more Nobel-prize-winner like. That's really good feedback for anybody thinking of attempting that course. Does your professor recommend an accompanying course to Sargent and Stachurski's quantitative economics course? I haven't seen many other courses that provide code fragments to run, so S&S's course still has a lot going for it in that regard.
- josu 11y agoNope, I'm sorry, he just told me that I should get into Python. He did recommend this edX course, but it's an introduction to Python, nothing to do with economics. [1] https://www.edx.org/course/mitx/mitx-6-00-1x-introduction-computer-1122 https://www.edx.org/course/mitx/mitx-6-00-1x-introduction-co...
- RockyMcNuts 11y agoIMF course looks interesting https://www.edx.org/course/macroeconomic-forecasting-imfx-mfx https://www.edx.org/course/macroeconomic-forecasting-imfx-mf... Sargent course looks pretty intense. IMF course looks maybe more approachable, uses Eviews which is a time-series-oriented statistical modeling package.
- deleted 11y ago[deleted]
- rlander 11y agoEven more interesting is the document on Github with technical details about the port: https://github.com/FRBNY-DSGE/DSGE.jl/blob/master/doc/MatlabToJuliaTransition.md https://github.com/FRBNY-DSGE/DSGE.jl/blob/master/doc/Matlab...
- b_emery 11y agoVery interesting, particularly the Challenges section: "Differences between the behavior of MATLAB and Julia’s core linear algebra libraries led to many roadblocks in the development of DSGE.jl. Julia uses multithreaded BLAS functions for some linear algebra functions. Using a different number of threads can change the results of matrix decomposition when the matrix is singular. This indeterminacy caused significant problems for our testing suite, both in comparing output matrices to MATLAB results and in testing for reproducibility among Julia outputs." Kudos to them for taking this on, I think.
- tiffanyh 11y agoI'm always found Julia performance claims [1] to be misleading in comparison to LuaJit [2]. Because Julia claims to be much faster than LuaJIT, yet continually - people find that LuaJIT (not Julia) is much faster in real world test [3]. Does anyone else have experience in Julia vs LuaJIT? [1] http://julialang.org/#high-performance-jit-compiler http://julialang.org/#high-performance-jit-compiler [2] http://luajit.org/performance_x86.html http://luajit.org/performance_x86.html [3] http://bayesanalytic.com/lua_jit_faster_than_julia_stock_prediction/ http://bayesanalytic.com/lua_jit_faster_than_julia_stock_pre...
- acidflask 11y agoImprovements to our LuaJIT benchmarking are currently being discussed in https://github.com/JuliaLang/julia/issues/14222 https://github.com/JuliaLang/julia/issues/14222. LuaJIT 2.1 is significantly faster than LuaJIT 2.0, but until now I haven't had a convenient way to get an installation of LuaJIT 2.1 on our test machine. LuaSci was easy to install and we would be amenable to switching over to LuaSci instead of vanilla gsl-shell. See https://github.com/JuliaLang/julia/issues/14222#issuecomment-161117689 https://github.com/JuliaLang/julia/issues/14222#issuecomment... for a timing comparison.
- tiffanyh 11y agoThanks for the note. Appreciate the transparency
- baldfat 11y agoI never looked at SciLua till just now. I have always liked Lua and have made several scripts for my desktop and servers. Just never thought of Lua for Data Science. My main issue is I haven't hit a data set to big for R in my own use cases.
- johnmyleswhite 11y agoI think it would be really interesting to understand exactly why Julia underperforms LuaJIT on some benchmarks. I'm pretty skeptical that Julia loses to LuaJIT uniformly; I suspect it depends on the benchmark taking advantage of LuaJIT's superior discovery of run-time type information.
- danso 11y agoFor those of you in this field...how influential is the NYFed trying out (and apparently being satisfied with) Julia to other government agencies, computational economists, and/or academics? Is it "OS X is Unix/BSD-based" influential, or "Whitehouse.gov uses Drupal [1]" influential? [1] http://buytaert.net/whitehouse-gov-using-drupal http://buytaert.net/whitehouse-gov-using-drupal
- bachmeier 11y agoTo be honest, it will have very little influence. Economists don't like to change their tools.
- k2enemy 11y agoEconomists don't like to change their tools, but Julia is getting a lot of attention among grad students that are picking between Julia, Python, and Matlab as a first language.
- grayclhn 11y agoI think you'd be surprised. I put "I ran my simulations in Julia, talk to me about it" on a slide at a talk in the spring and was really surprised by who was already using it.
- Jgrubb 11y agoI'm not sure how the comparison stacks up for you. Drupal nabbing the whitehouse site was pretty huge in enabling it to land a bunch of other government and higher ed sites/mindshare. I'm not sure which end of the order of magnitude scale you place that though.
- Cowen 11y agoAs far as votes of confidence go, Julia landing successfully at any of the 12 Federal Reserve Banks is a strong one. They all do a whole mess of complex modeling. The NY Fed in particular is a "first among equals" in the Federal Reserve system, so it's always good to be there. That said, I have no idea if this will be that influential on economists changing their tools, or the tools that they teach to their students. People tend to stick with tools that they know and like. But it's very possible that this will help Julia in the eyes of people getting into the field choosing their first programming language.
- bachmeier 11y agoThe real news here is not the move to Julia (although that is likely to be the reason for most of the attention). The important thing is the move to open - an open language, movement to Github, nice explanation of the details.
- grayclhn 11y agoNo. A central bank moving at all to Julia is absolutely fucking huge.
- pzone 11y agoAgreed. I worked on the FRBNY research floor, this model has real mindshare with policy makers, porting it is a huge investment in the language. They may be training scads of RAs in writing and using Julia, many of them will go off and do PhDs later.
- grayclhn 11y agoThis also provides a lot of justification/support for those of us who'd much rather teach (say) macroeconometrics in julia instead of matlab.
- bachmeier 11y agoI suppose it depends on whether you think it's important for the popularity of Julia (something I don't care much about, since it's just a programming language) or because you think open science and policymaking is important (which I do). [I see you're from Iowa State. I'm posting this from the house I bought from John Crespi a few months ago.]
- grayclhn 11y agoSmall world, his office is the floor below mine :) I think we probably agree then --- but this announcement isn't exactly a sea change in open science and policymaking. This model (or one very close to it) has been available on various people's webpages for a while [1], the research on estimating and using DGSE models for forecasting and policy-making has been well documented and openly discussed, etc. And the NY Fed has put out a lot of "accessible" information about features of the model and interpretations of its results. [1]: http://sites.sas.upenn.edu/schorf/pages/working-papers http://sites.sas.upenn.edu/schorf/pages/working-papers
- kolbe 11y agoI've never written a line of Julia in my life, and I'm usually somewhat adept at figuring out what is going on when I read the source of unfamiliar languages. But I'm am having one helluva time trying to differentiate comments and code. EDIT: downvotes? wtf?
- burke 11y agoI haven't either, but they just start with a #, right? What's the problem? EDIT: Oh, I see there are multiline comments.
- kolbe 11y agoI see things that look a lot like english sentences that are neither preceded by #, nor surrounded by #= =#. edit: with examples. this code, all the way up to line 48 looks like some comments, but also a bunch of sentences without the comment characters. https://github.com/FRBNY-DSGE/DSGE.jl/blob/master/src/solve/gensys.jl https://github.com/FRBNY-DSGE/DSGE.jl/blob/master/src/solve/...
- CyberDildonics 11y agoI'm not sure how someone can clear up your confusion without a link to the specific things are you seeing.
- 3JPLW 11y agoYou're looking at a markdown-formatted docstring. Note that it's enclosed in """, similar to Python except that it precedes the method definition. Within the markdown formatting, you can use ``` fences to format code examples. GitHub's coloring here doesn't quite make it as obvious as it can be. Here's how it renders at the REPL with the help system: http://imgur.com/rlAnpSK http://imgur.com/rlAnpSK
- kolbe 11y agocool. thank you.
- nextos 11y agoHow's the probabilistic programming use case in Julia now? I don't like Python as a language that much (I prefer Lisps or MLs), but I reckon its libraries are fantastic: PyMC, Theano, NumPy... And loads of general-purpose stuff.
- has2k1 11y agoI like the use of the Greek alphabet in the code base. Examples https://github.com/FRBNY-DSGE/DSGE.jl/blob/master/src/solve/gensys.jl#L92 https://github.com/FRBNY-DSGE/DSGE.jl/blob/master/src/solve/... https://github.com/FRBNY-DSGE/DSGE.jl/blob/master/src/solve/gensys.jl#L170 https://github.com/FRBNY-DSGE/DSGE.jl/blob/master/src/solve/...
- cauthon 11y agoWhoa that's awesome, are there any other languages that allow that?
- bcg1 11y agoJava
- purpleparakeet 11y agoSwift.
- martinflack 11y agoCommon Lisp
- lg 11y agolots: http://rosettacode.org/wiki/Unicode_variable_names http://rosettacode.org/wiki/Unicode_variable_names
- bglazer 11y agoJavascript too. D3 uses it quite extensively. See here: https://github.com/mbostock/d3/blob/master/src/geo/centroid.js https://github.com/mbostock/d3/blob/master/src/geo/centroid....
- bsg75 11y agoDoesn't this make the code more difficult to work with, sine these characters require uncommon sequences of keystrokes? Single character Greek variables don't seem better than single character ASCII for readability.