Page 1 of 1

string declaration

Posted: Mon Feb 06, 2012 7:09 am
by Nau2306
Hi I am using eviews 6.

I have to calculate Ck = summation from t = 1 to k (rt^2)

I am trying a for loop
for !i = 1 to 4352
c!i = c(!i-1)+resid2(!i)

next

It gives me c!i is undefined or illegal command. I am only trying to like define the variable as c0, c1, c2, and so on up to c4352. How do I proceed with it so that it takes c!i as a string?

Thanks

Re: string declaration

Posted: Mon Feb 06, 2012 8:42 am
by EViews Gareth
I'm confused. What is c!i?

Re: string declaration

Posted: Mon Feb 06, 2012 9:13 am
by Nau2306
well it's like the variable name, c1, c2, c3 and so on upto ck... Oh i think i should store it in a matrix. Is that correct?

Re: string declaration

Posted: Mon Feb 06, 2012 9:15 am
by EViews Gareth
You're going to have to be more clear as to what you're trying to achieve.

Re: string declaration

Posted: Mon Feb 06, 2012 9:45 am
by Nau2306
Well I am trying to implement the ICSS(Iterated Cumulative Sum of Squares) algorithm where I use the residuals from a garch model to find the cumulative sum of squared residuals... if rt si the residual, then i need
c1 = r1
c2 = r1+r2 = c1+r2
c3 = r1+r2+r3 = c2 + r3
and so on

so i am trying to implement a for loop after declaring a scalar c0=0 such that

for !i=1 to 1000
c!i = c(!i-1) + r!i
next

I hope i am clearer now coz I really dont know how to explain it :?

Thanks

Re: string declaration

Posted: Mon Feb 06, 2012 10:05 am
by EViews Gareth
Perhaps you could talk about things in a more EViews like fashion. What is C1, C2 etc..? What type of object are they? Same goes for R1...

Re: string declaration

Posted: Mon Feb 06, 2012 11:16 am
by Nau2306
Lol I am just so bad at explaining but I think I have got what I was looking for.

Thanks loads for replying :)