1.1 - 8.10 - VARMAX Example: Exogenous Model - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)

This example models the expenditure time series as a function of exogenous variables (income and investment) and the AR and MA parameters.

Input

SQL Call

SELECT * FROM VARMAX (
  ON finance_data3 AS InputTable PARTITION BY id ORDER BY period
  USING
  TargetColumns ('expenditure')
  ExogenousColumns ('income', 'investment')
  PartitionColumns ('id')
  PDQ ('1, 1, 1')
  Lag (3)
  ExogenousOrder (3)
  IncludeMean ('false')
  StepAhead (3)
) AS dt ORDER BY id;

Output

The model converges for all three decades.

 id coef               coef_value                                                                                                                            stepahead predict_expenditure 
 -- ------------------ ------------------------------------------------------------------------------------------------------------------------------------- --------- ------------------- 
  1 lag                3                                                                                                                                     NULL                     NULL
  1 exogenous_params   [[0.1519680005451124, -0.6551050387116059]],[[3.435192616763898, -3.882673202143499]],[[1.3541313678881937, 1.6646325777482736]]      NULL                     NULL
  1 bic                10.741829043275684                                                                                                                    NULL                     NULL
  1 seasonal_ar_params NULL                                                                                                                                  NULL                     NULL
  1 ar_params          [[-0.11089814304828957]]                                                                                                              NULL                     NULL
  1 iterations         52                                                                                                                                    NULL                     NULL
  1 seasonal_ma_params NULL                                                                                                                                  NULL                     NULL
  1 NULL               NULL                                                                                                                                  1             4600.7706184855
  1 period             0                                                                                                                                     NULL                     NULL
  1 ma_params          [[0.19307253407851677]]                                                                                                               NULL                     NULL
  1 aic                10.400585628684988                                                                                                                    NULL                     NULL
  1 coef               1, 1, 1, 0, 0, 0, 3                                                                                                                   NULL                     NULL
  1 sigma              [[21814.479344791267]]                                                                                                                NULL                     NULL
  1 converged          true                                                                                                                                  NULL                     NULL
  1 NULL               NULL                                                                                                                                  2           6373.998107354011
  1 NULL               NULL                                                                                                                                  3           6350.744363017893
  2 NULL               NULL                                                                                                                                  2          1687.7469213444433
  2 NULL               NULL                                                                                                                                  1           1738.714144436625
  2 period             0                                                                                                                                     NULL                     NULL
  2 converged          true                                                                                                                                  NULL                     NULL
  2 iterations         41                                                                                                                                    NULL                     NULL
  2 seasonal_ma_params NULL                                                                                                                                  NULL                     NULL
  2 ma_params          [[-0.8359845907086888]]                                                                                                               NULL                     NULL
  2 bic                11.376308711954195                                                                                                                    NULL                     NULL
  2 aic                11.035065297363499                                                                                                                    NULL                     NULL
  2 seasonal_ar_params NULL                                                                                                                                  NULL                     NULL
  2 sigma              [[41142.99197004428]]                                                                                                                 NULL                     NULL
  2 NULL               NULL                                                                                                                                  3          1741.1916880853182
  2 lag                3                                                                                                                                     NULL                     NULL
  2 exogenous_params   [[-1.2720319560315987, 3.655852449852053]],[[0.8360385941734287, -2.302383393590858]],[[0.7593553302868498, -2.374110320858793]]      NULL                     NULL
  2 ar_params          [[0.7108652352664463]]                                                                                                                NULL                     NULL
  2 coef               1, 1, 1, 0, 0, 0, 3                                                                                                                   NULL                     NULL
  3 ma_params          [[-0.0614288647351308]]                                                                                                               NULL                     NULL
  3 seasonal_ar_params NULL                                                                                                                                  NULL                     NULL
  3 seasonal_ma_params NULL                                                                                                                                  NULL                     NULL
  3 period             0                                                                                                                                     NULL                     NULL
  3 sigma              [[6.363011312881083E-13]]                                                                                                             NULL                     NULL
  3 aic                -26.62855901221182                                                                                                                    NULL                     NULL
  3 bic                -26.33918063199482                                                                                                                    NULL                     NULL
  3 iterations         100                                                                                                                                   NULL                     NULL
  3 converged          false                                                                                                                                 NULL                     NULL
  3 NULL               NULL                                                                                                                                  1          2322.3532307390687
  3 NULL               NULL                                                                                                                                  2          2383.7876893596203
  3 NULL               NULL                                                                                                                                  3           2361.660078073284
  3 lag                3                                                                                                                                     NULL                     NULL
  3 exogenous_params   [[0.25875628651307314, -0.6072084966292083]],[[-0.05294450371858871, 0.1933161164790199]],[[0.5381262647961994, -1.2967359488966945]] NULL                     NULL
  3 ar_params          [[0.18907298111234366]]                                                                                                               NULL                     NULL
  3 coef               1, 1, 1, 0, 0, 0, 3                                                                                                                   NULL                     NULL

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.