dataFrame.column.stat — autoCorr()

Description

The autoCorr() method of the stat object computes the autocorrelation of the values in the selected column.

Signature

dataFrame.column(columnName).stat.autoCorr({ lag: 1 })
Scope
column
Family
stat
Returns
number

Arguments

columnName (string)
The name of the column from which to calculate statistics.
options (object)
Autocorrelation options.

Option

lag (number)
The number of positions by which values are shifted before computing the correlation. (Default: 1.)

Returns

stat (number)
The autocorrelation coefficient.

Notes

  • A value close to  1 indicates a strong positive autocorrelation.
  • A value close to -1 indicates a strong negative autocorrelation.
  • A value close to  0 indicates little or no autocorrelation.

Example

// perform the autocorrelation test
var stat = dataFrame.column('revenue').stat.autoCorr({ lag: 7 });

// log the test stat
notebook.log(stat);