3
$\begingroup$

What publicly available resources are there, with sample code, that can be used to build my own macroeconomic model? A search on Github shows that some people have posted code, but I think we can do better.

Ultimately, I am looking to use this model to forecast key economic indicators such as components of GDP and the labour market.

I am method agnostic, so would be happy to see VARs, DSGEs and machine learning examples.

$\endgroup$
5
  • $\begingroup$ How far into the project are you? Have you secured any funding? $\endgroup$ May 27 at 7:20
  • 1
    $\begingroup$ For DSGE dynare is pretty used dynare.org . $\endgroup$ May 27 at 9:54
  • $\begingroup$ Applied General Equilirium models are best developed in GAMS. $\endgroup$ May 27 at 9:55
  • $\begingroup$ @JesperHybel - Should it go ahead, there will be funding. I'd not looked at GAMS before. Looks interesting. $\endgroup$
    – Jamzy
    May 28 at 5:26
  • $\begingroup$ OxMetrics for timeseries (financial forecasting), but latest review was in 2005, Structural time series modelling with STAMP 6.02, by Gilles Teyssière. Journal of Applied Econometrics, 20, 2005, pp. 571-577. But used to be the best (better than what you could get in R and Python). Very fast. $\endgroup$ May 28 at 6:06
3
$\begingroup$

You can find excellent examples of codes for DSGE models as well as VAR on QuantEcon.

For example, here is an example of VAR model in Python, and here is an example of some simple DSGE model.

The above are just examples, you can find different models on the site that might suit you better.

In addition, you should note that in every case you will have to do some parametrization yourself. Very rarely you can just completely copy paste something that was done by someone else.

Even if someone else built VAR or DSGE for the specific country you are looking for there might be some special data challenges (e.g. structural breaks and so on) that you will have to deal on case by case basis.

Consequently, you should not expect to find code that you can reuse just as is, but generally QuantEcon has a lot of very good examples upon which you can build your model and which will save you a lot of time.

$\endgroup$
1
  • 1
    $\begingroup$ Thanks. The dream is to have some plug and play model I can adjust, but I understand nothing is that simple. The QuantEcon source is brilliant. $\endgroup$
    – Jamzy
    May 28 at 5:22
3
$\begingroup$

For forecasting with VAR in R there are some good tutorials on econometrics with R. This tutorial from Justin Eloriaga also helped me when we had to make VAR for our quantitative macro assignment. PenState also has good sources for econometrics, here are their sources for VAR.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.