TD_​LINEAR_​REGR

the simple linear regression function, TD_LINEAR_REGR, which takes a FORMULA, and a multivariate series, containing two payload fields, as inputs – the first field representing the response variable and the second representing the explanatory variable; and produces, a primary result set consisting of an ordered listed of solved coefficients. In addition to the primary result set produced by this function, this function is also capable of producing of several additional 'optional result sets' - one containing statistical modelling metadata and the other containing residual data sets.

Options

ALGORITHM
Implementation method name. A value of 'QR' , ALGORITHM (QR), means that QR decomposition is to be employed. A value of 'PSI', ALGORITHM (PSI), means that pseudo-inverse based on SVD is to be used to solve the regression.
COEFF_STATS
A zero (0) or one (1) integer value. A flag indicating that the optional coefficient statistical columns (STD_ERROR, TSTAT_VALUE, TSTAT_PROB, SIGNIF_RATING, CONF_INT_LOW, CONF_INT_HIGH) are being requests. See the RETURNS TABLE section below, in particular the Primary Result Set, to acquire more information on the extra columns returned. So COEFF_STATS(0), the default, means no stats are requested, whereas COEFF_STATS(1) means that stats are being requested.
CONF_INT_LEVEL
A positive float between 0 and 1 exclusive. Only valid when COEFF_STATS(1).This is the confidence interval level value used for coefficient statistics calculation. Default value: 0.9.
FORMULA
A Teradata formula string that defines the formula that is to be used in the regression operation. As an example consider: FORMULA(Y = c + a*x1+ b*(exp(x1)*cos(x1))); in which Y is the response variable; x1 is the explanatory variable; and, a, b, and c are the coefficients that the regression is to determine. Note: The name of the response variable must always be Y; and, the name of the explanatory variable must always be X1. User is free to name the coefficients whatever they wish.
MODEL_STATS
A zero (0) or one (1) integer value. A flag indicating that the optional model statistics are to be generated, and made available for retrieval via the TD_EXTRACT_RESULTS function. See the RETURNS TABLE section below, in particular the Secondary Model Statistics Result Set, to acquire more information on the extra columns returned. So MODEL_STATS(0), the default, means no stats are requested, whereas MODEL_STATS(1) means that stats are being requested.
RESIDUALS
A zero (0) or one (1) integer value. A flag indicating that the optional residual statistics are to be generated, and made available for retrieval via the TD_EXTRACT_RESULTS function. See the RETURNS TABLE section below, in particular the Tertiary Residuals Result Set, to acquire more information on the extra columns returned. So RESIDUALS(0), the default, means no stats are requested, whereas RESIDUALS(1) means that stats are being requested.
Output Schema
Output Schema, if Volatile is true then use user login as the schema.
Output Table
Output Table
VAL Location
VAL Location
Volatile
Specifies whether the table should be a VOLATILE table. If true, then the table is automatically deleted, otherwise it is users responsibility to remove or clean it up for space.
VARIABLES_COUNT
An optional parameter indicating how many parameters are present in the payload. For simple linear regression with no weighting, there are just 2 parameters in the payload: the first being the response variable and the second being the explanatory variable. With weighting there are 3 variables: the first being the response variable, the second being the explanatory variable, and the third being the weights.
WEIGHTS
A zero (0) or one (1) integer value. A flag indicating that a third series is present in the <multivar-series-specification>. The third series is to be interpreted as a series of weights that can be used to perform a weighted least squares regression solution.

Input Ports

Icon
Connection to a Teradata Database Instance
Icon
This function takes one logical multivariate series containing a two or three field payload – the first payload field reference represents the response variable; the second payload field reference represents the explanatory variable, and the optional third field, if present, is the “weight” series

Output Ports

Icon
output of TD_LINEAR_REGR

Nodes

Extensions

Links