- 1 The Essential MATLAB Programming Techniques
- 2 Nonlinear Optimisation
- 3 Special Econometric Topics
- 4 Other useful MATLAB resources
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 .
| Basics and
| Loading Data and
| Program Flow and
|Functions|| Saving Data and|
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|
| Arrays and
|Debugging||Graphing Data|| Function Handlers|
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.
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 |
Special Econometric Topics
Topics in this Section will assume that you have mastered all the techniques covered in the Essential Programming Section
| Robust standard
| Unit Root and
Methods of Moments
|coming soon|| Discussion
| Binary Response
| Handling High|
|coming soon||coming soon||coming soon|
Other useful MATLAB resources
The MATLAB Software
The software is available on University of Manchester Computer Labs. If you make regular use of MATLAB you should consider purchasing your own software. The Student Version of MATLAB is available, for instance, from Amazon for £66. This is a real bargain, considering that the equivalent non-discounted package would come in at about £4,000.
Freely available toolboxes
The following toolboxes are freely available and contain extremely useful procedures
- Spatial Econometrics by James P. LeSage . 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 . 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
- Kevin Sheppard's MATLAB introduction.
- Martin V., Hurn S. and Harris D. (2012) Econometric Modelling with Time Series: Specification, Estimation and Testing (Themes in Modern Econometrics). This book contains an extensive library of relevant MATLAB codes.
- Higham, D.J. and Higham, N.J. (2005) MATLAB Guide, Society for Industrial and Applied Mathematics 
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: