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.