Forecasting using SAS Forecast Server, SAS/ETS, and more

SAS ETS Date Variable

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 75
Accepted Solution

SAS ETS Date Variable

Hello,

In order for the SAS ETS procedures to work there should be a date variable in the data set. This variable must be equally spaced. If there are missing values we should place the ".". If there are non working days e.g. weekends then we should not include any dates that correspond to weekends. So, for example, if 4th of May is Saturday and the weeends are non working days then date variable should be like this:
May, 3
May, 6
.
May, 10
May, 13

What if we have a working day e.g. Wednsesday that was a public holiday. We must include this date, otherwise the date would not be equally spaced. What value should we put for our variable of interest corresponding to this date? Is it goint to be the regular missing value "." or something else to declare that this was a working day but exceptionally it is non working day because of the public holiday?


Thanks in advance,


Andreas


Accepted Solutions
Solution
‎12-02-2011 04:29 PM
SAS Employee
Posts: 416

SAS ETS Date Variable

Hello Andreas -

In my opinion it depends on the business problem you have at hand. If there is no record in your time series data due to a public holiday the question becomes: was that to be expected?

For example, if in a retail context stores are closed due to a public holiday I would replace these missing values with 0 - as in "no sales". In an energy demand forecasting context a missing value on a public holiday seems to indicate that there was a problem capturing the true demand, so 0 might not be appropriate and maybe replacing the missing value with a mean, median, etc., is the better strategy. In general it might be worthwhile to flag these replacements with a dummy variable (or an event), as it might become useful for modeling purposes later on - for example if the same holiday occurs again in the future you might want to tell your model about it so it can react appropriately.

As you may know, SAS High-Performance Forecasting features a procedure called HPFEVENTS which makes it very convenient to deal with these kinds of events. This procedure can also be accessed via SAS Forecast Studio.

In additon, as you have pointed out already, if missing values are reoccurring regularly due to no sales on weekends for example, you can tell the SAS procedures about it by using the appropriate date format - such as WEEKDAY for example. In this case there is no need need to fill gaps in your time series at all.

Hope that helps,

Udo

View solution in original post


All Replies
Solution
‎12-02-2011 04:29 PM
SAS Employee
Posts: 416

SAS ETS Date Variable

Hello Andreas -

In my opinion it depends on the business problem you have at hand. If there is no record in your time series data due to a public holiday the question becomes: was that to be expected?

For example, if in a retail context stores are closed due to a public holiday I would replace these missing values with 0 - as in "no sales". In an energy demand forecasting context a missing value on a public holiday seems to indicate that there was a problem capturing the true demand, so 0 might not be appropriate and maybe replacing the missing value with a mean, median, etc., is the better strategy. In general it might be worthwhile to flag these replacements with a dummy variable (or an event), as it might become useful for modeling purposes later on - for example if the same holiday occurs again in the future you might want to tell your model about it so it can react appropriately.

As you may know, SAS High-Performance Forecasting features a procedure called HPFEVENTS which makes it very convenient to deal with these kinds of events. This procedure can also be accessed via SAS Forecast Studio.

In additon, as you have pointed out already, if missing values are reoccurring regularly due to no sales on weekends for example, you can tell the SAS procedures about it by using the appropriate date format - such as WEEKDAY for example. In this case there is no need need to fill gaps in your time series at all.

Hope that helps,

Udo

Regular Contributor
Posts: 184

SAS ETS Date Variable

To take it a step further, one can create a custom interval to reflect the holiday pattern. See

http://www.sascommunity.org/wiki/Generating_Holiday_Lists#Custom_Intervals

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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