The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alan Weiss

Posts: 1,430
Registered: 11/27/08
Re: OLS regression with constrained coefficients
Posted: Apr 9, 2013 2:26 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic 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:

Alan Weiss
MATLAB mathematical toolbox documentation

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

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