MATLAB code for Shape Constrained Kernel-weighted Least Squares (SCKLS)

matlabicon_256

Adaptations done by
Andrew L. Johnson ajohnson@tamu.edu
Daisuke Yagi d.yagi@tamu.edu

Function to compute the SCKLS estimator of the response y on the data matrix X
Function NEEDS the quadprog function in Optimization Toolbox  in the computer

To run the example files, you NEED the MATLAB code for the Local Polynomial Estimator we developed.

y: the response variable — a column vector of length n
X: the data matrix of the predictors (of size n*d);

For more details, please refer to the following paper:
Shape constrained kernel-weighted least squares: Application to production function estimation for Chilean manufacturing industries
2018. Accepted, Journal of Business and Economic Statistics.

Download

MATLAB code for Local Polynomial Estimator

matlabicon_256

Adaptations done by
Andrew L. Johnson ajohnson@tamu.edu
Daisuke Yagi d.yagi@tamu.edu

Function to compute the (unconstrained) local polynomial regression of the response y on the data matrix X
Function NEEDS the quadprog function in Optimization Toolbox  in the computer

y: the response variable — a column vector of length n
X: the data matrix of the predictors (of size n*d);

For more details about Local Polynomial, please refer to the following book:
Shape constrained kernel-weighted least squares: Application to production function estimation for Chilean manufacturing industries

Download

GAMS Tutorial

gams_s

 

This file contains the set of GAMS codes that was developed for a GAMS tutorial at EWEPA XIV held in June 2015 in Helsinki Finland. Please see the codes inside the zip file.

 

Tutorial (files)

MATLAB code for Constrained Weighted Bootstrap with y-space objective function

matlabicon_256

 

This is the code for Constrained Weighted Bootstrap with y-space objective function written by Daisuke Yagi (d.yagi@tamu.edu).

Constrained Weighted Bootstrap is developed by Hall & Huang (2001) and Du et al. (2013).

ExperimentSettings.m file is the summary of the setting of Monte Carlo Simulation. You can run this file after you set every parameters for the experiments. If you want to use the real data, then you can use LLKwSCtest.m directly, which is the main code for the whole estimation process. Other files are called from LLKwSCtest.m during the process of bandwidth selection and estimation.

Function to compute the CONVEX Regression of the response y on the data matrix x with weight p
Function NEEDS the PACKAGE cvx (see http://cvxr.com/cvx/) to be installed in the computer

 

 

Du, P., Parmeter, C.F., Racine, J.S. (2013). Nonparametric kernel regression with multiple predictors and multiple shape constraints. Statistica Sinica 23(3): 1347–1371.

 

 

Download

MATLAB code for Kernel Weighted Convex Regression

matlabicon_256

 

This is the code for Kernel Weighted Convex Regression written by Daisuke Yagi (d.yagi@tamu.edu).

We have two versions of KWCR: fixed bandwidth and variable bandwidth (KNN). ExperimentSettings.m file is the summary of the setting of Monte Carlo Simulation. You can run this file after you set every parameters for the experiments.

If you want to use the real data, then you can use LLKwSCtest.m directly, which is the main code for the whole estimation process. Other files are called from LLKwSCtest.m during the process of bandwidth selection and estimation.

You need to install Optimization Toolbox – quadprog function in your MATLAB.

 

Download

MATLAB code for Convex Nonparametric Least Square with Efficient Algorithm

matlabicon_256

The first version of this code was created by Bodhisattva Sen at Columbia University. What is presented here is a slightly adapted version to aid in the estimation of CNLS.

Adaptations done by
Andrew L. Johnson ajohnson@tamu.edu
Jose Luis Preciado jpreciado@tamu.edu
Daisuke Yagi d.yagi@tamu.edu

Function to compute the CONVEX Regression of the response y on the data matrix x
Function NEEDS the quadprog function in Optimization Toolbox  in the computer

y: the response variable — a column vector of length n
x: the data matrix of the predictors (of size n*p);
Note that the vector of ones is NOT required in the data matrix

We also integrated the efficient algorithm developed by Lee, C.-Y. (2014). This will help to reduce the computational time.

 

Download

GAMS code for DEA

gams_s

 

This file contains the set of GAMS codes for DEA that was developed for a GAMS tutorial at EWEPA XIII held in June 2013 in Helsinki Finland. Please see the introduction of codes inside the zip file.

 

Download

 

GAMS code for CNLS

 

gams_s

 

This file contains the set of GAMS codes for CNLS that was developed for a GAMS tutorial at EWEPA XIII held in June 2013 in Helsinki Finland. Please see the introduction of codes inside the zip file.

 

Download

MATLAB code for Convex Nonparametric Least Square

matlabicon_256
The first version of this code was created by Bodhisattva Sen at Columbia University. What is presented here is a slightly adapted version to aid in the estimation of CNLS.

Adaptations done by Andrew L. Johnson ajohnson@tamu.edu

Function to compute the CONVEX Regression of the response y on the data matrix x
Function NEEDS the PACKAGE cvx (see http://cvxr.com/cvx/) to be installed in the computer

y: the response variable — a column vector of length n
x: the data matrix of the predictors (of size n*p);
Note that the vector of ones is NOT required in the data matrix

th: the value of the fitted response

The function also gives estimates of the sub-gradients at each data point and is stored in the ‘beta1’ matrix

Note that for sample sizes of 200 or more, the function can be very slow!
It involves n(n-1) many constraints

 

 

 

Download

MATLAB code for A Birth-Death Markov Chain Monte Carlo Method to Estimate the Number of States in a State-Contingent Production Frontier Model

matlabicon_256
To run BDMCMC with the Tarlac rice dataset

  1. Place all contents of this package on the same folder and make it the active folder in Matlab.
  2. BDMCMC_Dummy_Trend_Mono runs the monotonicity-constrained dummy time trend model.
  3. BDMCMC_Linear_Trend_Mono runs the monotonicity-constrained linear time trend model.
  4. RiceIM contains the dataset scaled to input means (used on the estimation process).
  5. Rice contains the dataset in its original units of measurement. This is a subset of the dataset used in Villano, O’Donnell and Battesse (2004) and the same dataset used by ODG.

References

Villano, R.A., C.J. O’Donnell, and G.E. Battese. 2004. “An Investigation of Production Risk, Risk Preferences and Technical Efficiency: Evidence from Rainfed Lowland Rice Farms in the Philippines.” Article presented at Asia-Pacific Productivity Conference, Brisbane, 14–16 July.

 

 

 

Download