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 })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
1indicates a strong positive autocorrelation. - A value close to
-1indicates a strong negative autocorrelation. - A value close to
0indicates 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);