Lag Column

Copies column values from preceding rows into the current row. The node can be used to
  1. make a copy of the selected column and shift the cells I steps up (I = lag interval)
  2. make L copies of the selected column and shift the cells of each copy 1, 2, 3, ... L-1 steps up (L = lag = number of copies)

The option "Number of copies" (L) in this node is useful for time series prediction. If the rows are sorted in time increasing order, to apply a lag D to the selected column means to place D-1 past values of the column and the current value of the column on one row. The data table can then be used for time series prediction.

The lag interval option I (periodicity or seasonality) in this node is useful to compare values from the past to the current values. Again if the rows are sorted in time increasing order, to apply a lag interval I means to set aside on the same row the current value and the value occurring I steps before.

L and I can be combined to obtain L-1 copies of the selected column, each one shifted I, 2*I, 3*I, ... (L-1)*I steps backwards.

Options

Column to lag
The column to be lagged.
Lag per copy
I = lag interval (sometimes also called periodicity or seasonality), defines how many rows to shift per column copy.
Number of copies
L = defines how many lagged column copies to create.
Drop incomplete rows at the top of the table
If selected, the first rows from the input table are omitted in the output so that the lag output column(s) is not missing (unless the reference data is missing).
Drop incomplete rows at the bottom of the table
If selected, the rows containing the lagged values of the last real data row are omitted (no artificial new rows). Otherwise new rows are added, which contain missing values in all columns but the new lag output.

Input Ports

Icon
Input data

Output Ports

Icon
Input data with additional columns copying the values from preceding rows.

Popular Predecessors

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.