Live data from Hacker News

Federal Reserve Bank of NY converts major economic model to Julia

libertystreeteconomics.newyorkfed.org

61–70 of 91 posts

Re: Federal Reserve Bank of NY converts major economic model to Julia

#61
post #13

For 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

To be honest, it will have very little influence. Economists don't like to change their tools.

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

Re: Federal Reserve Bank of NY converts major economic model to Julia

#62

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

No. A central bank moving at all to Julia is absolutely fucking huge.

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

Re: Federal Reserve Bank of NY converts major economic model to Julia

#63
post #42

Earlier quoted context omitted.

The DSGE models are influential up until somebody comes up with a valid alternative, at which point they will be dropped at somewhat over the speed of light :) To be brutally honest, this is not a big achievement. You should be able to rapidly speed up any matlab model by porting it into pretty much any other language due to well known issues with matlab. Being able to run DSGE models more quickly is important to eco…

Is there a reason calibration isn't automatic? Say with some sort of genetic algorithm? Do the simulations take too long?

Calibration here means simulation to find the right parameter values. Genetic algorithm isn't particularly useful here, it's a more general high dimensional optimization problem.

But if you can cut down the simulation time from e.g. a weekend to a few hours, that is huge in terms of allowing you to find a good specification.

Re: Federal Reserve Bank of NY converts major economic model to Julia

#64
post #60
post #53

Earlier quoted context omitted.

I 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/

Sorry 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/

I can write anything to do any computation in any programming language. The whole point is that there are pre-existing, high quality libraries and toolboxes to do these operations. In fact, that is exactly why R is popular - it has excellent libraries for handling data and statistics.

You're right. R does in fact have a library for modeling Kalman filters. My mistake! Let me pick any other example from the Matlab toolbox product list that R doesn't have! Can you model a radar system in R? Can you tune PID systems in R interactively? Don't be a pedant. Since you are familiar with R, you should know R is 95% used by data scientists and others involved in statistical work.

Re: Federal Reserve Bank of NY converts major economic model to Julia

#65
post #53
post #14

Earlier quoted context omitted.

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

I 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/

You can do all of those things in R except maybe Simulink with a GUI (at least not yet, maybe soon?), and you have the choice of working with multiple implementations. https://cran.r-project.org/web/packages/FKF/FKF.pdf https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Kal... http://stackoverflow.com/questions/1738087/what-can-matlab-d... Unless you are doing something very specific and require a specific toolbox only for Matlab, you're better off just using R (or Python).

Re: Federal Reserve Bank of NY converts major economic model to Julia

#66
post #53

Earlier quoted context omitted.

I 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/

You can do all of those things in R except maybe Simulink with a GUI (at least not yet, maybe soon?), and you have the choice of working with multiple implementations. https://cran.r-project.org/web/packages/FKF/FKF.pdf https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Kal... http://stackoverflow.com/questions/1738087/what-can-matlab-d... Unless you are doing something very specific and require a specific tool…

I can't disagree more with a blanket statement like that. I would never recommend Python / R to the physicists and scientists that I work with. They don't know how to program well. The code they put out is usually garbage, hard to read, and fragile. Software development is not something they do. Backing up for them is emailing themselves a .zip file of their work and revision control is saving their DocXs and PPTs with different dates in the filename.

My point is, coding is not something they enjoy, or care about, it's just a means to an end. The environment and tooling around R/Python still cannot compare to Matlab in terms of ease of use, for the things that Mathworks (creators of Matlab) care enough about to write a toolbox or gui wizard for. The value is not in the language, or syntax, but in the libraries and tooling. I don't know a single Matlab user who doesn't make heavy use of the toolboxes Matlab sells.

And this is why I believe Matlab is not going to go away. If being free and flexible was all that mattered, Linux would have arrived on the desktop already.

Re: Federal Reserve Bank of NY converts major economic model to Julia

#67
post #4

Even more interesting is the document on Github with technical details about the port: https://github.com/FRBNY-DSGE/DSGE.jl/blob/master/doc/Matlab...

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

Re: Federal Reserve Bank of NY converts major economic model to Julia

#68
post #20

Cool, 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/f…

> 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,…

As someone forced to do matlab/octacve in college, this is incredibly refreshing to hear. My respect for the octave team just went up considerably.

Re: Federal Reserve Bank of NY converts major economic model to Julia

#69
post #42

Earlier quoted context omitted.

The DSGE models are influential up until somebody comes up with a valid alternative, at which point they will be dropped at somewhat over the speed of light :) To be brutally honest, this is not a big achievement. You should be able to rapidly speed up any matlab model by porting it into pretty much any other language due to well known issues with matlab. Being able to run DSGE models more quickly is important to eco…

Is there a reason calibration isn't automatic? Say with some sort of genetic algorithm? Do the simulations take too long?

This is the critical thing - they're not simulations. They are mathematical models based on a mix of the existing economic macro-economic formula. With upwards of 200 parameters that can be tweaked. There is no particular recipe btw - if you start digging into the configuration files for these 'models', you'll find all sorts of things, with the occasional hilarious comment (my favourite -'this seems to work in Sweden').

Note that at the same time macro economists are talking about the business cycle, and the purported fit of one of these models to it, they are cheerfully ignoring the applicable Nyquist limit for whatever period cycle they believe they've identified.

Again to use Iceland - because it's a diddly little country and very easy to study. They stop the charts in 2005 because after that, there is a complete deviation from the model, which the model needless to say completely failed to predict. However, anyone who spent half an an hour looking at the Icelandic monetary statistics would have been able to identify clear warning signals from 2003 onwards, and some pretty clear analyses were being issued on that within the financial community by 2005.

Rumour has it the only use Wall Street has for DSGE models is to try and predict whatever crazy thing the central banks will do next.

http://www.bloombergview.com/articles/2014-01-21/wall-street...

Re: Federal Reserve Bank of NY converts major economic model to Julia

#70
post #20

Cool, 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/f…

> 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,…

Just thought you might like to hear this---I love octave and use it regularly in my academic work. It is the perfect language for me to rapidly prototype out a calculation.

That said, I think the future lies in porting over octave libraries and plotting capabilities to Julia.

Post reply on HN