Sunday, April 13, 2014

Open Science Through R

There's so much being written about R these days, and justifiably so. If you use R for your econometrics, you should also keep in mind that its applicability is far wider than statistical analysis. 

A big HT to the folks at Quandl for leading me to a nice overview of the way in which R is enabling some big changes in the way in which scientific research is being conducted more generally. The article in question is by Tina Amirtha, "How the Rise of the "R" Language is Bringing Open Source to Science", which you'll find here.

If you think that R is just about statistics, and you can't see the point of investing some time (not money) in getting on board, then read Tina's piece. 

You'll change your mind if you consider yourself a survivor.



© 2014, David E. Giles

Thursday, April 10, 2014

Proof of a Result About the "Adjusted" Coefficient of Determination

In a post last year I discussed the conditions under which the "adjusted" coefficient of determination (RA2) will increase or decrease, when regressors are deleted from (added to) a regression model. Without going over the full discussion again, here is one of the key results:

Adding a group of regressors to the model will increase (decrease) RA2 depending on whether the F-statistic for testing that their coefficients are all zero is greater (less) than one in value. RA2 is unchanged if that  F-statistic is exactly equal to one.

A few days ago, "Zeba" reminded me that I had promised to post a simple proof of this result, but I still hadn't done so. Shame on me! A proof is given below. As a bonus, I've given the proof for a more general result - we don't have to be imposing "zero" restrictions on some of the coefficients - any exact linear restrictions will suffice.

Let's take a look at the proof.

Friday, April 4, 2014

There's an App for That

I was looking for econometrics-related "apps" for my Android tablet. Very little of interest came up for "Econometrics", but there certainly are some nice data-related apps.

Here are a few examples:



© 2014, David E. Giles

Playing With the FRB/US Model

Via both Mark Thoma and Gareth Thomas, I learned about a new initiative at the Federal Reserve Board. The details are available here.

In summary:
"The FRB/US model of the U.S. economy is one of several that Federal Reserve Board staff consults for forecasting and the analysis of macroeconomic issues, including both monetary and fiscal policy. FRB/US has long been available to members of the public upon request. To reduce the costs of providing updates of the model specification and databases, and to make the public more broadly aware of the model's availability, a new page has been introduced on the Federal Reserve Board's website from which interested users can download expanded FRB/US documentation; model equations, coefficients, and data; and sample simulation programs. These simulation programs can be run by anyone with access to the EViews software package, a widely available commercial product. This note provides a brief summary of the main features of the model, illustrates some applications of the model using sample programs provided on the web page, and concludes with an overview of the contents of the web page. Because the model continues to undergo changes as both economic theory and empirical evidence evolve, any given model release reflects only the state of thinking at the time of the release."
This a fabulous resource, and I'll certainly be making use of it in my teaching!


© 2014, David E. Giles

Thursday, April 3, 2014

New Paper

 Another of my papers on analytic bias-correction has now been published. This one is with a former M.A. student, Xiao Ling.

The details are: Xiao Ling and David E. Giles, "Bias reduction for the maximum likelihood estimator of the parameters of the generalized Rayleigh family of distributions. Communications in Statistics - Theory and Methods, 2014, 43, 1778-1792.

You can see the paper here.


© 2014, David E. Giles

Tuesday, April 1, 2014

April Reading List

Here are some of the paper that I've been reading lately:


© 2014, David E. Giles

Sunday, March 30, 2014

Understanding the Underlying Asumptions

From time to time I've been known to blog about the importance of fully understanding the assumptions that underlie the various estimators and tests that we use in econometrics. (Here, too.) Gee, I've even gone so far as to suggest that students should learn about these assumptions by taking courses where results are proved formally- not introduced simply through arm-waving.

I'm not going to start griping about all of that again here - it's too nice a Spring day for that.

However, I've just been reading a recent piece in Scientific American that's relevant to my main concern when students are taught "how to do" econometrics, but don't have a proper understanding of the underlying assumptions. That concern is simply that, sooner or later, they'll screw up!

Maybe it won't be the end of the world. The economy probably won't collapse in a big messy heap. Perhaps they'll just lose their job!

The S.A. article was about just this sort of thing - but in the case of neuroscientists, not economists. For the sake of full disclosure I have nothing at all against neuroscientists. In fact, I have a daughter who is doing post-grad. work in just that field at the Florey Institute in Australia.

You can read the article for yourself, and I hope that you will. In a nutshell, there have been numerous influential neuroscience studies, that have appeared in the very top scientific journals, and which have been based on fundamentally flawed statistical analysis. 

To put it really simply, the authors have used statistical tests whose validity require that the data have been sampled independently, when in fact this requirement is undeniably violated in these studies.

Oh dear!

To quote Gary Stix, the author of the article:
'Emery N. Brown, a professor of computational neuroscience in the department of brain and cognitive sciences at the MIT-Harvard Division of Health Sciences and Technology, points to a dire need to bolster the level of statistical sophistication brought to bear in neuroscience studies. “There’s a fundamental flaw in the system and the fundamental flaw is basically that neuroscientists don’t know enough statistics to do the right things and there’s not enough statisticians working in neuroscience to help that." ' 
I'd venture to guess that "screwing up" in the neurosciences might have some unpleasant consequences.

Needless to say, I've sent the link to the S.A. article to my daughter!

You might want to think about this the next time you fire up your favourite econometrics package: Did your friendly econometrics instructor make sure that you really understand the assumptions that need to be satisfied before you can rely on the estimators and tests you're about to use?



© 2014, David E. Giles

Wednesday, March 26, 2014

MCMC for Econometrics Students - IV

This is the fourth in a sequence of posts designed to introduce econometrics students to the use of Markov Chain Monte Carlo (MCMC, or MC2) simulation methods for Bayesian inference. The first three posts can be found here, here, and here, and I'll assume that you've read them already. The emphasis throughout is on the use of the Gibbs sampler.

The first three posts took a look "inside the box", to see that the Gibbs sampler entails. I looked at some R code that could be used to show the sampler "in action". One way to think about those posts is that they were analogous to an explanation of OLS regression, with code that assembled the X matrix, the (X'X) matrix, showed you how to invert the latter matrix, and so on. It's important to understand what is going on when you select "OLS" in your favourite package, but you certainly wouldn't dream of constructing the estimator from first principles every time you wanted to use it.

It's the same in the case of our Bayesian analysis. So, the purpose of this post is to show you simple it is, in practice, to use R to estimate regression models using Bayesian methods, and to implement Bayesian Posterior Odds analysis for model selection. We can just take advantage of the R packages that have been developed already to help us.

Tuesday, March 25, 2014

Congratulations to My Colleague!

This afternoon I had the pleasure of attending the annual Teaching, Research, and Service Awards ceremony for our Faculty of Social Sciences here at the University of Victoria. Our Dean, Peter Keller, does a great job with this event. I was especially grateful for the food, as I'd missed out on lunch today!

However, the real highlight was the presentation of the Research Award to my colleague, Kees van Kooten. Kees is an outstanding researcher who holds a (Tier 1) Canada Research Chair in our department, and the award was both richly deserved and long overdue.

Congratulations, Kees!



© 2014, David E. Giles

Monday, March 24, 2014

Thumbs Up; Thumbs Down

People say and do the darnedest things! 

I'll let you assign your own "thumbs up" and "thumbs down" to the following gems. I imagine you can guess where I stand on each of them!

'But which is a bigger menace to society, laziness about data or laziness about theory? Theory-laziness is seductive because it's easy - mining for correlations isn't very mentally taxing. But data-laziness is seductive because it's hard - the more complicated and intricate a theory you make, the smarter it makes you feel, even if the theory sucks. 
 In the past, data-laziness was probably more of a threat to humanity. Since systematic data was scarce, people had a tendency to sit around and daydream about how stuff might work. But now that Big Data is getting bigger and computing power is cheap, theory-laziness seems to be becoming more of a menace. The lure of Big Data is that we can get all our ideas from mining for patterns, but A) we get a lot of false patterns that way, and B) the patterns insidiously and subtly suggest interpretations for themselves, and those interpretations are often wrong.'
(Noah Smith in his post, Which is Better, Data or Theory?)

'........ which raises the question "who should be teaching students econometrics?" Should it be someone like ****, who is basically an applied micro guy, or should it be an econometric theorist?' 
(Frances Woolley, commenting on her own post)

'Developing statistical methods is hard and often frustrating work. One of the under appreciated rules in statistical methods development is what I call the 80/20 rule (maybe could even by the 90/10 rule). The basic idea is that the first reasonable thing you can do to a set of data often is 80% of the way to the optimal solution. Everything after that is working on getting the last 20%.'
(Jeff Leek, on the Simply Statistics blog)

'The micro stuff that people like myself and most of us do has contributed tremendously and continues to contribute. Our thoughts have had enormous influence. It just happens that macroeconomics, firstly, has been done terribly and, secondly, in terms of academic macroeconomics, these guys are absolutely useless, most of them. Ask your brother-in-law. I’m sure he thinks, as do 90% of us, that most of what the macro guys do in academia is just worthless rubbish. Worthless, useless, uninteresting rubbish, catering to a very few people in their own little cliques.'
(Chris Auld, reputedly quoting someone else, in a blog post from 2011)

'The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.'
(John Tukey)
'So, we produce our papers, as if on a relentless production line. We cannot wait for inspiration; we must maintain our output. To do our jobs successfully, we need to acquire a fundamental academic skill that the scholars of old generally did not possess; modern academics must be able to keep writing and publishing even when they have nothing to say. ....'
(Michael Billig, as quoted by Timothy Taylor)

So, thumbs up, and thumbs down. Or, from the sublime to the ridiculous - take your pick.
Boy - it was hard to resist giving my reaction  to some of these!
© 2014, David E. Giles