Returns a NumericalVariable whose observations are moved ahead by
the specified number of observations.
Namespace: Extreme.Statistics
Assembly: Extreme.Numerics (Extreme.Numerics)
Syntax
| Visual Basic (Declaration) |
|---|
Public Function GetLag ( _ lag As Integer _ ) As NumericalVariable |
| C# |
|---|
public NumericalVariable GetLag ( int lag ) |
| C++ |
|---|
public: NumericalVariable^ GetLag ( int lag ) |
Parameters
- lag (System.Int32)
- The number of observations to shift the series by.
Return Value
A NumericalVariable.
Remarks
A positive value of lag indicates that the observations are shifted forward.
If lag equals 1, then each new observation is the observation before the current observation.
The first lag observations are set to NaN.
If lag equals -1, then each new observation is the observation after the current observation.
The last abs(lag) observations are set to NaN.
The name of the new variable depends on whether lag is positive or negative. If lag is positive, the new variable gets the name lag<n>(<name>), where <n> is the lag and <name> is the name of the original variable. If lag is positive, the new variable gets the name lead<abs(n)>(<name>).