TD_SMOOTHMA Syntax Elements - 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
SERIES_SPEC
The SERIES_SPEC references an input source containing univariate or multivariate series instances.

See Series Specifications.

FUNC_PARAMS
Name Data Type Description
MA Enum, String The type of moving average algorithm to use. Options are as follows:
  • CUMULATIVE: Cumulative moving average.
  • MEAN: Simple Moving Average with the parameters WINDOW, ONE_SIDED, PAD, WELL_KNOWN, WEIGHTS.
  • MEDIAN: Simple moving median with the parameters WINDOW, PAD.
  • EXPONENTIAL: Exponential moving average with the parameter LAMBDA.
WINDOW Integer [Dependencies: Only used and required with MA("MEAN") and MA("MEDIAN")] The order (window size) of the moving average to be applied. Odd numbers use the Simple Moving Average formula. Even numbers use the Centered Moving Average formula. For example, WINDOW(6) with MA(MEAN) uses the Centered Moving average algorithm.
ONE_SIDED Integer [Dependencies: Only used optionally with MA("MEAN") .] The indicator for centering. The value 0 means use centering. The value 1 means do not use centering. The default is 0. The last WINDOW entries are averaged to form the current entry. The default is 0.
LAMBDA FLOAT [Dependencies: Only used and required with MA("EXPONENTIAL").] A value between 0 and 1, which represents the degree of weighting decrease. A higher LAMBDA has the effect of discounting older observations faster.
PAD FLOAT [Dependencies: Only used and required with MA("MEAN") and MA("MEDIAN").] The produced output series has the magnitudes set to PAD value for an element less than WINDOW. For example, PAD(4.5) applies a pad value of 4.5 for a series less than WINDOW.
WEIGHTS FLOAT [Dependencies: Only used optionally with MA("MEAN").] The list of weights to be applied when calculating the moving average. The weights must sum up to 1, and be symmetric. If the weights don’t sum up to 1, then the sum from the list of weights divides each element in the list to get a fraction for each element to achieve the same effect of the sum up to 1. The number of elements in the WEIGHTS list must match the WINDOW value. TD_SMOOTHMA uses the number of the WEIGHTS element as the default WINDOW value if it is not specified.
WELL_KNOWN Enum, String [Dependencies: Only used and required with SMA.] One of the supported well-known weighted MA combinations to be applied to the input series. WELL_KNOWN and WEIGHTS must be used in a mutually exclusive fashion. WELL_KNOWN is only applicable to SMA.
If WINDOW is not specified, then the function provides the value as follows:
  • For 3MA, , 3X3MA, and H5MA, WINDOW value is 5.
  • For 3X5MA, WINDOW value is 7.
  • For H9MA, WINDOW value is 9.
  • For 2X12MA, and H13MA, WINDOW value is 13.
  • For S15MA, WINDOW value is 15.
  • For S21MA, WINDOW value is 21.
  • For H23MA, WINDOW value is 23.
INPUT_FMT
No INPUT_FMT options are available for this function.
OUTPUT_FMT
[Optional] The INDEX_STYLE of the output format. Options are NUMERICAL_SEQUENCE or FLOW_THROUGH. The default is NUMERICAL_SEQUENCE.