Problem with a simple loop
Posted: Wed Nov 19, 2014 9:12 am
Hi everyone and thanks in advance for your help! I have a quite ridiculous problem with the easiest loop ever.
After running an autoregressive model I am trying to perform a simple operation with the coefficients of the regression. I would like to calculate the long term value using all the AR coefficients i've run (i.e. 10), thus i wrote the following:
Unfortunately the code doesn't perform the whole operation, in fact it calculates the following:
c(1)/(1-c(11))
While i was expecting:
c(1)/(1-c(11)-c(10)-c(9)-...-c(2))
Hope someone of you can help me.
thank you all!!
After running an autoregressive model I am trying to perform a simple operation with the coefficients of the regression. I would like to calculate the long term value using all the AR coefficients i've run (i.e. 10), thus i wrote the following:
Code: Select all
for !p = 2 to 10
table longterm
longterm(1,1)= c(1)/(1-c(1+!p))
nextc(1)/(1-c(11))
While i was expecting:
c(1)/(1-c(11)-c(10)-c(9)-...-c(2))
Hope someone of you can help me.
thank you all!!