Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: OLS regression with constrained coefficients
Replies: 3   Last Post: Apr 9, 2013 9:31 PM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 Alan Weiss Posts: 1,390 Registered: 11/27/08
Re: OLS regression with constrained coefficients
Posted: Apr 9, 2013 2:26 PM
 Plain Text Reply

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

Date Subject Author
4/9/13 Guest
4/9/13 Alan Weiss
4/9/13 Bruno Luong
4/9/13 Jeff Miller

© The Math Forum at NCTM 1994-2016. All Rights Reserved.