TD_Histogram Syntax Elements - Teradata® Database

Database Analytic Functions

Product
Teradata® Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
Teradata_Vantage™___Advanced_SQL_Engine_Analytic_Functions.withLogo_upload_July2021/wnd1589838592459.ditamap
dita:ditavalPath
Teradata_Vantage™___Advanced_SQL_Engine_Analytic_Functions.withLogo_upload_July2021/ayr1485454803741.ditaval
dita:id
B035-1206
lifecycle
previous
Product Category
Teradata Vantage™
MethodType
Specify the method for calculating the frequency distribution of the data set:
Available Methods Description
Sturges Algorithm for calculating bin width, w:

w = r/(1 + log2 n)

where:

w = bin width

r = data value range

n = number of elements in data set

Sturges algorithm performs best if data is normally distributed and n is at least 30.

Scott Algorithm for calculating bin width, w:

w = 3.49s/(n 1/3)

where:

w = bin width

s = standard deviation of data values

n = number of elements in data set

r = data value range

Number of bins: r/w

Scott algorithm performs best on normally distributed data.

Variable-Width

Requires MinMax table, which specifies the minimum value and the maximum value of the bin in column1 and column2 respectively, and the label of the bin in column3.

Maximum number of bins cannot exceed 3500.

Equal-Width

Requires MinMax table, which specifies the minimum value of the bins in column1 and the maximum value of the bins in column2.

Algorithm for calculating bin width, w:

w = (max - min)/k

where:

min = minimum value of the bins

max = maximum value of the bins

k = number of intervals into which algorithm divides data set

Interval boundaries: min+w, min+2w, …, min+(k-1)w

TargetColumn
Specify the name of the InputTable column that contains the data set.
NBins
[Required with methods Variable-Width and Equal-Width, otherwise ignored.] Specify the number of bins (number of data value ranges).
Inclusion
[Optional] Specify where to put data points that are on bin boundaries—in the bin to the left of the boundary or the bin to the right of boundary.
Default: left