ETS Exponential Smoothing on Many Series

For questions regarding programming in the EViews programming language.

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

econac
Posts: 6
Joined: Thu Jul 28, 2011 8:15 am

ETS Exponential Smoothing on Many Series

Postby econac » Tue Jun 09, 2015 12:07 pm

Is there a way to use the "For" looping programming on say, 200 series to generate the automatic ETS estimation/forecast (AIC) selection. This is the equivalent of doing Series--Proc-Exponential Smoothing-ETS--"Auto" many, many times. Thanks.

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

Re: ETS Exponential Smoothing on Many Series

Postby EViews Gareth » Tue Jun 09, 2015 3:57 pm

Yes, it is pretty straight forward.

You'll want to use the @wlookup function to obtain a string containing the names of every series in your workfile. Then use the for loop to loop over that string, performing ETS on each series one at a time. You can look up .ets in the object reference for more details of it.
Follow us on Twitter @IHSEViews

econac
Posts: 6
Joined: Thu Jul 28, 2011 8:15 am

Re: ETS Exponential Smoothing on Many Series

Postby econac » Wed Jun 10, 2015 9:08 am

Thanks, Gareth. It appears to be working, so for others, here's what I did:
My series names are "col1", "col2", etc. so I collected them in a string variable "lister" in the way Gareth suggested. "Lister" is a long, space delimited string of all the series names. Then it took me a bit to get the loop syntax exactly right. I seem to only be able to run the looping as a program, not in the command window.

lister=@wlookup("*","series")
for %y {lister}
{%y}.ets(e=e, t=e, s=n) {%y}_smooth
next

econac
Posts: 6
Joined: Thu Jul 28, 2011 8:15 am

Re: ETS Exponential Smoothing on Many Series

Postby econac » Wed Jun 10, 2015 12:08 pm

Garth,

I do have one follow up. I can't get the estimation results to spool. I thought, from the documentation, it would be generated automatically, but it doesn't. I also didn't want a bunch of spools, so I was thinking to put the append statement in the loop. I created a spool called "sp1" in the workfile. It is asking for a list of objects, but I can't quite figure out how to name them or to see what the "fully qualified" name of the table is. "Table" didn't work. Or if there is an "all " option, I'd take that. Any thoughts on how to get the estimation results out.

Thanks again.

for %y {lister}
{%y}.ets(e=e, t=e, s=e, table=cl)
sp1.append
next


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 52 guests