BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
problems99
Calcite | Level 5

Hello

I would like to use TSFC but by using command lines because it is a repetitic operation to do in the case of my application. So i did that:

dm 'forecast data = work.nb_&datasetn id = d_report interval = month horizon=1 entry=forecast out=forecast';

run;

The problem is that requires "var" but I have dozens series in that file. It seems that I cannot run that for all those series like with window TSFS.

Here is the result that I would like to have, like by using window TSFS: http://image.noelshack.com/fichiers/2015/23/1433509516-forecast.png. It is more validation of previous data than forecast.

Maybe is it an other way to do ? I tried with PROC forecast but it can't fit best model (I think).

Thanks for your help.

Francois

1 ACCEPTED SOLUTION

Accepted Solutions
SnurreJensen
SAS Employee

Yes. PROC ESM works with one type of exponential smoothing model and optimizes its parameters. In your case you would then need to create multiple runs of PROC ESM for all variables and store the results in order to compare them and select the best model for each series.

For your current setup, instead of using the FORECAST command you should probably try the %FORECAST macro instead. More information available here: http://support.sas.com/documentation/cdl/en/etsug/67525/HTML/default/etsug_tfcomref_toc.htm

Thanks,

Snurre

View solution in original post

3 REPLIES 3
SnurreJensen
SAS Employee

Hi,

I'm not entirely sure what you are using TSFS for but there are a couple of options you could consider:

- Use the SAS Macro facility to build some smart code - for instance a loop around the same command where you only substitute the variable name.

- Use something like PROC ESM which supports variable lists in the FORECAST statement.

Even though the first option is certainly doable, it might be a somewhat daunting task if you are not familiar with the SAS Macro facility already. Unless there are some considerations which your opening post do not mention that should be taken into account, I would recommend the second option.

Thanks,

Snurre

problems99
Calcite | Level 5

Yes, it works.

However, I would like to fit the best model to my different series (wich can be different for each serie) and ESM don't do that (I think, because the standard error of TSFS is always inferior or lower to standard error of ESM).

By using macro, I succes to list all my variables. However, I met a bug by using this by command line.

http://image.noelshack.com/fichiers/2015/24/1433755526-screen.png

http://image.noelshack.com/fichiers/2015/24/1433755526-screen2.png

Already for only one variable, TSFS does not close the window after fitting one serie. So, when it starts to fit the second serie it displays an error message.

So, do you have an idea iether to fix this bug or to fit the best model to my series?

Thanks,

François

SnurreJensen
SAS Employee

Yes. PROC ESM works with one type of exponential smoothing model and optimizes its parameters. In your case you would then need to create multiple runs of PROC ESM for all variables and store the results in order to compare them and select the best model for each series.

For your current setup, instead of using the FORECAST command you should probably try the %FORECAST macro instead. More information available here: http://support.sas.com/documentation/cdl/en/etsug/67525/HTML/default/etsug_tfcomref_toc.htm

Thanks,

Snurre

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1746 views
  • 3 likes
  • 2 in conversation