Have a Question?
Phone: +1 (888) 427-9486
+1 (312) 324-0367
Fax: +1 (312) 238-9092
Contact Us
LAG
Returns an array of cells for the back-shifted/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 of the data series (i.e. whether the first data point corresponds to the earliest or latest 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 one is assumed.
Remarks
- The time series is homogeneous or equally spaced.
- The time series may include missing values (e.g. #N/A) at either end.
- k (i.e. lag order) should be non-negative and less than the size of the time series.
- The lagged time series is:
![\[<br />
\left[z_t\right] = L^k\left[x_t\right] = \left[x_{t-k}\right]<br />
\]](/sites/all/files/tex/64b8c2d0aa0719d4fc973044b4d15b95ccd54c33.png)
Where:
-
is the lagged time series.
-
is the input time series.
-
is the lag operatori.
-
is the lag order.
-
Examples
Example 1:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Date | Data | |||
| 2 | January 10, 2008 | -0.3000 | #N/A | #N/A | #N/A |
| 3 | January 11, 2008 | -1.28 | -0.30 | #N/A | #N/A |
| 4 | January 12, 2008 | 0.24 | -1.28 | -0.30 | -0.30 |
| 5 | January 13, 2008 | 1.28 | 0.24 | -1.28 | -1.28 |
| 6 | January 14, 2008 | 1.20 | 1.28 | 0.24 | 0.24 |
| 7 | January 15, 2008 | 1.73 | 1.20 | 1.28 | 1.28 |
| 8 | January 16, 2008 | -2.18 | 1.73 | 1.20 | 1.20 |
| 9 | January 17, 2008 | -0.23 | -2.18 | 1.73 | 1.73 |
| 10 | January 18, 2008 | 1.10 | -0.23 | -2.18 | -2.18 |
| 11 | January 19, 2008 | -1.09 | 1.10 | -0.23 | -0.23 |
| 12 | January 20, 2008 | -0.69 | -1.09 | 1.10 | 1.10 |
| 13 | January 21, 2008 | -1.69 | -0.69 | -1.09 | -1.09 |
| 14 | January 22, 2008 | -1.85 | -1.69 | -0.69 | -0.69 |
| 15 | January 23, 2008 | -0.98 | -1.85 | -1.69 | -1.69 |
| 16 | January 24, 2008 | -0.77 | -0.98 | -1.85 | -1.85 |
| 17 | January 25, 2008 | -0.30 | -0.77 | -0.98 | -0.98 |
| 18 | January 26, 2008 | -1.28 | -0.30 | -0.77 | -0.77 |
| 19 | January 27, 2008 | 0.24 | -1.28 | -0.30 | -0.30 |
| 20 | January 28, 2008 | 1.28 | 0.24 | -1.28 | -1.28 |
| 21 | January 29, 2008 | 1.20 | 1.28 | 0.24 | 0.24 |
| 22 | January 30, 2008 | 1.73 | 1.20 | 1.28 | 1.28 |
| 23 | January 31, 2008 | -2.18 | 1.73 | 1.20 | 1.20 |
| 24 | February 1, 2008 | -0.23 | -2.18 | 1.73 | 1.73 |
| 25 | February 2, 2008 | 1.10 | -0.23 | -2.18 | -2.18 |
| 26 | February 3, 2008 | -1.09 | 1.10 | -0.23 | -0.23 |
| 27 | February 4, 2008 | -0.69 | -1.09 | 1.10 | 1.10 |
| 28 | February 5, 2008 | -1.69 | -0.69 | -1.09 | -1.09 |
| 29 | February 6, 2008 | -1.85 | -1.69 | -0.69 | -0.69 |
| 30 | February 7, 2008 | -0.98 | -1.85 | -1.69 | -1.69 |
References
- Hamilton, J .D.; Time Series Analysis
, Princeton University Press (1994), ISBN 0-691-04289-6 - Tsay, Ruey S.; Analysis of Financial Time Series
John Wiley & SONS. (2005), ISBN 0-471-690740
