Matlab Symbolic Mathematics
'If you are using the Student Version of MATLAB, then you have access to the optional Symbolic Math Toolbox. If you are using a professional (non-student) version, then you must purchase this toolbox separately. If you do not know whether your version of MATLAB is equipped with the toolbox or not, try a few of the following exercises. If they work, you抳e got it. If not, you will have to skip over any exercise that asks you to perform computations with variables that have not been assigned numeric values and should be treated as symbols. '
See the above link for details.
---Joy, Passion, Pride and Love
---Stand on the Giants
---Make the World Beautiful
Yundong Tu's Webpage
Monday, July 20, 2009
Thursday, July 9, 2009
The ET Interview: Professor Jan Kmenta
The ET Interview: Professor Jan Kmenta
John Lodewijks and Jan Kmenta
Econometric Theory, Vol. 21, No. 3 (Jun., 2005), pp. 621-645
Published by: Cambridge University Press
Access article from an external site
John Lodewijks and Jan Kmenta
Econometric Theory, Vol. 21, No. 3 (Jun., 2005), pp. 621-645
Published by: Cambridge University Press
Access article from an external site
Teaching Modeling and Simulation in Economics: A Pleasant Surprise
Teaching Modeling and Simulation in Economics: A Pleasant Surprise
Eshragh Motahar
The Journal of Economic Education, Vol. 25, No. 4 (Autumn, 1994), pp. 335-342
Eshragh Motahar
The Journal of Economic Education, Vol. 25, No. 4 (Autumn, 1994), pp. 335-342
Statistics on Statistics: Measuring Research Productivity by Journal Publications between 1985 and 1995
Statistics on Statistics: Measuring Research Productivity by Journal Publications between 1985 and 1995
Christian Genest
The Canadian Journal of Statistics / La Revue Canadienne de Statistique, Vol. 25, No. 4 (Dec., 1997), pp. 427-443
Christian Genest
The Canadian Journal of Statistics / La Revue Canadienne de Statistique, Vol. 25, No. 4 (Dec., 1997), pp. 427-443
A History of the Statistical Society of Canada: The Formative Years
A History of the Statistical Society of Canada: The Formative Years
David R. Bellhouse, Christian Genest
Statistical Science, Vol. 14, No. 1 (Feb., 1999), pp. 80-115
David R. Bellhouse, Christian Genest
Statistical Science, Vol. 14, No. 1 (Feb., 1999), pp. 80-115
The ET Dialogue: A Conversation on Econometric Methodology
The ET Dialogue: A Conversation on Econometric Methodology
David F. Hendry, Edward E. Leamer, Dale J. Poirier
Econometric Theory, Vol. 6, No. 2 (Jun., 1990), pp. 171-261
David F. Hendry, Edward E. Leamer, Dale J. Poirier
Econometric Theory, Vol. 6, No. 2 (Jun., 1990), pp. 171-261
Wednesday, July 8, 2009
Instrumental variable
Instrumental Variable Estimation of the Simple Errors-in-Variables Model
R. L. Carter, Wayne A. Fuller
Journal of the American Statistical Association, Vol. 75, No. 371 (Sep., 1980), pp. 687-692
Instrumental-Variable Estimation of an Error-Components Model
Takeshi Amemiya, Thomas E. MaCurdy
Econometrica, Vol. 54, No. 4 (Jul., 1986), pp. 869-880
Instrumental Variable Estimation in Generalized Linear Measurement Error Models
Jeffrey S. Buzas, Leonard A. Stefanski
Journal of the American Statistical Association, Vol. 91, No. 435 (Sep., 1996), pp. 999-1006
Finite Sample Properties of Instrumental Variable Estimators of Structural Coefficients
Roberto S. Mariano
Econometrica, Vol. 45, No. 2 (Mar., 1977), pp. 487-496
Does More Crime Mean More Prisoners? An Instrumental Variables Approach
Yair Listokin
Journal of Law and Economics, Vol. 46, No. 1 (Apr., 2003), pp. 181-206
Testing Identifiability and Specification in Instrumental Variable Models
John G. Cragg, Stephen G. Donald
Econometric Theory, Vol. 9, No. 2 (Jun., 1993), pp. 222-240
Consistent Estimation with a Large Number of Weak Instruments
John C. Chao, Norman R. Swanson
Econometrica, Vol. 73, No. 5 (Sep., 2005), pp. 1673-1692
Structural Equations, Treatment Effects, and Econometric Policy Evaluation Structural Equations, Treatment Effects, and Econometric Policy Evaluation
James J. Heckman, Edward Vytlacil
Econometrica, Vol. 73, No. 3 (May, 2005), pp. 669-738
R. L. Carter, Wayne A. Fuller
Journal of the American Statistical Association, Vol. 75, No. 371 (Sep., 1980), pp. 687-692
Instrumental-Variable Estimation of an Error-Components Model
Takeshi Amemiya, Thomas E. MaCurdy
Econometrica, Vol. 54, No. 4 (Jul., 1986), pp. 869-880
Instrumental Variable Estimation in Generalized Linear Measurement Error Models
Jeffrey S. Buzas, Leonard A. Stefanski
Journal of the American Statistical Association, Vol. 91, No. 435 (Sep., 1996), pp. 999-1006
Finite Sample Properties of Instrumental Variable Estimators of Structural Coefficients
Roberto S. Mariano
Econometrica, Vol. 45, No. 2 (Mar., 1977), pp. 487-496
Does More Crime Mean More Prisoners? An Instrumental Variables Approach
Yair Listokin
Journal of Law and Economics, Vol. 46, No. 1 (Apr., 2003), pp. 181-206
Testing Identifiability and Specification in Instrumental Variable Models
John G. Cragg, Stephen G. Donald
Econometric Theory, Vol. 9, No. 2 (Jun., 1993), pp. 222-240
Consistent Estimation with a Large Number of Weak Instruments
John C. Chao, Norman R. Swanson
Econometrica, Vol. 73, No. 5 (Sep., 2005), pp. 1673-1692
Structural Equations, Treatment Effects, and Econometric Policy Evaluation Structural Equations, Treatment Effects, and Econometric Policy Evaluation
James J. Heckman, Edward Vytlacil
Econometrica, Vol. 73, No. 3 (May, 2005), pp. 669-738
Calibration
Introduction Calibration and Econometric Research: An Overview
Adrian Pagan
Journal of Applied Econometrics, Vol. 9, Supplement: Special Issue on Calibration Techniques and Eco... more
Published by: John Wiley & Sons
Adrian Pagan
Journal of Applied Econometrics, Vol. 9, Supplement: Special Issue on Calibration Techniques and Eco... more
Published by: John Wiley & Sons
Sunday, July 5, 2009
Statistical Computing with R
Statistical Computing with RMaria L. Rizzo Chapman & Hall/CRC
Cat. #: C5459ISBN: 9781584885450
ISBN 10: 1584885459
Publication Date: 11/15/2007
Table of Contents and description.
R code for examples in the book (by chapter).R code for all examples in a single zip file: SCRcode.zip (revised 04/05/2008)
Errata and Notes (revised 11/26/2008).
Cat. #: C5459ISBN: 9781584885450
ISBN 10: 1584885459
Publication Date: 11/15/2007
Table of Contents and description.
R code for examples in the book (by chapter).R code for all examples in a single zip file: SCRcode.zip (revised 04/05/2008)
Errata and Notes (revised 11/26/2008).
DEA technical efficiency score
function TE=techeff(X,Y)
%% techeff(X,Y) calculates the technical efficiency of decision making units%%% Input:% X: N x J matrix, with N inputs for each unit% Y: M x J matrix, with M outpus for each unit% J: # of decision making units%%% Output:% TE: J x 1 vetctor contains the technical efficiency of each DMU%%% Reference:% Hughes and Yaisawarng, 2004, "Sensitivity and dimensionality tests of DEA% efficiency scores," European Journal of Operational Research, 154,% p.410-422%%% Author information:% Yundong Tu% Department of Economics% University of California, Riverside% e-mail: yundong.tu@gmail.com% July 4, 2009
%check data inputs% if nargin<2% error(' Not enough input arguments to run techeff ')% end
if nargin<2 rand('twister',3); X=3.*rand(5,20); Y=5.*rand(3,20);end
%check dimension compatibilityif size(X,2)~=size(Y,2) error(' Input data are not compatible. Inputs and outputs must have the same collumns, i.e., for the same number of DMUs')end
options=optimset('Display','off');%,'MaxIter',100,'MaxFunEvals',100,'TolX',1e-2,'TolFun',1e-2);for k=1:size(X,2) [z,TE(k,1)]=linprog([zeros(size(X,2),1);1.0], [-Y,zeros(size(Y,1),1);X, -X(:,k)], [-Y(:,k);zeros(size(X,1),1.0)],... [ones(1,size(X,2)),0.0], 1.0,zeros(size(X,2)+1,1),ones(size(X,2)+1,1), 0.5.*ones(size(X,2)+1,1),options);end
%% techeff(X,Y) calculates the technical efficiency of decision making units%%% Input:% X: N x J matrix, with N inputs for each unit% Y: M x J matrix, with M outpus for each unit% J: # of decision making units%%% Output:% TE: J x 1 vetctor contains the technical efficiency of each DMU%%% Reference:% Hughes and Yaisawarng, 2004, "Sensitivity and dimensionality tests of DEA% efficiency scores," European Journal of Operational Research, 154,% p.410-422%%% Author information:% Yundong Tu% Department of Economics% University of California, Riverside% e-mail: yundong.tu@gmail.com% July 4, 2009
%check data inputs% if nargin<2% error(' Not enough input arguments to run techeff ')% end
if nargin<2 rand('twister',3); X=3.*rand(5,20); Y=5.*rand(3,20);end
%check dimension compatibilityif size(X,2)~=size(Y,2) error(' Input data are not compatible. Inputs and outputs must have the same collumns, i.e., for the same number of DMUs')end
options=optimset('Display','off');%,'MaxIter',100,'MaxFunEvals',100,'TolX',1e-2,'TolFun',1e-2);for k=1:size(X,2) [z,TE(k,1)]=linprog([zeros(size(X,2),1);1.0], [-Y,zeros(size(Y,1),1);X, -X(:,k)], [-Y(:,k);zeros(size(X,1),1.0)],... [ones(1,size(X,2)),0.0], 1.0,zeros(size(X,2)+1,1),ones(size(X,2)+1,1), 0.5.*ones(size(X,2)+1,1),options);end
Calling R from within Matlab
The COM interface allows Matlab users to call R from within Matlab. It is quite convenient for matlab users to interact with R functions. To make R project available to your matlab is very simple.
TO DO LIST:
1. Install Matlab: http://www.mathworks.com/
2. Install R: Open http://www.r-project.org/ , choose download R and then select a mirror.
3. Install the R package "rscproxy" in R. The package is available at: http://cran.r-project.org/. Go to package and find rscproxy. This can also be simply done by typing "install.packages('rscproxy') in R prompt. Then choose a mirror. Wait for 2 seconds and it is done.
4. Download R-(D)COM Interface by clicking R_Scilab_DCOM3.0-1B5.exe .
5. Download MATLAB R-link from: http://www.mathworks.com/matlabcentral/fileexchange/5051
6. Unzip the downloaded MATLAB R-link.zip into your current directory in matlab.
7. You can enjoy the convenience of having Matlab to call R now. Test if it is working by type "Rdemo" in Matlab commond window. If you are interested in nonparametric denstiy estimation, run the following MatlabcallRnp.m file
function MatlabcallRnp()
%% MatlabcallRnp() illustrates how to use Matlab to call the %% NP package in R. %% Note: all .m files in the Matlab_RLINK folder should be %% copied into the current directory in Matlab. You do not %% need run R when it is called.% Author Infor.% Yundong Tu% Department of Economics,% Univeristy of California, Riverside% e-mail: yundong.tu@email.ucr.edu
%% Connect to an R SessionopenR
%% Push data into R with putRdata()a = randn(200,1);putRdata('a',a)%%{%% Call the density (R function to estimate density) %% command into Matlab with evalR() %get the evaluation points for the density estimator xx= evalR('density(a)$x'); %get the corresponding evaluation of density fx= evalR('density(a)$y'); %figure subplot(2,1,1) plot(xx,fx); %plot the density function% %the density plot can be also called by R as evalR('plot(density(a),mfrow=c(2,1))');%}
%% Call the npudens (R function to estimate density) %% command into Matlab with evalR() %get the evaluation points for the density estimator evalR('data=data.frame(a)'); evalR('library(np)')
evalR('xx=npudens(data)$eval'); %dataframe xx=evalR('xx[[1]]') %matrix %get the corresponding evaluation of density fx= evalR('npudens(data)$dens') %figure %xy=eda; [xx,ind]=sort(xx); fx=fx(ind); subplot(2,1,2) plot(xx,fx); %plot the density function %the npudens plot can be also called by R as evalR('plot(npudens(a),add=FALSE)');%}%%{%% Run a series of commands and grab %% the result using getRdata()%save time to call density() just once, also get the bandwidthevalR('den=density(a)'); xx=evalR('den$x'); % the same as: evalR('xx=den$x'); xx=getRdata('xx');fx=evalR('den$y'); bw=evalR('den$bw');
figureplot(xx,fx);hold ontitle({['R-output DENSITY'];['Bandwidth=',num2str(bw)]});hold off%}%% Close the connectioncloseR
Other related links:
http://www.cs.ubc.ca/~murphyk/Software/callingRfromMatlab.html
http://webscripts.softpedia.com/script/Scientific-Engineering-Ruby/Statistics-and-Probability/MATLAB-R-link-35485.html
TO DO LIST:
1. Install Matlab: http://www.mathworks.com/
2. Install R: Open http://www.r-project.org/ , choose download R and then select a mirror.
3. Install the R package "rscproxy" in R. The package is available at: http://cran.r-project.org/. Go to package and find rscproxy. This can also be simply done by typing "install.packages('rscproxy') in R prompt. Then choose a mirror. Wait for 2 seconds and it is done.
4. Download R-(D)COM Interface by clicking R_Scilab_DCOM3.0-1B5.exe .
5. Download MATLAB R-link from: http://www.mathworks.com/matlabcentral/fileexchange/5051
6. Unzip the downloaded MATLAB R-link.zip into your current directory in matlab.
7. You can enjoy the convenience of having Matlab to call R now. Test if it is working by type "Rdemo" in Matlab commond window. If you are interested in nonparametric denstiy estimation, run the following MatlabcallRnp.m file
function MatlabcallRnp()
%% MatlabcallRnp() illustrates how to use Matlab to call the %% NP package in R. %% Note: all .m files in the Matlab_RLINK folder should be %% copied into the current directory in Matlab. You do not %% need run R when it is called.% Author Infor.% Yundong Tu% Department of Economics,% Univeristy of California, Riverside% e-mail: yundong.tu@email.ucr.edu
%% Connect to an R SessionopenR
%% Push data into R with putRdata()a = randn(200,1);putRdata('a',a)%%{%% Call the density (R function to estimate density) %% command into Matlab with evalR() %get the evaluation points for the density estimator xx= evalR('density(a)$x'); %get the corresponding evaluation of density fx= evalR('density(a)$y'); %figure subplot(2,1,1) plot(xx,fx); %plot the density function% %the density plot can be also called by R as evalR('plot(density(a),mfrow=c(2,1))');%}
%% Call the npudens (R function to estimate density) %% command into Matlab with evalR() %get the evaluation points for the density estimator evalR('data=data.frame(a)'); evalR('library(np)')
evalR('xx=npudens(data)$eval'); %dataframe xx=evalR('xx[[1]]') %matrix %get the corresponding evaluation of density fx= evalR('npudens(data)$dens') %figure %xy=eda; [xx,ind]=sort(xx); fx=fx(ind); subplot(2,1,2) plot(xx,fx); %plot the density function %the npudens plot can be also called by R as evalR('plot(npudens(a),add=FALSE)');%}%%{%% Run a series of commands and grab %% the result using getRdata()%save time to call density() just once, also get the bandwidthevalR('den=density(a)'); xx=evalR('den$x'); % the same as: evalR('xx=den$x'); xx=getRdata('xx');fx=evalR('den$y'); bw=evalR('den$bw');
figureplot(xx,fx);hold ontitle({['R-output DENSITY'];['Bandwidth=',num2str(bw)]});hold off%}%% Close the connectioncloseR
Other related links:
http://www.cs.ubc.ca/~murphyk/Software/callingRfromMatlab.html
http://webscripts.softpedia.com/script/Scientific-Engineering-Ruby/Statistics-and-Probability/MATLAB-R-link-35485.html
Wednesday, July 1, 2009
It will be a new world
Looking back to my econometric life for the past 5 years, many important persons have come to my life to help me make a difference. And my world has been changing all the time, indeed. There have been lights, heros, mentors, partners, as well as friends. And each experience is so precious and exciting. I feel deeply thankful for all those people there, adding new elements into my life and guiding me to move forward.
It is indeed not easy to stay in academia since there are way many things to learn, Econometric theory, computing techniques, economic applications and new stats elements as well. Deep love of all these rock and sand is sure the way to success in research life and the road to the happiness I have imagined years ago. It would be impossible to know everything, but good to know that there are things that need to learn in each stage as time goes by. To think deeper the questions at hand and the papers in progress, to learn the social skills to get to know the life of other professionals, to get things done more carefully, more precisely, more concisely, more intuitively and more regorously etc, are key steps to achieve academic accomplishment and recognizations. It will be a new world for sure and keep on marching forward.
Just look at an earlier blog about things econometricians do at
http://toyond.blogspot.com/2009/05/behave-as-econometrician.html
It is indeed not easy to stay in academia since there are way many things to learn, Econometric theory, computing techniques, economic applications and new stats elements as well. Deep love of all these rock and sand is sure the way to success in research life and the road to the happiness I have imagined years ago. It would be impossible to know everything, but good to know that there are things that need to learn in each stage as time goes by. To think deeper the questions at hand and the papers in progress, to learn the social skills to get to know the life of other professionals, to get things done more carefully, more precisely, more concisely, more intuitively and more regorously etc, are key steps to achieve academic accomplishment and recognizations. It will be a new world for sure and keep on marching forward.
Just look at an earlier blog about things econometricians do at
http://toyond.blogspot.com/2009/05/behave-as-econometrician.html
Subscribe to:
Posts (Atom)
Blog Archive
-
▼
2009
(172)
-
▼
July
(12)
- Matlab Symbolic Mathematics
- The ET Interview: Professor Jan Kmenta
- Teaching Modeling and Simulation in Economics: A P...
- Statistics on Statistics: Measuring Research Produ...
- A History of the Statistical Society of Canada: Th...
- The ET Dialogue: A Conversation on Econometric Met...
- Instrumental variable
- Calibration
- Statistical Computing with R
- DEA technical efficiency score
- Calling R from within Matlab
- It will be a new world
-
▼
July
(12)