LAG - Time Series Lag or Backshift Operator

Returns an array of cells for the (backward shifted, backshifted or lagged time series.

Syntax

LAG(X, Order, K)
X
is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)).
Order
is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).
Order Description
1 ascending (the first data point corresponds to the earliest date) (default)
0 descending (the first data point corresponds to the latest date)
K
is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.). If missing, the default value of zero is assumed.

Remarks

  1. The time series is homogeneous or equally spaced.
  2. The time series may include missing values (e.g. #N/A) at either end.
  3. k (i.e. lag order) should be non-negative and less than the size of the time series.
  4. The lagged time series is:

    $$ \left[z_t\right] = L^k\left[x_t\right] = \left[x_{t-k}\right] $$

    Where:
    • $ \left[z_t\right]$ is the lagged time series.
    • $\left[x_t\right]$ is the input time series.
    • $L$ is the lag operator.
    • $k$ is the lag order.

      $k \leq T-1 $

Examples

Example 1:

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
A B C D E
Date Data LAG LAG LAG
January 10, 2008 -0.3000 #N/A #N/A #N/A
January 11, 2008 -1.28 -0.30 #N/A #N/A
January 12, 2008 0.24 -1.28 -0.30 -0.30
January 13, 2008 1.28 0.24 -1.28 -1.28
January 14, 2008 1.20 1.28 0.24 0.24
January 15, 2008 1.73 1.20 1.28 1.28
January 16, 2008 -2.18 1.73 1.20 1.20
January 17, 2008 -0.23 -2.18 1.73 1.73
January 18, 2008 1.10 -0.23 -2.18 -2.18
January 19, 2008 -1.09 1.10 -0.23 -0.23
January 20, 2008 -0.69 -1.09 1.10 1.10
January 21, 2008 -1.69 -0.69 -1.09 -1.09
January 22, 2008 -1.85 -1.69 -0.69 -0.69
January 23, 2008 -0.98 -1.85 -1.69 -1.69
January 24, 2008 -0.77 -0.98 -1.85 -1.85
January 25, 2008 -0.30 -0.77 -0.98 -0.98
January 26, 2008 -1.28 -0.30 -0.77 -0.77
January 27, 2008 0.24 -1.28 -0.30 -0.30
January 28, 2008 1.28 0.24 -1.28 -1.28
January 29, 2008 1.20 1.28 0.24 0.24
January 30, 2008 1.73 1.20 1.28 1.28
January 31, 2008 -2.18 1.73 1.20 1.20
February 1, 2008 -0.23 -2.18 1.73 1.73
February 2, 2008 1.10 -0.23 -2.18 -2.18
February 3, 2008 -1.09 1.10 -0.23 -0.23
February 4, 2008 -0.69 -1.09 1.10 1.10
February 5, 2008 -1.69 -0.69 -1.09 -1.09
February 6, 2008 -1.85 -1.69 -0.69 -0.69
February 7, 2008 -0.98 -1.85 -1.69 -1.69

 

Files Examples

References

Comments

Article is closed for comments.

Was this article helpful?
0 out of 0 found this helpful