TD_ARIMAESTIMATE Function Examples | Teradata Vantage - TD_ARIMAESTIMATE Examples - Teradata Vantage

Database Unbounded Array Framework Time Series Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
ncd1634149624743.ditamap
dita:ditavalPath
ruu1634160136230.ditaval
dita:id
ncd1634149624743

Example: TD_ARIMAESTIMATE Call

EXECUTE FUNCTION
INTO VOLATILE ART(ARMA_ART_MLE_SEASON_12)
TD_ARIMAESTIMATE(
   SERIES_SPEC(TABLE_NAME(diff12_souv), ROW_AXIS(SEQUENCE(ROW_I)), 
      SERIES_ID(seriesID AS SID), PAYLOAD(FIELDS(OUT_OUT_sales), CONTENT(REAL)) ),
   FUNC_PARAMS(NONSEASONAL(MODEL_ORDER(2,0,1)), 
      CONSTANT(0), ALGORITHM(MLE), COEFF_STATS(1),
      FIT_METRICS(1), RESIDUALS(1), FIT_PERCENTAGE(80) )
);

TD_ARIMAESTIMATE Primary Layer Output

SELECT statement to display the coefficients for seriesID=33.

SELECT CAST(SID AS INTEGER), 
   CAST(ROW_I AS INTEGER),
   CAST(COEFF_NAME AS VARCHAR(8)),
   CAST(COEFF_VALUE AS FORMAT 'ZZ9.99999999'), 
   CAST(STD_ERROR AS FORMAT 'ZZ9.99999999'),
   CAST(ZSTAT_VALUE AS FORMAT 'ZZ9.99999999'), 
   CAST(ZSTAT_PROB AS FORMAT 'ZZ9.99999999')
FROM ARMA_ART_MLE_SEASON_12;

SID ROW_I COEFF_NAME COEFF_VALUE STD_ERROR ZSTAT_VALUE ZSTAT_PROB
----------- ----------- ---------- ------------ ------------ ------------ ------------
39 0 A R 1 0.19601793 0.21787644 0.89967474 0.36829337
33 0 A R 1 0.19601793 0.21787644 0.89967474 0.36829337
39 1 A R 2 0.09018679 0.18132494 0.49737666 0.61892346
33 1 A R 2 0.09018679 0.18132494 0.49737666 0.61892346
39 2 M A 1 0.81732402 0.16482276 4.95880570 0.00000071
33 2 M A 1 0.81732402 0.16482276 4.95880570 0.00000071

Example: TD_ARIMAESTIMATE Call for Secondary Layer to Show FIT_METRICS

SELECT *
FROM ( EXECUTE FUNCTION
TD_EXTRACT_RESULTS(ART_SPEC(TABLE_NAME(ARMA_ART_MLE_SEASON_12),
LAYER(ARTFITMETADATA) ))) AS T WHERE SID=33;

TD_ARIMAESTIMATE Secondary Layer Output

SID 33
ROW_I 0
NUM_SAMPLES 56
VAR_COUNT 3
R_SQUARE 2.61005587661601E-001
R_ADJ_SQUARE 2.33119006063925E-001
STD_ERROR 8.38233469363019E 006
STD_ERROR_DF 54
ME 3.44967425853012E 002
MAE 2.07434342577093E 003
MSE 8.08296559742912E 006
MPE 4.04683408908351E 001
MAPE 1.75003395872541E 002
FSTAT_CALC 9.35954042080790E 000
P_VALUE 3.30362388809736E-004
NUM_DF 2
DENOM_DF 53
SIGNIFICANCE_LEVEL 5.00000000000000E-002
F_CRITICAL 3.17162594803767E 000
F_CRITICAL_P 5.00000000000000E-002
NULL_HYPOTH REJECT

Example: TD_ARIMAESTIMATE Call for Tertiary Layer with RESIDUALS

EXECUTE FUNCTION INTO VOLATILE ART(myart)
TD_EXTRACT_RESULTS(ART_SPEC(TABLE_NAME(ARMA_ART_MLE_SEASON_12),
    LAYER(ARTFITRESIDUALS) ));

TD_ARIMAESTIMATE Output for Tertiary Layer

SELECT TOP 10 * FROM myart WHERE SID=33 ;
SID ROW_I ACTUAL_VALUE CALC_VALUE RESIDUAL
----------- -------------------- ---------------------- ---------------------- ----------------------
33 0 1.96571000000000E 003 2.99137755341759E 002 1.66657224465824E 003
33 1 1.58372000000000E 003 -6.98125149074582E 002 2.28184514907458E 003
33 2 -3.12569000000000E 003 -1.33315924587870E 003 -1.79253075412130E 003
33 3 8.89180000000000E 002 9.39518294770247E 002 -5.03382947702465E 001
33 4 -9.11320000000000E 002 -8.02341618924278E 001 -8.31085838107572E 002
33 5 5.92910000000000E 002 5.70736047004858E 002 2.21739529951419E 001
33 6 -6.43700000000001E 002 1.17834822240643E 001 -6.55483482224065E 002
33 7 -7.11199999999999E 002 4.54489661429011E 002 -1.16568966142901E 003
33 8 -1.06299000000000E 003 7.45975653468051E 002 -1.80896565346805E 003
33 9 5.58786000000000E 003 1.21012724441833E 003 4.37773275558166E 003