Sunday, June 3, 2012

Monte Carlo Experiments With gretl

I keep saying that I must make more use of the gretl econometrics package. It's great software, and it's free! So, shame on me for not putting my effort where my mouth is.

Fortunately, Riccardo (Jack) Lucchetti keeps a bit of an eye on me in this regard!

In response to my recent post, Another Gripe About the Linear Probability Model, Jack sent me an email which included the comment, "...I find gretl quite intuitive to use for Monte Carlo stuff." He also kindly included a script (.inp) file for gretl to illustrate his point in relation to my own EViews code for my post. You'll find Jack's script file on the code for this blog - it's nice and tidy, for sure.

Jack also pointed me to a recent paper by Lee Adkins on using gretl for Monte Carlo simulation work. Lee's paper (Adkins, 2011) appeared in Journal of Applied Econometrics, but I found a downloadable version here. Defiitely worth taking a look at!

I'll finish with another suggestion from Jack:
"PS: by the way: we just released 1.9.9; grab it while it's hot!"


Adkins, L. C., 2011. Using gretl for Monte Carlo experiments. Journal of Applied Econometrics, 26, 880-885.

© 2012, David E. Giles


  1. I understand gretl has many econometrics tools and options, and maybe its point and click interface is intuitive to students (similar perhaps to SPSS). I've seen it in use and it has an attractive interface. Do you think it serves students better to learn a more broadly used language like R (or free SAS On Demand for education) than gretl ? I'm not sure, is gretl primarily only used by students and academics? Is it as widely used in pharmaceutical, actuarial industries or companies like google, netflix and facebook like R (or even SAS)? I used R in my Financial Data Modeling course and most students took to the programming pretty well. We even wrote our own functions for basic portfolio metrics. Just curious about your opinion on choosing software for econometrics education. Thanks.

  2. Matt: When students are first learning econometrics, I prefer to use something like gretl or EViews, simply so that they can concentrate on the Econometrics content, rather than on "fighting with the package". After that I'm all for R.

    There's no doubt that R is gaining a strong foothold in industry. For example, see this:

  3. On behalf of the gretl development team: it is a common misunderstanding that gretl is point-n-click ONLY. Sure, it's got a graphical interface, which is what most beginners like, but it's also fully scriptable. In fact, in my very humble (and very biased) opinion, gretl's scripting language, known as hansl, is much better than R.

  4. Jack: Right on target! Indeed, readers of this blog will have seen a few examples of hansel at work!

    The script that you have provided, in this regard, on occasion, is definitely simpler and more effective than the corresponding EViews code that I've written.

    Readers - take note of Jack's comment, and try out gretl/hansel yourselves!

  5. About using Gretl within an industry.

    We at Orava Funds use Gretl for our monthly IFRS compliant real estate portfolio valuation & ad hoc valuations for estimatng value for property transactioins. We've written a script which provides us with a semi-automated property valuations. If Gretl becomes unsufficient for hardcore statistical analysis, then we always have R & Julti.

    I've given lectures on econometrics for real estate students and we've used Gretl to do the coursework. I've also suggested that the students (both Finnish and international) would start to use Gretl when they get into the work life. Quite often property companies are a bit reluctant to buy expensve econometrics packages, so a free software is something real estate industry has been looking for.