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))*zpls advice and thank u in advance. :)
