Main Page

From ECLR
Revision as of 09:47, 11 April 2013 by Admin (talk | contribs) (Econometric Computing Learning Resource (ECLR))
Jump to: navigation, search

Econometric Computing Learning Resource (ECLR)

This is the home of the ECLR. It is the purpose of this resource to facilitate the application of Econometric techiques. In the main we will use MATLAB as an Econometric software. A similar page for EVIEWS also exists.

This page will not really teach Econometrics, although it will provide sufficient econometric background to facilitate the implementation of the different econometric techniques. Do do any serious econometrics you need to have some basic statistics knowledge. On this page Statistics you can review some of the required statistical background.

Why do you need to learn MATLAB? It is a widely used programming environment for Economists and many academics write and publish code in MATLAB. If you just want to run a simple regression in MATLAB it will (initially) take you longer to get to the results than in other menu driven software packages such as EVIEWS. However, if you want to achieve nonstandard things (and working on a PhD or even a MSc you are bound to want to do non-standard things) the picture is very different. A menu driven software package may do some related things but often not exactly what you want. Even if the software package has a "button" to do what you want to do, it is often badly documented what exactly happens underneath the hood. But most importantly, many nonstandard things just cannot be done in menu driven software. This is were MATLAB (or other software packages like GAUSS or OX) comes to the rescue. At the core it has nothing to do with econometrics. It is a matrix algebra maths programme in which you can do with data (stored in matrices) whatever you want. When we say whatever, then this is to be understood almost literally. And that is the point. There are a number of great advantages once you are familiar with MATLAB:

  1. You can easily repeat the same analysis with another dataset.
  2. For some analysis there are some very repetitive things you got to do. In some cases, writing a program will eliminate the need to do essentially the same thing many times. You instruct the software to do the repetitive work for you.
  3. By writing a MATLAB program (or script) you essentially also create a record of what you do. This is extremely useful when it comes to understanding previous work and to identify mistakes. This is possibly the most important advantage of writing your own programs.

If you did any programming in any other programming language, such as Visual Basic, C, C++, GAUSS, etc. you will recognise a lot of common patterns. Learning how to use MATLAB to do econometrics is 100% a trial and error process and hence this wiki will provide guidance but you will have to practice yourself.

The Essential MATLAB Programming Techniques

In this section we will introduce a number of basic and intermediate programming techniques. Whatever language you program in you will encounter these techniques, although the details will, of course, vary. We recommend that you ensure that you are familiar with these before you progress to Special Econometric Topics .

Basic Programming

Basics and
Matrices
Loading Data and
Date Formats
Program Flow and
Logicals
Functions Saving Data and
Screen Output
Discussion
Example Clip
Discussion
ExampleClip
Discussion Discussion
Example Code
OLSexample.xls
Example Clip
Discussion

After having gone through these basic techniques you may want to test your newly acquired skills with the following examples.

Example 1 Example 2
Example 1 Example2a
Example2b

Intermediate Programming

Statistical
Functions
Arrays and
Structures
Debugging Graphing Data Function Handlers
Anonymous Functions
Discussion Discussion coming soon coming soon Discussion

Advanced Programming

Sorry, but this cannot be taught! It will come with experience. Find someone who has experience in MATLAB programming and let him or her look over your code.

Nonlinear Optimisation

The optimal parameters in a linear econometric model (assuming certain assumptions) can be found analytically. We call them the Ordinary Least Squares (OLS) estimates and they are easily calculated with a certain formula (see the OLSest.m function). When econometric models do not have such an analytical solution, an alternative parameter estimation strategy is required. In essence it is a clever "trial and error" strategy. This is often called nonlinear optimisation.

Nonlinear optimisation is a very important, but also a very tricky area of econometric computing. It certainly helps to understand some of the underlying theory and therefore we have below separate sections on the theory and implementation.

Theory Implementation Constrained
Optimisation
Discussion Discussion Discussion

Special Econometric Topics

Topics in this Section will assume that you have mastered all the techniques covered in the Essential Programming Section

Robust standard
errors
Univariate
Time Series
Unit Root and
Stationarity Testing
Discussion
Example Code
Discussion
FXrateUSEU.xls
USGDP.xls
coming soon
Maximum
Likelihood
Generalized
Methods of Moments
Instrumental
Variables
Discussion
Example Code
coming soon Discussion
Example Code
Monte-Carlo/
Simulation Techniques
Binary Response
Models
Handling High
Frequency Data
Monte-Carlo coming soon coming soon

Authors, Maintenance and Contributions

This wiki was created by Ralf Becker and Arthur Sinko with the financial support of a University of Manchester Investing in Success grant. If you have any suggestions please contact us by email. Contributions to this wiki are encouraged. Please contact us for details.

Other useful MATLAB resources

Freely available toolboxes

The following toolboxes are freely available and contain extremely useful procedures

  • Spatial Econometrics by James P. LeSage [1]. This toolbox contains a wide variety of useful econometrics functions. It also contains an excellent documentation. In addition to quite general econometric functions you will, as the name suggests, find a huge list of functions relevant if you are working with spatial data.
  • Oxford MFE toolbox by Kevin Sheppard [2]. Use the download link in the box on the right that starts with "Owner: Kevin Sheppard". This toolbox contains many useful functions for uni- and multivariate volatility models.

You need to copy these toolboxes into your MATLAB toolbox folder and add the respective path to the MATLAB list of folders it searches for functions. (In the main menu select FILE and then SET PATH where you can add the folders you added.) If you work on a computer for which you have no administrator rights, this strategy may not work. This Example Clip demonstrates what to do in that case. It is just a matter of adding one line into your code! Piece of cake.

Literature and other learning resources

This website does not cover any theoretical ground and is no substitute for any Econometric Textbook. There is a wide range of very good Econometric Textbooks available. If you are concerned about programming in MATLAB than you are likely to appreciate textbooks that use matrix notation. Here are two very good books that fit that bill:

  • Heij C, de Boer P., Franses P.H., Kloek T. and van Dijk H.K (2004) Econometric Methods with Applications in Business and Economics, Oxford University Press, New York.[5]
  • Greene W.H. (2012) Econometric Analysis, Pearson, Harlow.[6]

Help for using WikiMedia