Page 1 of 1

Imposing Restrictions

Posted: Fri Oct 30, 2009 6:53 pm
by Yuyi
Deal all,
Can anyone please help me how to impose a restriction in a linear model? I have the following model in that sum of the coefficients add up to one:

Code: Select all

y=c(1)*x + (1-c(1))*z.
I need to impose another restriction so that both coefficients have to be non-negative.

Any comments would be greatly appreciated.
Yuyi

Re: Imposing Restrictions

Posted: Sat Oct 31, 2009 4:54 am
by trubador
Putting limits on estimated coefficient values.

Please search the forum for further examples and discussions on this subject...

Re: Imposing Restrictions

Posted: Sat Oct 31, 2009 5:47 am
by Yuyi
Many thanks for directing to me towards detailed discussion on imposing restrictions. I found the relevant specification for me is the following.

Code: Select all

ai = exp( bi ) / ( exp( b1 ) + exp( b2 ) + ... + exp( bk ) )
, where

Code: Select all

ai > 0 a1+a2+...+ak=1
Could you please help me to apply this rule in the following model, because the way it explains confuses me.

Code: Select all

y=c(1)*x+(1-c(1))*z
I'd greatly appreciate your comments! please !
Yuyi

Re: Imposing Restrictions

Posted: Sat Oct 31, 2009 6:46 am
by trubador
That is the general formula to restrict the coefficients to be nonnegative and to sum up to one. Since you have only two coefficents, the following would suffice:

Code: Select all

y =@exp(c(1))*x + (1-@exp(c(1)))*z
Estimation output will display the value of c(1), and the coefficient you actually seek can be calculated via @exp(c(1)).

Re: Imposing Restrictions

Posted: Sat Oct 31, 2009 7:19 am
by Yuyi
Many thanks. I appreciate it. Cheers.