asymmetrical vector auto regression
Posted: Sun Jan 19, 2014 11:12 am
I have one program on asymmetrical vector auto regression where each variable can have different lags. my program run on pricncipal cpmponents derived from IIP, INFLATION, MONEY and INTEREST RATE.
My problem is that below program is not showing final equations with best lag but with maximum lag.
please help
equation eqfavar
equation eq2
equation eq3
equation eq4
equation eq5
!maxlags=4
!bestlaga=0
!bestlagb=0
!bestlagc=0
!bestlagd=0
!bestlage=0
!sc=99999999
!scnew=9999999
for !a=1 to !maxlags
for !b=1 to !maxlags
for !c=1 to !maxlags
for !d=1 to !maxlags
for !e=1 to !maxlags
eqfavar.ls(cov=hac) grgdp c grgdp(-1 to -!a) pciip1(-1 to -!b) pcinflation1(-1 to -!c) pcinterest1(-1 to -!d) pcmoney1(-1 to -!e)
eq2.ls(cov=hac) pciip1 c grgdp(-1 to -!a) pciip1(-1 to -!b) pcinflation1(-1 to -!c) pcinterest1(-1 to -!d) pcmoney1(-1 to -!e)
eq3.ls(cov=hac) pcinflation1 c grgdp(-1 to -!a) pciip1(-1 to -!b) pcinflation1(-1 to -!c) pcinterest1(-1 to -!d) pcmoney1(-1 to -!e)
eq4.ls(cov=hac) pcinterest1 c grgdp(-1 to -!a) pciip1(-1 to -!b) pcinflation1(-1 to -!c) pcinterest1(-1 to -!d) pcmoney1(-1 to -!e)
eq5.ls(cov=hac) pcmoney1 c grgdp(-1 to -!a) pciip1(-1 to -!b) pcinflation1(-1 to -!c) pcinterest1(-1 to -!d) pcmoney1(-1 to -!e)
!scnew=eqfavar.@sc+eq2.@sc+eq3.@sc+eq4.@sc+eq5.@sc
if !scnew<!sc then
!bestlaga=!a
!bestlagb=!b
!bestlagc=!c
!bestlagd=!d
!bestlage=!e
endif
next
next
next
next
next
eqfavar.ls(cov=hac) grgdp c grgdp(-1 to -!bestlaga) pciip1(-1 to -!bestlagb) pcinflation1(-1 to -!bestlagc) pcinterest1(-1 to -!bestlagd) pcmoney1(-1 to -!bestlage)
eq2.ls(cov=hac) pciip1 c grgdp(-1 to -!bestlaga) pciip1(-1 to -!bestlagb) pcinflation1(-1 to -!bestlagc) pcinterest1(-1 to -!bestlagd) pcmoney1(-1 to -!bestlage)
eq3.ls(cov=hac) pcinflation1 c grgdp(-1 to -!bestlaga) pciip1(-1 to -!bestlagb) pcinflation1(-1 to -!bestlagc) pcinterest1(-1 to -!bestlagd) pcmoney1(-1 to -!bestlage)
eq4.ls(cov=hac) pcinterest1 c grgdp(-1 to -!bestlaga) pciip1(-1 to -!bestlagb) pcinflation1(-1 to -!bestlagc) pcinterest1(-1 to -!bestlagd) pcmoney1(-1 to -!bestlage)
eq5.ls(cov=hac) pcmoney1 c grgdp(-1 to -!bestlaga) pciip1(-1 to -!bestlagb) pcinflation1(-1 to -!bestlagc) pcinterest1(-1 to -!bestlagd) pcmoney1(-1 to -!bestlage)
My problem is that below program is not showing final equations with best lag but with maximum lag.
please help
equation eqfavar
equation eq2
equation eq3
equation eq4
equation eq5
!maxlags=4
!bestlaga=0
!bestlagb=0
!bestlagc=0
!bestlagd=0
!bestlage=0
!sc=99999999
!scnew=9999999
for !a=1 to !maxlags
for !b=1 to !maxlags
for !c=1 to !maxlags
for !d=1 to !maxlags
for !e=1 to !maxlags
eqfavar.ls(cov=hac) grgdp c grgdp(-1 to -!a) pciip1(-1 to -!b) pcinflation1(-1 to -!c) pcinterest1(-1 to -!d) pcmoney1(-1 to -!e)
eq2.ls(cov=hac) pciip1 c grgdp(-1 to -!a) pciip1(-1 to -!b) pcinflation1(-1 to -!c) pcinterest1(-1 to -!d) pcmoney1(-1 to -!e)
eq3.ls(cov=hac) pcinflation1 c grgdp(-1 to -!a) pciip1(-1 to -!b) pcinflation1(-1 to -!c) pcinterest1(-1 to -!d) pcmoney1(-1 to -!e)
eq4.ls(cov=hac) pcinterest1 c grgdp(-1 to -!a) pciip1(-1 to -!b) pcinflation1(-1 to -!c) pcinterest1(-1 to -!d) pcmoney1(-1 to -!e)
eq5.ls(cov=hac) pcmoney1 c grgdp(-1 to -!a) pciip1(-1 to -!b) pcinflation1(-1 to -!c) pcinterest1(-1 to -!d) pcmoney1(-1 to -!e)
!scnew=eqfavar.@sc+eq2.@sc+eq3.@sc+eq4.@sc+eq5.@sc
if !scnew<!sc then
!bestlaga=!a
!bestlagb=!b
!bestlagc=!c
!bestlagd=!d
!bestlage=!e
endif
next
next
next
next
next
eqfavar.ls(cov=hac) grgdp c grgdp(-1 to -!bestlaga) pciip1(-1 to -!bestlagb) pcinflation1(-1 to -!bestlagc) pcinterest1(-1 to -!bestlagd) pcmoney1(-1 to -!bestlage)
eq2.ls(cov=hac) pciip1 c grgdp(-1 to -!bestlaga) pciip1(-1 to -!bestlagb) pcinflation1(-1 to -!bestlagc) pcinterest1(-1 to -!bestlagd) pcmoney1(-1 to -!bestlage)
eq3.ls(cov=hac) pcinflation1 c grgdp(-1 to -!bestlaga) pciip1(-1 to -!bestlagb) pcinflation1(-1 to -!bestlagc) pcinterest1(-1 to -!bestlagd) pcmoney1(-1 to -!bestlage)
eq4.ls(cov=hac) pcinterest1 c grgdp(-1 to -!bestlaga) pciip1(-1 to -!bestlagb) pcinflation1(-1 to -!bestlagc) pcinterest1(-1 to -!bestlagd) pcmoney1(-1 to -!bestlage)
eq5.ls(cov=hac) pcmoney1 c grgdp(-1 to -!bestlaga) pciip1(-1 to -!bestlagb) pcinflation1(-1 to -!bestlagc) pcinterest1(-1 to -!bestlagd) pcmoney1(-1 to -!bestlage)