Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: OLS regression with constrained coefficients
Posted:
Apr 9, 2013 2:26 PM


On 4/9/2013 10:58 AM, Mat wrote: > Hello, I'm a new user of Matlab. > I need to run an OLS regression like: > > R(t)=a+b1*M(1)+b2*M(2)+.....b12*M(12)+e(t) > > where "a" is a constant, M(j) is a calendar month dummy that equals to > one if the month t is the Jth month of the year and zero otherwis, > e(t) is the error term. > > I have to impose the restictions that: > > the SUM of the coefficients of the calendar month dummy has to be > zero. (sum b1+...+b12=0). > > Do someone know how to do that? > How can I impose this restriction? > > Thank you very much for your help. > Matteo
If you have Optimization Toolbox, you can use the lsqlin function: http://www.mathworks.com/help/optim/ug/lsqlin.html
Alan Weiss MATLAB mathematical toolbox documentation



