07-29-2016 03:46 AM - edited 07-29-2016 03:50 AM
is there any way to restrich forcast to non negative value while using proc ARIMA. The code I am using is somthing like:
proc arima data=ECC_PROG.input_&model_id._FC;
estimate input= maxiter=500
ods output ParameterEstimates=work.est_output;
forecast id=Monthfirstdate interval=current_month lead=20 out=work.fc_output;
The forcast series is:
875.34663397 (This is the first future forcast)
The red marked forcast values should be non negative. As you see in the series after only two non negative futur forcasts, the series futur forcast becomes negative. Since I know I am forcasting the "expected number of persons who may change their status in futur ", it can not be negative. The least value of forcast could be zero. So I am looking for some way of restricting the forcast to non negative.
Do anybody has an Idea ?
thanks in advance for your time
07-29-2016 09:00 AM - edited 07-29-2016 09:50 AM
In my opinion you will need to deal with non-negativity requirements of your forecasts in a post processing step. The statistical model will provide you with an unconstrained forecast, based on the patterns at hand, which can be negative of course.
If, like in your case, you have additional requirements about the decisions at hand, like: forecasts cannot be negative (example: sales forecasting), forecasts need to be integer (example: number of call center agents), forecasts are impacted by supply options (example: inventory control, where products come in batches), etc. you will need to deal with them in a post process.
Some post-processing can be simple, like setting forecasts to 0, others can be more elaborate: overrides in a hierarchical setup with rules about what can be changed, which boil down to an optimization problem. Sometimes this is referred to as a constrained forecast.
PS: having said all of this you may want to make sure that your model is appropriate. I looked at your data briefly, maybe an ESM approach (using a damped trend model or a seasonal model for example) will do a better job - just a Friday morning thought.
proc esm data=test plot=(forecasts);
forecast value / model=damptrend;
*assuming seasonality of 12;
proc esm data=test plot=(forecasts) seasonality=12;
forecast value / model=seasonal;
08-01-2016 01:51 PM
One thing that might guarantee non-negativity on the original scale would be to log transform your data prior to fitting the ARIMA model. You could then post process the forecast values by exponentiating, thereby ensuring that the values are positive.
The question then becomes whether the log transformed values meet the distributional assumptions for ARIMA.
08-02-2016 08:57 AM
As a point for consideration when going for a log transformation approach: given the nature of the exponential function the back-transformed forecasts could be behaving unexpectedly.