string declaration

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

string declaration

Postby Nau2306 » Mon Feb 06, 2012 7:09 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: string declaration

Postby EViews Gareth » Mon Feb 06, 2012 8:42 am

I'm confused. What is c!i?

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: string declaration

Postby Nau2306 » Mon Feb 06, 2012 9:13 am

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?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: string declaration

Postby EViews Gareth » Mon Feb 06, 2012 9:15 am

You're going to have to be more clear as to what you're trying to achieve.

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: string declaration

Postby Nau2306 » Mon Feb 06, 2012 9:45 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: string declaration

Postby EViews Gareth » Mon Feb 06, 2012 10:05 am

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...

Nau2306
Posts: 74
Joined: Thu Nov 17, 2011 11:51 am

Re: string declaration

Postby Nau2306 » Mon Feb 06, 2012 11:16 am

Lol I am just so bad at explaining but I think I have got what I was looking for.

Thanks loads for replying :)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests