## How does the IDM model works in SAS Forecast studio?

Solved
Occasional Contributor
Posts: 6

# How does the IDM model works in SAS Forecast studio?

I have used the IDM model to predict an intermittent time series in SAS Forecast studio,and the lead time is 12,but why all the predict values are the same and non-zero?

Accepted Solutions
Solution
‎03-20-2017 11:46 PM
SAS Super FREQ
Posts: 93

## Re: How does the IDM model works in SAS Forecast studio?

HI Amy_q,

Yes the forecasts will be the same for all periods into the future. The ratio of qty/periods represents the average qty per period, thus the forecasts will be the same for every single period. Based on the definition of IDM models, the demand occured randomly within a range of periods, and there is no way to know exactly when the demand will occur in the future. Therefore, the best bet is to use the forecasted average qty per period for all periods into the future.

thanks

Alex

/*sas code to reproduce the results*/

data inData;
input date yymmdd10. qty;
cards;
1990-02-01 0
1990-03-01 0
1990-04-01 0
1990-05-01 0
1990-06-01 3
1990-07-01 0
1990-08-01 0
1990-09-01 3
1990-10-01 0
1990-11-01 0
1990-12-01 6
1991-01-01 0
1991-02-01 7
1991-03-01 0
1991-04-01 8
1991-05-01 0
1991-06-01 5
1991-07-01 0
1991-08-01 6
1991-09-01 0
;;
run;

proc hpf data = inData out = _null_ outfor = outfor;
id date interval = month;
forecast qty/model = idm;
idm average =(method = simple);
run;

/*or you can forecast directly using the average series*/

data inData;
input avgDemand;
i = _n_;
cards;
0.6
1
2
3.5
4
2.5
3
;;
run;
proc hpf data = inData out = _null_ outfor = outfor;
id i interval = day;
forecast avgDemand/model=simple;
run;

All Replies
SAS Super FREQ
Posts: 93

## Re: How does the IDM model works in SAS Forecast studio?

for IDM models, the time series are decomposed into 2 components:

1. the periods with non-zero demand

2. the number of periods between 2 non-zero demand

then the 2 components are forecasted separately using smoothing models. You can interpret the forecasts of the 2 components as

1. the magnitude of non-zero demand when it occurs

2. how often a non-zero demand occurs

So if the the magnitude of non-zero demand when it occurs is 1 and the frequency of the occurrence of a non-zero demand is 4. the forecasts for the 4 periods will be 0.25 (1/4). If the simple exponential smoothing model is used for forecasts for both components, you will observe constant forecasts for both the magnitude and frequency of the demand, and thus a flat forecast for all periods into the future.

Hope this helps

Alex

Occasional Contributor
Posts: 6

## Re: How does the IDM model works in SAS Forecast studio?

Hi Alex,

I seem to understand how the idm model works,and i have made a demo, but the forecast values seem to be behaving unexpectedly,the intermittent time series is :

DATE      QTY

1990-02-01 0

1990-03-01 0

1990-04-01 0

1990-05-01 0

1990-06-01 3

1990-07-01 0

1990-08-01 0

1990-09-01 3

1990-10-01 0

1990-11-01 0

1990-12-01 6

1991-01-01 0

1991-02-01 7

1991-03-01 0

1991-04-01 8

1991-05-01 0

1991-06-01 5

1991-07-01 0

1991-08-01 6

1991-09-01 0

1991-10-01     2.99950

1991-11-01     2.99950

1991-12-01     2.99950

1992-01-01     2.99950

1992-02-01     2.99950

1992-03-01     2.99950

1992-04-01     2.99950

1992-05-01     2.99950

1992-06-01     2.99950

1992-07-01     2.99950

1992-08-01     2.99950

1992-09-01     2.99950

The red marked forcast values should be different and some should be zero,because it is an intermittent series,it has zero demand in the historic data,so it should have zero demand in the forecast,but it doesn't,i want to know why?

According to your reply ,i try to understand that it decomped into 2 components:

1. the periods with non_zero demand below:

date  qty

1990-06-01 3

1990-09-01 3

1990-12-01 6

1991-02-01 7

1991-04-01 8

1991-06-01 5

1991-08-01 6

2.  the number of periods between 2 non-zero demand below:

date  periods between 2 non-zreo demand

1990-06-01 5

1990-09-01 3

1990-12-01 3

1991-02-01 2

1991-04-01 2

1991-06-01 2

1991-08-01 2

3. then it has calculated a sequence ratio below,which is equal to qty/periods between 2 non-zreo demand:

1990-06-01 0.6

1990-09-01 1

1990-12-01 2

1991-02-01 3.5

1991-04-01 4

1991-06-01 2.5

1991-08-01 3

4. it gives the predict according to the sequence ratio series,and it seems to use ESM model to forecast,so if i set the lead time=12,all the forecast values are the same?

thanks,

amy_q

Solution
‎03-20-2017 11:46 PM
SAS Super FREQ
Posts: 93

## Re: How does the IDM model works in SAS Forecast studio?

HI Amy_q,

Yes the forecasts will be the same for all periods into the future. The ratio of qty/periods represents the average qty per period, thus the forecasts will be the same for every single period. Based on the definition of IDM models, the demand occured randomly within a range of periods, and there is no way to know exactly when the demand will occur in the future. Therefore, the best bet is to use the forecasted average qty per period for all periods into the future.

thanks

Alex

/*sas code to reproduce the results*/

data inData;
input date yymmdd10. qty;
cards;
1990-02-01 0
1990-03-01 0
1990-04-01 0
1990-05-01 0
1990-06-01 3
1990-07-01 0
1990-08-01 0
1990-09-01 3
1990-10-01 0
1990-11-01 0
1990-12-01 6
1991-01-01 0
1991-02-01 7
1991-03-01 0
1991-04-01 8
1991-05-01 0
1991-06-01 5
1991-07-01 0
1991-08-01 6
1991-09-01 0
;;
run;

proc hpf data = inData out = _null_ outfor = outfor;
id date interval = month;
forecast qty/model = idm;
idm average =(method = simple);
run;

/*or you can forecast directly using the average series*/

data inData;
input avgDemand;
i = _n_;
cards;
0.6
1
2
3.5
4
2.5
3
;;
run;
proc hpf data = inData out = _null_ outfor = outfor;
id i interval = day;
forecast avgDemand/model=simple;
run;

Occasional Contributor
Posts: 6