Phone: +1 (888) 4279486
+1 (312) 2573777
Contact Us
DIFF
Returns an array of cells for the differenced time series (i.e. (1L^S)^D).
Syntax
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 seasonal difference order (e.g. K=0 (no lag^{i}), S=1 (1st lag), etc.) If missing, the default value of one is assumed.
D
is the number of repeated differencing (e.g. d=0 (none), d=1 (difference once), 2= (difference twice), etc.). If missing, the default value of one is assumed.
Remarks
 In short, the difference operator subtracts the time series values from the lagged version of itself a number of times
 The difference operator (DIFF) is defined as follow :
Where:
 is the differenced time series.
 is the input time series.
 is the lag/backshift operator.
 is the seasonality length.
 is the difference order.
 The size of the output differenced time series is equal to the input time series, but with the first observations are set to missing (i.e. #N/A).

The seasonal difference order (i.e. k) must be nonnegative and smaller than the time series size (i.e. T).
 The input time series is homogenous and equally spaced.
 The time series may include missing values (e.g. #N/A) at either end.
Examples
Example 1:
A  B  C  

1  Date  Data  
2  January 10, 2008  0.30  #N/A 
3  January 11, 2008  1.28  0.98 
4  January 12, 2008  0.24  1.52 
5  January 13, 2008  1.28  1.04 
6  January 14, 2008  1.20  0.08 
7  January 15, 2008  1.73  0.53 
8  January 16, 2008  2.18  3.91 
9  January 17, 2008  0.23  1.95 
10  January 18, 2008  1.10  1.33 
11  January 19, 2008  1.09  2.19 
12  January 20, 2008  0.69  0.40 
13  January 21, 2008  1.69  1.00 
14  January 22, 2008  1.85  0.16 
15  January 23, 2008  0.98  0.87 
16  January 24, 2008  0.77  0.21 
17  January 25, 2008  0.30  0.47 
18  January 26, 2008  1.28  0.98 
19  January 27, 2008  0.24  1.52 
20  January 28, 2008  1.28  1.04 
21  January 29, 2008  1.20  0.08 
22  January 30, 2008  1.73  0.53 
23  January 31, 2008  2.18  3.91 
24  February 1, 2008  0.23  1.95 
25  February 2, 2008  1.10  1.33 
26  February 3, 2008  1.09  2.19 
27  February 4, 2008  0.69  0.40 
28  February 5, 2008  1.69  1.00 
29  February 6, 2008  1.85  0.16 
30  February 7, 2008  0.98  0.87 
Files Examples
References
 Hamilton, J .D.; Time Series Analysis , Princeton University Press (1994), ISBN 0691042896
 Tsay, Ruey S.; Analysis of Financial Time Series John Wiley & SONS. (2005), ISBN 0471690740