Skip to Content
0

SAP PAL ARIMA

Feb 22 at 10:03 AM

70

avatar image

Hi experts,

In ARIMA Time series algorithm of PAL library(Prediction in HANA DB) , the input table is restricted to only 2 fields .One time stamp and a field to be forecasted.

So in my scenario i need more factors to be considered while prediction.

For eg:In my table i have

1.Timestamp

2.Sales

3.cars under warranty

4.Claims

I need to predict claims based on 'sales' and 'cars under warranty' How can i acheive through ARIMA or Auto Arima is should i consider any other other PAL algorithms for this scenario??

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
avatar image
Former Member
Feb 22 at 01:03 PM
0

Hi, PAL ARIMA and Auto-ARIMA supports external factors (ARIMAX). Please see the manual for example. I list one below:

SET SCHEMA DM_PAL;

DROP TABLE PAL_ARIMA_DATA_TBL;
CREATE COLUMN TABLE PAL_ARIMA_DATA_TBL (
    "TIMESTAMP" INTEGER,
    "Y" DOUBLE,
    "X" DOUBLE
    );
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(1, 1.2, 0.8);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(2, 1.34845613096197, 1.2);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(3, 1.32261090809898, 1.34845613096197);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(4, 1.38095306748554, 1.32261090809898);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(5, 1.54066648969168, 1.38095306748554);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(6, 1.50920806756785, 1.54066648969168);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(7, 1.48461408893443, 1.50920806756785);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(8, 1.43784887380224, 1.48461408893443);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(9, 1.64251548718992, 1.43784887380224);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(10, 1.74292337447476, 1.64251548718992);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(11, 1.91137546943257, 1.74292337447476);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(12, 2.07735796176367, 1.91137546943257);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(13, 2.01741246166924, 2.07735796176367);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(14, 1.87176938196573, 2.01741246166924);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(15, 1.83354723357744, 1.87176938196573);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(16, 1.66104978144571, 1.83354723357744);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(17, 1.65115984070812, 1.66104978144571);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(18, 1.69470966154593, 1.65115984070812);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(19, 1.70459802935728, 1.69470966154593);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(20, 1.61246059980916, 1.70459802935728);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(21, 1.53949706614636, 1.61246059980916);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(22, 1.59231354902055, 1.53949706614636);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(23, 1.81741927705578, 1.59231354902055);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(24, 1.80224252773564, 1.81741927705578);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(25, 1.81881576781466, 1.80224252773564);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(26, 1.78089755157948, 1.81881576781466);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(27, 1.61473635574416, 1.78089755157948);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(28, 1.42002147867225, 1.61473635574416);
INSERT INTO PAL_ARIMA_DATA_TBL VALUES(29, 1.49971641345022, 1.42002147867225);

DROP TABLE #PAL_PARAMETER_TBL;
CREATE LOCAL TEMPORARY COLUMN TABLE #PAL_PARAMETER_TBL ("NAME" VARCHAR (50),"INT_VALUE" INTEGER,"DOUBLE_VALUE" DOUBLE,"STRING_VALUE" VARCHAR (100));
INSERT INTO #PAL_PARAMETER_TBL VALUES ('P', 1, NULL, NULL);
INSERT INTO #PAL_PARAMETER_TBL VALUES ('Q', 1, NULL, NULL);
INSERT INTO #PAL_PARAMETER_TBL VALUES ('D', 0, NULL, NULL);
INSERT INTO #PAL_PARAMETER_TBL VALUES ('METHOD', 1, NULL, NULL);
INSERT INTO #PAL_PARAMETER_TBL VALUES ('DEPENDENT_VARIABLE', NULL, NULL, 'Y');

DROP TABLE PAL_ARIMA_MODEL_TBL;  -- for the forecast followed
CREATE COLUMN TABLE PAL_ARIMA_MODEL_TBL ("KEY" NVARCHAR(100), "VALUE" NVARCHAR(5000));

CALL _SYS_AFL.PAL_ARIMA(PAL_ARIMA_DATA_TBL, "#PAL_PARAMETER_TBL", PAL_ARIMA_MODEL_TBL, ?) WITH OVERVIEW;
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Even tried ARIMAX too..But it is not allowing more than 3 fields and i have 4 here.

0
Neeraja Neithyar Feb 23 at 07:19 AM
0

Former Member,

Should the ARIMAX Model and the forecast table contain the same input field in the input table??

In the ARMAX forecast proc syntax,i noticed its a seperate external table we need to provide.

CALL <schema_name>.<procedure_name>(<strong><external input table></strong>, <model table>, <parameter table>, <output table>) with overview;

So i created 2 tables with same fields is that the right approach?? but i am getting an error (screen shot attached)

So my doubts are:

1.ARIMAX 'Model' and the 'Forecast' table should contain the same input field ??

2.or should we pass only the field to be predicted to the 'Forecast' procedure input table

In the example they gave 3 fields in the 'Model' and 2 fields(only Time stamp & Xreg) in 'forecast'

My scenario is i need to predict 'Claims' based on 'Sales' and 'UW'

arimax-model.png arimax-forecast.png error.png


arimax-model.png (53.6 kB)
error.png (10.7 kB)
Share
10 |10000 characters needed characters left characters exceeded
Antoine CHABERT
Feb 22 at 10:28 AM
0

Hello, that's a scenario you can achieve using SAP Predictive Analytics automated time series provided you know or can estimate the values of Sales & car under warranty in the future, for the temporal horizon of claims you want to predict. Kind regards Antoine

Share
10 |10000 characters needed characters left characters exceeded
Antoine CHABERT
Feb 22 at 10:58 AM
0

Looping Former Member for the PAL side of things. Kind regards Antoine

Share
10 |10000 characters needed characters left characters exceeded