TD_PORTMAN Function Examples | Teradata Vantage - TD_PORTMAN 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

TD_PORTMAN Input Table AR1_VALIDATE_RESIDUALS

DataSetID RJOW_I ACTUAL_VALUE CALC_VALUE RESIDUAL
552 74 5.9 5.71374561796636 0.18625438203363998
552 76 6.8 6.448667308654891 0.35133269134510886
552 77 7.8 6.693641205551067 1.1063587944489321
552 78 7.9 7.510220861871657 0.3897791381283435
... ... ... ... ...

Example: TD_PORTMAN Call Using Box-Pierce Test

EXECUTE FUNCTION INTO VOLATILE ART(SAV_AR1_PORTMANBP)
TD_PORTMAN(
   SERIES_SPEC( TABLE_NAME(AR1_VALIDATE_RESIDUALS), SERIES_ID(DatasetID), 
      ROW_AXIS(SEQUENCE(ROW_I)),
      PAYLOAD(FIELDS(RESIDUAL), CONTENT(REAL))) WHERE DatasetID=552,
   FUNC_PARAMS( 
      MAXLAG(2), 
      TEST(BP), 
      DEGREES_FREEDOM(1), 
      SIGNIFICANCE_LEVEL(0.05)
   )
);

TD_PORTMAN Output with Box-Pierce Results

SELECT * FROM SAV_AR1_PORTMANBP;
DataSetID 552
ROW_I 0
NUM_SAMPLES 32
DEGREES_FREEDOM 2
SIGNIFICANCE_LEVEL 5.00000000000000E-002
PORTMAN_VALUE 2.74239795826440E 000
P_VALUE 9.77180304798542E-002
CHISQUARE_VALUE 3.84145882069412E 000
CRITICAL_P 5.00000000000000E-002
NULL_HYPOTH ACCEPT

Example: TD_PORTMAN Call Using Ljung-Box Test

EXECUTE FUNCTION INTO VOLATILE ART(SAV_AR1_PORTMANLJB)
TD_PORTMAN(
   SERIES_SPEC( TABLE_NAME(AR1_VALIDATE_RESIDUALS), SERIES_ID(DatasetID), ROW_AXIS            (SEQUENCE(ROW_I)), PAYLOAD(FIELDS(RESIDUAL), CONTENT(REAL))) WHERE DatasetID=552,
   FUNC_PARAMS( 
      MAXLAG(2), 
      TEST(LB), 
      DEGREES_FREEDOM(1),
      SIGNIFICANCE_LEVEL(0.05) 
   )
);

TD_PORTMAN Output with Ljung-Box Results

SELECT * FROM SAV_AR1_PORTMANLJB;
DataSetID 552
ROW_I 0
NUM_SAMPLES 32
DEGREES_FREEDOM 2
SIGNIFICANCE_LEVEL 5.00000000000000E-002
PORTMAN_VALUE 3.05484204972904E 000
P_VALUE 8.04968214748349E-002
CHISQUARE_VALUE 3.84145882069412E 000
CRITICAL_P 5.00000000000000E-002
NULL_HYPOTH ACCEPT