store autoarima in model object

For questions regarding programming in the EViews programming language.

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

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

store autoarima in model object

Postby BT454 » Thu Jan 26, 2023 2:25 pm

Hi all!
I'm creating several automatic arima forecasts in a loop, within a program. I would like to at least save the model stats as tables within my workfile or if possible, store the automatic arima models as equations within my model. Any thoughts on how to do this?
I've included some of my code below:

Code: Select all

model hsddc_daily

for %x CEN NED WST US
  smpl %ss %es
  pysh{%x}.autoarma(maxsar=1, maxsma=1, noconv, forclen=135, etable) pysh{%x}_0
  smpl %ss %es
  hsddc{%x}.autoarma(maxsar=1, maxsma=1, noconv, forclen=120, etable) hsddc{%x}_0 dom pysh{%x}
next
for %x cen ned wst us
  hsddc_daily.append @identity ihsddc{%x} = pysh{%x}_0*hsddc{%x}(-365)
next
'solve the model
%solvestart = @datestr(@dateadd(@dateval(hsddcned.@last),-14,"d"),"mm/dd/yyyy")
%solveend = @datestr(@dateadd(@dateval(hsddcned.@last),120,"d"),"mm/dd/yyyy")
smpl %solvestart %solveend
hsddc_daily.solveopt(s=d,d=d,m=5000,c=1e-8,a=f,o=g,i=a,n=t,e=t,g=n,z=1e-7,f=t,v=f,j=a)
solve hsddc_daily

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

Re: store autoarima in model object

Postby EViews Gareth » Tue Jan 31, 2023 10:25 am

I don't understand exactly what you want to store. Aren't you already using the etable option to store the results table?
Follow us on Twitter @IHSEViews

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

Re: store autoarima in model object

Postby BT454 » Tue Jan 31, 2023 2:03 pm

I am, but the tables are seemingly not being produced. When the loop finishes, there are no tables in the WF. Any thoughts?

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

Re: store autoarima in model object

Postby EViews Gareth » Tue Jan 31, 2023 3:21 pm

Ah, right, you'll need to freeze it.

Code: Select all

freeze(myname) series.autoarma(etable)
Follow us on Twitter @IHSEViews

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

Re: store autoarima in model object

Postby BT454 » Wed Feb 01, 2023 8:23 am

I was able to figure out how to create an equation in the autoarima code, so this is solved.
I did notice that eviews tends to run much slower using the autoarima function. Is this typical?
It's chewing up a fair amount of my cpu/ram (58% and 68%, respectively). Is there a way I could code the equations to still select the best eq, while speeding up the process (similar to declaring a model object, merging the eqs into the model, and solving it does for the auto-var?)
Thanks again!
Bob

BT454
Posts: 135
Joined: Wed Aug 02, 2017 6:07 am

Re: store autoarima in model object

Postby BT454 » Tue Feb 07, 2023 8:30 am

I figured out that using the maxsar and maxsma options was slowing it down, and producing less accurate results. Problem solved!
A follow up question:
I can't seem to get the command to product the forecast comparison graphs in the loop. Code is below. Any help is appreciated.
Thanks!

Code: Select all

for %x CEN NED WST 'US
  smpl %ss %es
  statusline estimating %x daily hsd connects equation
  hsddc{%x}.autoarma(tform = "auto", maxsar=0, maxsma=0, select=mse, msetype="dyn", periods=365, forclen=!fl, eqname=hsddc{%X}_0eq, fgraph) hsddc{%x}_0 @expand(@weekday) @expand(@quarter)
  hsddc_daily.merge hsddc{%x}_0eq
next

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

Re: store autoarima in model object

Postby EViews Gareth » Tue Feb 07, 2023 9:59 am

You need to freeze the output.
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 30 guests