| Library: | times |
| Macro: | tdiff | |
| Description: | a difference operator for time series allow multiple differences and seaonal difference |
| Usage: | y = tdiff(x {,d [, k]}) | |
| Input: | ||
| x | vector | |
| d (optional) | integer; the difference lag x(t)-x(t-d) default d=1 | |
| k (optional) | integer; the number of differences | |
| Output: | ||
| y | vector; the differenced time series y(t)=(1-B^d)^k x(t) where BX(t)=X(t-1) | |
library("times")
x=(1:5)
y=tdiff(x,2)
y
Contents of y [1,] 2 [2,] 2 [3,] 2
| Library: | times |