Friday, May 31, 2013

Snowfall

Yesterday I had a short post reminding EViews users that their package (versions 7 or 8) will access all of the cores on a multi-core machine. I've been playing around with parallel processing in R on my desktop machine at work over the last few days. It's something I've been meaning to do for a while, and it proved to be well worth the time.

Before I share my results with you, let me make a couple of comments. 

Thursday, May 30, 2013

Multi-Core Processing With EViews

If you're using a "multi-core" computer for your econometrics work, you want to be able to take advantage of those extra cores - at least when it's efficient to do so. Some tasks, such as Monte Carlo or bootstrap simulations, lend themselves well to multi-processing. However, not all tasks will benefit - more on this in another, more detailed post..

EViews 7 and EViews 8 incorporate automatic sensing and use of the number of CPU "cores" your machine has. Unlike some other packages, which shall remain nameless, you don't have to purchase a different version of the package to get this facility.

There's just one caveat: in the "Help" file for EViews 8 you'll find the following statement:
"This is guaranteed to work with Intel processors, and, to our knowledge, should work with other brands of processors as well."
Unless you've tinkered with the global settings for you installation of EViews, you'll be getting the full benefit of your machine's processing power when using this package. However, you can check this as follows:
  1. Start EViews (7 or 8).
  2. Choose the "Options" tab at the top of the main window.
  3. Choose: "General options", "Advanced system options".
  4. Then, in the "Multi-processor/multi-core use" drop-down, make sure that the setting is either "Auto" (the EViews default), or is the number of cores you want to assign.

Any change that you make to this setting will take effect once you re-start EViews.


© 2013, David E. Giles

Monday, May 27, 2013

International Year of Statistics

Yes, 2013 is the International Year of Statistics. The major professional statistics bodies, and statistical agencies around the world are celebrating the role that statistics (the discipline) and statistics (the data) play in our everyday lives. Academic statisticians, and those of us who work in related disciplines are in on the act too.

Statistics 2013 have been working hard, and creatively, to promote the importance of statistics. They've organized all sorts of celebrations, activities, and competitions.

You can check out the Statisics 2013 logos, in all of the accredited languages, on their website, and I like their statcloud:


You can sign up for the Statistics 2013 newsletter, here.



© 2013, David E. Giles

Saturday, May 25, 2013

What's in a Title?

I'm not one of those people who go in for "cute" titles for my research papers. Some people obviously do. However, they probably spend way too much of their valuable time conjuring up snappy titles in the hope that they'll come up with something that will attract people's attention.

Ultimately, it's the content of the paper that's going to matter - at least, I like to think that's true! So, most of my published papers have titles that describe what the research is about - but those titles aren't going to win any awards for creativity. I mean, really, titles such as:


  • A saddlepoint approximation to the distribution function of the Anderson-Darling test statistic.
  • Exact asymptotic goodness-of-fit testing for discrete circular data, with applications.
  • Bias reduction for the maximum likelihood estimator of the parameters in the half-logistic distribution.


  • Do you see what I mean? (Assuming you're still awake, that is.)

    Thursday, May 23, 2013

    Actually Computing the Sample Variance!

    I always enjoy the posts from John Cook on his The Endeavour blog. John's a knowledgable guy and there's a lot on his blog that's of interest to econometricians. Take a look for yourself!

    Back in 2008, John had a post that's relevant to something I've been blogging about recently. It also reminded me of some important issues associated with computation - issues that we used to worry about a great deal in the bad old days of "hand calculations", and computers with short word-lengths and very limited memory

    One thing that needs to be stressed to students is that the algebraic formulae that they learn about are not necessarily expressed in the form that's most appropriate computationally. By "appropriate", I'm referring to both computational accuracy and computational speed. There are actually lots and lots of examples that illustrate the point that I want to make. However, let's just consider the "simple problem" of computing the variance of a sample of data.

    Wednesday, May 22, 2013

    Minimum MSE Estimation of a Regression Model

    Students of econometrics encounter the Gauss-Markhov Theorem (GMT) at a fairly early stage - even if they don't see a formal proof to begin with. This theorem deals with a particular property of the OLS estimator of the coefficient vector, β, in the following linear regression model:


                            y = Xβ + ε  ;  ε ~ [0 , σIn] ,

    where X is (n x k), non-random, and of rank k.

    The GMT states that among all linear estimators of β that are also unbiased estimators, the OLS estimator of β is most efficient. That is, OLS is the BLU estimator for β.

    EViews Tutorials

    If you're a student who is just learning to use the EViews econometrics package, the tutorials that IHS (the supplier of EViews) has made available should be very helpful. You'll find them here.

    There are 13 tutorials at this time, ranging from "EViews basics" to "Forecasting".

    "The tutorials are split into self-contained sessions, although we recommend that new users of EViews work their way through the tutorials one by one.
    Each tutorial is accompanied by data files so that you may follow the tutorials in your own copy of EViews. The data files are available in the Supporting Files side bar of each tutorial. Each tutorial is available in Microsoft Powerpoint® format, along with the data files, bundled together in a Zip file, in the Download Package area of of the side bar of each tutorial. 
    You should note that the tutorials are written based on EViews 8, however the vast majority of material covered in them is applicable to earlier versions of EViews too."
    Certainly, these tutorial won't tell you everything you'll want to know,  but they're a good start.



    © 2013, David E. Giles

    Tuesday, May 21, 2013

    Variance Estimators That Minimize MSE

    In this post I'm going to look at alternative estimators for the variance of a population. The following discussion builds on a recent post, and once again it's really directed at students. Well, for the most part.

    Actually, some of the results relating to populations that are non-Normal probably won't be familiar to a lot of readers. In fact, I can't think of a reference for where these results have been assembled in this way previously. So, I think there's some novelty here. But we'll get to that in due course.

    I can just imagine you smacking your lips in anticipation!

    Sunday, May 19, 2013

    Camp(s) Econometrics

    The New York Camp Econometrics VIII was held in Bolton Landing, NY, last month. I recall Badi Baltagi (one of the Camp Econometrics organisers) telling me about this great annual event a few years ago. The Texas Econometrics 2013 was held in Lost Pines back in February. This was the 18th Camp for the group in Texas.

    I also seem to recall that there used to be another regular Camp Econometrics in Southern California some years ago. If my neurons are still firing in the right order, I believe that Denis Aigner was one of the leaders of that venture. 

    Back to the NY Camp:
    "This event is a gathering of econometricians and empirical economists whose successful goal is to: (1) Bring together a group of econometricians/empirical economists and guests of host universities to discuss issues in econometrics, both applied and theoretical; (2) Present papers for comments by participants; (3) Stimulate student interest in econometrics; (4) Help students develop their technical presentation skills by encouraging the students of host universities to participate in the meetings and present papers."
    Events like the Camp(s) Econometrics, and The Econometric Game, in the Netherlands, really are great ventures!



    © 2013, David E. Giles

    Saturday, May 18, 2013

    Cookbook Econometrics - Reprise

    A few days ago I was looking at my copy of Econometric Foundations, written by Ron Mittelhammer, George Judge, and Doug Miller. It's an excellent book, by the way.

    I noticed, for the first time, that on p.xxviii of the Preface they have the following to say, under the heading of "A Comment":


    I Know What You Did Last Summer!

    O.K., I know that I stole that title! It was absolutely blatant.

    The other day, some colleagues and I were discussing the issue of students (including our own offspring), and their summer jobs - or no jobs, as the case may be. I'm not passing judgement here in what follows, by the way. 

    When I was a student I had to earn enough money over the summer to live off for the rest of the year. That's just the way it was. Period! My parents were great - I could live at home over the summer at no cost to me. But that was it. They lived in a very small rural town in New Zealand, a long way from where I attended university. The upside of this was that, being a rural area (in the mid/late 1960's through to the early 1970's), there were some seriously good work opportunities.

    So, what did I do each summer?

    Friday, May 17, 2013

    What's the Variance of a Sample Variance?

    This post is really pitched at students who are taking a course or two in introductory economic statistics. It relates to a couple of estimators of the variance of a population that we all meet in such courses - plus another one that you might not have met. In addition, I'll be emphasising the fact that some "standard" results depend crucially on certain assumptions. Not surprisingly - but  not always made clear by instructors and text books.

    Sunday, May 12, 2013

    What's Your Favourite Estimator?

    It's interesting to dwell on the popularity of different estimators that econometricians use. Some estimators are "in vogue" for a period, and then give way to others as new developments come along. Different topics have captured the attention of theoreticians and practitioners alike at different times in history.

    Here's a Google Ngram showing the extent to which some familiar estimators for simultaneous equations models have been mentioned in books since 1960:


    Not too surprisingly, good old OLS just goes on and on:


    I was going to include the GMM estimator in these plots, but this acronym has meanings other than the obvious one that comes to mind. So, the results would have been misleading. To be safe, let's use the full phrase Generalized Method of Moments and allow for case sensitivity:


    Interestingly, the phrase appeared in some books before the publication of Hansen's classic 1982 paper.



    © 2013, David E. Giles

    Flowers for Mom - From Quandl

    Today being Mothers' Day in many parts of the world, I thought that flowers would be appropriate. Well, a price index for (Gardens, Plants, and) Flowers. Specifically, a harmonized price index for these goods for 27 European Union countries.

    I retrieved the monthly data for the period January 2006 to March 2013 from Quandl.com - a really nice resource that I posted about recently.  As well as downloading the data in various formats, reading the data from R, etc., you can also embed an interactive chart of the data directly into a document such as this one, and make the data visible to viewers.

    Friday, May 10, 2013

    New Paper Published

    A paper of mine appears in the latest issue of the Chilean Journal of Statistics. The paper is titled, "Exact asymptotic goodness-of-fit testing for discrete circular data with applications.

    I've posted previously about this general topic, here, here and here.



    © 2013, David E. Giles

    Thursday, May 9, 2013

    R is His Friend

    Marcus Beck has a nice (& relatively new) blog called R is My Friend. You can guess that his posts relate to the use of R.

    I particularly liked his piece on the use of the XML package in R to mine data from the internet; and his post on using the integrate function in R, even when the anti derivative has no closed-form solution.

    Grad. student readers will also like his post, How Long is the Average Dissertation.

    My own take on a related question can be found here.


    © 2013, David E. Giles

    Wednesday, May 8, 2013

    Robust Standard Errors for Nonlinear Models

    André Richter wrote to me from Germany, commenting on the reporting of robust standard errors in the context of nonlinear models such as Logit and Probit. He said he 'd been led to believe that this doesn't make much sense. I told him that I agree, and that this is another of my "pet peeves"!

    Yes, I do get grumpy about some of the things I see so-called "applied econometricians" doing all of the time. For instance, see my 
    Gripe of the Day post back in 2011. Sometimes I feel as if I could produce a post with that title almost every day!

    Anyway, let's get back to André's point.


    Tuesday, May 7, 2013

    Turn on the Economy

    "Turn on the economy". That's one of the invitations issued to (web) visitors to the museum of New Zealand's central bank - The Reserve Bank of New Zealand. Accepting this invitation will allow you to see a virtual version of Bill Phillips' famous MONIAC computer at work, and to "play" with the economy yourself.

    Doesn't that appeal to you?

    Bill Phillips - "the Indiana Jones of Economics" - gave us "the Phillips Curve", of course. However, the MONIAC computer was a revolutionary device that Bill used to demonstrate economic stabilization policy.

    If you happen to be visiting New Zealand's capital city - Wellington - you can visit the Bank's (physical) museum, and see the MONIAC "in the flesh".


    © 2013, David E. Giles

    The Indiana Jones of Economics

    All students of economics have heard about The Phillips Curve in one of its forms or another. The Phillips Curve is named after A. W. H. (Bill) Phillips, a remarkable New Zealander who made a number of fundamental contributions. His work, undertaken largely at the London School of Economics, dealt with stabilization policy, and modelling in continuous time, to name just two topics.

    Bill Phillips was quite a character, and his varied life has been amply documented in various places. His entry in Wikipedia is a useful starting point, and the memorial piece written in 1978 by one of my former teachers, Brian Easton, is also a "must read" item.

    Some time ago, I wrote about Bill in a post titled, "A Moniacal Economist", in reference to his famous MONIAC machines. These were hydraulic analogue computers that could be used to demonstrate the workings of the macro-economy.

    In February of this year, the BBC Radio aired a piece about Bill Phillips, titled "The India Jones of Economics". In this 14-minute broadcast, Tim Hartford provides an interesting commentary of Bill's life and contributions to our discipline. You can download the broadcast - it's Episode 4, 6 February 2013 - from here.

    More about Bill Phillips at a later date..............



    © 2013, David E. Giles

    Monday, May 6, 2013

    My Recent Reading

    Here are some of the papers that I have been reading in the past few days:
    • Majid M. Al-Sadoon, 2013. Geometric and long run aspects of Granger causality. Discussion Paper, Barcelona Graduate School of Economics.
    • David Ardia & Lennart Hoogerheide, 2013. GARCH models for daily stock returns: Impact of estimation frequency on value-at-risk and expected shortfall forecasts. Tinbergen Institute Discussion Paper.
    • Otilia Boldia & Alastair R. Hall, 2013. Estimation and inference in unstable nonlinear least squares models. Journal of Econometrics, 172, 158-167. 
    •  Kazuhito Higa, 2013. Estimating upward bias in the Japanese CPI using Engel's law. Working Paper, Hitotsubashi University.
    • Anna Mikusheva, 2013. Survey on statistical inferences in weakly identified instrumental variables models. Applied Econometrics, 29, 117-131. 



    © 2013, David E. Giles

    Econometrics Lectures on YouTube

    I'm always keeping my eyes open for new or different resources that I can integrate into my Economic Statistics and Econometrics courses. For example, as I've mentioned before in previous posts (here and here), I've been really pleased with what I've been able to achieve with Wolfram's cdf files.

    In my undergrad. Statistical Inference course I also refer the students to some of the excellent mini-lectures by Keith Bower. I find his presentations to be clear and (very importantly) accurate.

    If you check out YouTube you'll find a number of video presentations relating to the teaching of econometrics. To be honest, many of them don't particularly impress me. Maybe I'm just hard to please!

    There are some exceptions to this, though, including David Hendry's 20111 lecture on Teaching Undergraduate Economics at Oxford, and the great series of videos of Mark Thoma in action in the classroom



    © 2013, David E Giles

    Burgernomics

    Looking through the papers that are "in press" at Economics Letters today, I came across a paper by Anthony Landry, titled "Borders and Big Macs". (The link is to the working paper version.) Here's the abstract:
    "I provide new estimates of border frictions for 14 countries using local, national, and international Big Mac prices. I find that borders generally introduce only small price wedges, far smaller than those observed across New York City neighboring locations."
    This led me to wonder just how many academic papers have been written using the well-known "Big Mac Index" (BMI) that's published annually by The Economist magazine. I don't know the exact answer, but there are 39 listed on RePEc's IDEAS site.

    That's a lot of burgers!


    © 2013, David E. Giles

    A Visual Proof That OLS is BLU

    Back in the day (as they say), we had monochrome monitors on our P.C.'s. Do you remember the ghastly green or weird amber colours? Then, one bright day everything became multi-coloured! This is not just me reminiscing - this is leading up to an innovative proof of the Gauss-Markhov Theorem. Honestly!

    In a post yesterday, I mentioned Ken White's sense of humour - that's Ken White, "The SHAZAM Man", as my kids used to affectionately call him. On one of his many visits in the late 1980's, Ken offered to give a talk to a group of students about using the SHAZAM econometrics package. (We had no money for software at the time, but thanks to Ken's outstanding generosity we always had the latest version of his package for everyone to use.)

    Sunday, May 5, 2013

    The Frequent Regressor Club

    My friend, Ken White, developed the SHAZAM econometrics package in 1977. Ken's a funny guy - that's to say, he has a great sense of humour.

    On one of his many visits to Christchurch, New Zealand (when I was living there, many years ago) he gave me a wooden die that he'd had an artisan carve at the local Arts Centre in Chistchurch. On each of the six faces he'd had the guy put the name of an econometrics/statistics package - TSP, LIMDEP, GAUSS, RATS, and SHAZAM. Yes, I know that's only 5 names. The thing was, SHAZAM appeared on two of the faces! The idea was to roll the die to decide which package to use in your lab. class. I still have the die - much to the occasional bemusement of students who see it on my desk.

    Saturday, May 4, 2013

    Granger Causality Testing Done Properly

    I enjoy following David Stern's Stochastic Trend blog. David is Research Director at the Crawford School of Public Policy at the Australian National University. He's an energy and environmental economist who does some really interesting work - not my field at all, but I always enjoy reading what he has to say.

    In his latest blog post, David links to a recent paper that he's co-authored with Robert Kaufman, from Boston University. The paper is titled, "Robust Granger Causality Testing of the Effect of Natural and Anthropogenic Radiative Forcings on Global Temperature". 

    As I said, this isn't my field. However, if you want to see an example of Granger causality testing done well, you should take a look at this well-written paper.

    Nice one!


    © 2013, David E. Giles

    Friday, May 3, 2013

    When Will the Adjusted R-Squared Increase?

    The coefficient of determination (R2) and t-statistics have been the subjects of two of my posts in recent days (here and here). There's another related result that a lot of students don't seem to get taught. This one is to do with the behaviour of the "adjusted" R2 when variables are added to or deleted from an OLS regression model.

    We all know, and it's trivial to prove, that the addition of any variable to such a regression model cannot decrease the R2 value. In fact, R2 will increase with such an addition to the model in general. Conversely, deleting any regressor from an OLS regression model cannot increase (and will generally reduce) the value of R2.

    Mark Thoma on "Replication"

    Yesterday, in his Economist's View blog, Mark Thoma discussed the importance of replicating results in empirical economics. He's absolutely right, of course.

    I'll leave you to read what had to say, but I especially liked his closing passage:
    "One place where replication occurs regularly is assignments in graduate classes. I routinely ask students to replicate papers as part of their coursework. Even if they don't find explicit errors (and most of the time they don't), it almost always raises good questions about the research (why this choice, this model, what if you relax this assumption, there's a better way to do this,here's the next question to ask, etc., etc.). So replication does occur routinely in economics, and it is very valuable, but it is not a formal part of the profession the way it should be, and much of the replication is done by people (students) who generally assume that if they can't replicate something, it is probably their error. We have a lot of work to do on the replication front, and I want to encourage efforts like this."
    At least one of my colleagues also assigns replication exercises in this way, and I really should do the same. Fortunately, more journals are either recommending or requiring that data-sets be made available as a condition of publication. The Journal of Applied Econometrics is one such journal, and we've recently been pushing in that direction with the Journal of International Trade & Economic Development.

    This should become part of our culture.


    © 2013, David E. Giles

    When Can Regression Coefficients Change Sign?

    Let's suppose that you've been running regressions happily all morning. It's sunny day, but what could be better than enjoying some honest-to-goodness econometrics? Suddenly, you notice that one of the estimated coefficients in your model has a sign that's the opposite to what you were expecting (from your vast knowledge of the underlying economics). Shock! Horror!

    Well. it's really good that you're on the look-out for that sort of thing. Congratulations! However, something has to be done about this problem.

    Being young, with good eyesight, you also happen to spot something else that's interesting. One of the other estimated coefficients has a very low t-statistic. You have a brilliant idea! If you delete the variable associated with the very small t-value, maybe the "wrong" sign on the first coefficient will be reversed. Is this possible?

    Thursday, May 2, 2013

    All About Spherically Distributed Regression Errors

    This post is based on a handout that I use for one of my courses, and it relates to the usual linear regression model,

                                      y = Xβ + ε

    In our list of standard assumptions about the error term in this linear multiple regression model, we include one that incorporates both homoskedasticity and the absence of autocorrelation. That is, the individual values of the errors are assumed to be generated by a random process whose variance (σ2) is constant, and all possible distinct pairs of these values are uncorrelated. This implies that the full error vector, ε, has a scalar covariance matrix, σ2In

    We refer to this overall situation as one in which the values of the error term follow a “Spherical Distribution”. Let's take a look at the origin of this terminology.

    Good Old R-Squared!

    My students are often horrified when I tell them, truthfully, that one of the last pieces of information that I look at when evaluating the results of an OLS regression, is the coefficient of determination (R2), or its "adjusted" counterpart. Fortunately, it doesn't take long to change their perspective!

    After all, we all know that with time-series data, it's really easy to get a "high" R2 value, because of the trend components in the data. With cross-section data, really low R2 values are really common. For most of us, the signs, magnitudes, and significance of the estimated parameters are of primary interest. Then we worry about testing the assumptions underlying our analysis. R2 is at the bottom of the list of priorities.

    Wednesday, May 1, 2013

    Finite Sample Properties of GMM

    In a comment on a post earlier today,  Stephen Gordon quite rightly questioned the use of GMM estimation with relatively small sample sizes. The GMM estimator is weakly consistent, the "t-test" statistics associated with the estimated parameters are asymptotically standard normal, and the J-test statistic is asymptotically chi-square distributed under the null. But what can be said in finite samples?

    Of course, this question applies to almost all of the estimators that we use in practice - IV, MLE, GMM, etc. Indeed, lots of work has been done to explore the finite-sample properties of such estimators. For instance, consider my own work on bias corrections for MLEs (see here, here, and here). So, I'm more than sympathetic to the general point that Stephen made.

    Estimating an Euler Equation Using GMM

    In one of my grad. econometrics courses we cover Generalized Method of Moments (GMM) estimation. I thought that some readers might be interested in the material that I use for one of the associated lab. classes.

    The lab. exercise involves estimating the Euler equation associated with the "Consumption-Based Asset-Pricing Model" (e.g., Campbell, 1993, 1996.) This is a great example for illustrating GMM estimation, because the Euler equation is a natural "moment equation".

    The basic statement of the problem is given below, taken from the handout that accompanies the lab. class exercises: