Page 1 of 1

restricting coef

Posted: Thu Aug 11, 2011 6:00 am
by mjfl
hi all,

i have read some methods to make all coeff add up to 1. eg c(1)+c(2)+c(3)=1 so rite c(3) in the least square as 1-c(1)-c(2).
1. what if i have lags that choose by themselves and i would like the lags to add up to 1 in all eqn? how can i do it?

Code: Select all

for !horizon= 59 to 82 smpl 1989q1 1989q1+!horizon equation eq{!horizon} for !i=0 to !maxlags for !j=0 to !maxlags eq{!horizon}.ls(cov=hac) y c x( to -!i) z( to -!j) if eq{!horizon}.@sc < !sc then !best2lag =!j !bestlag = !i !sc = eq{!horizon}.@sc endif next next eq{!horizon}.ls(cov=hac) y c x( to -!bestlag) z( to -!best2lag)

2. what if i would like the coefficient to remain 1? i.e. eq.ls y x z but coefficent of z is always 1?
3. is there anyway to restrict a cointreg such that coefficients add up to 1 too?

Code: Select all

equation eq4.cointreg y=c(1)*x+(1-c(1))*z

pls advice and thank u in advance. :)

Re: restricting coef

Posted: Mon Aug 15, 2011 8:04 am
by mjfl
hi sorry could i get some phelp on this pls?

Re: restricting coef

Posted: Mon Aug 15, 2011 8:43 am
by EViews Gareth
1) Since you can only impose the adding up condition when specifying an equation by expression, you'll have to change your code so that it specifies your equation by expression

2) ls y-z x

3) No