MATLAB/Simulink/C++/Java等编程援助
联系方式:
QQ:806268790
邮箱:806268790@qq.com
QQ 空间:http://806268790.qzone.qq.com
更多学习资料,请加我为 QQ 好友,或者访问我的 QQ 空间
有编程问题的朋友,请直接加我为QQ好友,提供在线答疑
如果我QQ不在线,请将问题发到我的邮箱,及时给你答复
专业提供以下方向的编程援助:
1. MATLAB/Simulink/C++/Java等编程问题;
2. 数字图像处理、信号处理、通信仿真设计;
3. 机器人路径规划、轨迹规划、机器人控制;
4. 各类数值计算、小波分析算法、优化设计;
5. 自动控制、电机控制、智能控制、模糊控制;
6. 粒子群算法、神经网络、遗传算法等智能算法;
7. 其他编程和仿真问题。
郑重声明:本资料整理于网络,仅限交流使用,切勿用做商业用途!
Applied Econometrics using MATLAB
James P. LeSage
Department of Economics
University of Toledo
October, 1999
Preface
This text describes a set of MATLAB functions that implement a host of
econometric estimation methods. Toolboxes are the name given by the
MathWorks to related sets of MATLAB functions aimed at solving a par-
ticular class of problems. Toolboxes of functions useful in signal processing,
optimization, statistics, finance and a host of other areas are available from
the MathWorks as add-ons to the standard MATLAB software distribution.
I use the term Econometrics Toolbox to refer to the collection of function
libraries described in this book.
The intended audience is faculty and students using statistical methods,
whether they are engaged in econometric analysis or more general regression
modeling. The MATLAB functions described in this book have been used
in my own research as well as teaching both undergraduate and graduate
econometrics courses. Researchers currently using Gauss, RATS, TSP, or
SAS/IML for econometric programming might find switching to MATLAB
advantageous. MATLAB software has always had excellent numerical algo-
rithms, and has recently been extended to include: sparse matrix algorithms,
very good graphical capabilities, and a complete set of object oriented and
graphical user-interface programming tools. MATLAB software is available
on a wide variety of computing platforms including mainframe, Intel, Apple,
and Linux or Unix workstations.
When contemplating a change in software, there is always the initial
investment in developing a set of basic routines and functions to support
econometric analysis. It is my hope that the routines in the Econometrics
Toolbox provide a relatively complete set of basic econometric analysis tools.
The toolbox also includes a number of functions to mimic those available
in Gauss, which should make converting existing Gauss functions and ap-
plications easier. For those involved in vector autoregressive modeling, a
complete set of estimation and forecasting routines is available that imple-
ment a wider variety of these estimation methods than RATS software. For
example, Bayesian Markov Chain Monte Carlo (MCMC) estimation of VAR
i
ii
models that robustify against outliers and accommodate heteroscedastic dis-
turbances have been implemented. In addition, the estimation functions for
error correction models (ECM) carry out Johansen’s tests to determine the
number of cointegrating relations, which are automatically incorporated in
the model. In the area of vector autoregressive forecasting, routines are
available for VAR and ECM methods that automatically handle data trans-
formations (e.g. differencing, seasonal differences, growth rates). This allows
users to work with variables in raw levels form. The forecasting functions
carry out needed transformations for estimation and return forecasted values
in level form. Comparison of forecast accuracy from a wide variety of vector
autoregressive, error correction and other methods is quite simple. Users
can avoid the difficult task of unraveling transformed forecasted values from
alternative estimation methods and proceed directly to forecast accuracy
comparisons.
The collection of around 300 functions and demonstration programs are
organized into libraries that are described in each chapter of the book. Many
faculty use MATLAB or Gauss software for research in econometric analysis,
but the functions written to support research are often suitable for only a
single problem. This is because time and energy (both of which are in short
supply) are involved in writing more generally applicable functions. The
functions described in this book are intended to be re-usable in any number
of applications. Some of the functions implement relatively new Markov
Chain Monte Carlo (MCMC) estimation methods, making these accessible
to undergraduate and graduate students with absolutely no programming
involved on the students part. Many of the automated features available in
the vector autoregressive, error correction, and forecasting functions arose
from my own experience in dealing with students using these functions. It
seemed a shame to waste valuable class time on implementation details when
these can be handled by well-written functions that take care of the details.
A consistent design was implemented that provides documentation, ex-
ample programs, and functions to produce printed as well as graphical pre-
sentation of estimation results for all of the econometric functions. This
was accomplished using the “structure variables” introduced in MATLAB
Version 5. Information from econometric estimation is encapsulated into a
single variable that contains “fields” for individual parameters and statistics
related to the econometric results. A thoughtful design by the MathWorks
allows these structure variables to contain scalar, vector, matrix, string,
and even multi-dimensional matrices as fields. This allows the econometric
functions to return a single structure that contains all estimation results.
These structures can be passed to other functions that can intelligently de-
iii
cipher the information and provide a printed or graphical presentation of
the results.
The Econometrics Toolbox should allow faculty to use MATLAB in un-
dergraduate and graduate level econometrics courses with absolutely no pro-
gramming on the part of students or faculty. An added benefit to using
MATLAB and the Econometrics Toolbox is that faculty have the option of
implementing methods that best reflect the material in their courses as well
as their own research interests. It should be easy to implement a host of ideas
and methods by: drawing on existing functions in the toolbox, extending
these functions, or operating on the results from these functions. As there is
an expectation that users are likely to extend the toolbox, examples of how
to accomplish this are provided at the outset in the first chapter. Another
way to extend the toolbox is to download MATLAB functions that are avail-
able on Internet sites. (In fact, some of the routines in the toolbox originally
came from the Internet.) I would urge you to re-write the documentation
for these functions in a format consistent with the other functions in the
toolbox and return the results from the function in a “structure variable”.
A detailed example of how to do this is provided in the first chapter.
In addition to providing a set of econometric estimation routines and doc-
umentation, the book has another goal. Programming approaches as well as
design decisions are discussed in the book. This discussion should make it
easier to use the toolbox functions intelligently, and facilitate creating new
functions that fit into the overall design, and work well with existing toolbox
routines. This text can be read as a manual for simply using the existing
functions in the toolbox, which is how students tend to approach the book.
It can also be seen as providing programming and design approaches that
will help implement extensions for research and teaching of econometrics.
This is how I would think faculty would approach the text. Some faculty
in Ph.D. programs expect their graduate students to engage in econometric
problem solving that requires programming, and certainly this text would
eliminate the burden of spending valuable course time on computer pro-
gramming and implementation details. Students in Ph.D. programs receive
the added benefit that functions implemented for dissertation work can be
easily transported to another institution, since MATLAB is available for
almost any conceivable hardware/operating system environment.
Finally, there are obviously omissions, bugs and perhaps programming
errors in the Econometrics Toolbox. This would likely be the case with any
such endeavor. I would be grateful if users would notify me when they en-
counter problems. It would also be helpful if users who produce generally
useful functions that extend the toolbox would submit them for inclusion.