Click or drag to resize
Difference Class
Differences a seasonal or nonseasonal time series.
Inheritance Hierarchy
SystemObject
  Imsl.StatDifference

Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
[SerializableAttribute]
public class Difference

The Difference type exposes the following members.

Constructors
  NameDescription
Public methodDifference
Constructor for Difference.
Top
Methods
  NameDescription
Public methodCompute
Computes a Difference series.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExcludeFirst
Excludes observations lost due to differencing.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetOrders
Sets the orders for the Difference object.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyObservationsLost
Returns the number of observations lost because of differencing the time series. Note that the Compute method must be invoked first before invoking this method. Otherwise, the return value is 0.
Top
Remarks

Class Difference performs m = periods.Length successive backward differences of period s_i = {\rm {periods}} [i - 1] and order d_i = {\rm {orders}} [i - 1] \,\, {\rm{for}} \,\, i = 1, \dots, m on the n = z.Length observations \left\{ Z_t \right\} \,\, {\rm{for}} \,\, t = 1, 2, \dots, n.

Consider the backward shift operator B given by

B^kZ_t = Z_{t-k}

for all k. Then, the backward difference operator with period s is defined by the following:

\Delta _s Z_t  = \left( {1 - B^s } \right)Z_t 
            = Z_t  - Z_{t - s} \,\,\,\,\,\,{\rm{for}}\,s \ge 0

Note that B_sZ_t and \Delta_sZ_t are defined only for t = (s + 1), \dots, n. Repeated differencing with period s is simply

\Delta _s^d Z_t  = \left( {1 - B^s } \right)^d 
            Z_t  = \sum\limits_{j = 0}^d {\frac{{d!}}{{j!\left( {d - j} \right)!}}} 
            \left( { - 1} \right)^j B^{sj} Z_t

where d \ge 0 is the order of differencing. Note that

 \Delta _s^d Z_t

is defined only for t = (sd + 1), \dots, n.

The general difference formula used in the class Difference is given by

W_T = \left\{ \begin{array}{ll} \rm{NaN} & 
            {\rm for}\,\, t = 1, \ldots, n_L  \\ \Delta _{s_1 }^{d_1 } 
            \Delta _{s_2 }^{d2} \ldots \Delta _{s_m }^{d_m } Z_t & {\rm for}\,\, 
            t = n_L  + 1,\ldots, n \end{array} \right.

where n_L represents the number of observations "lost" because of differencing and NaN represents the missing value code. Note that

n_L  = \sum\limits_j {s_j d_j }

A homogeneous, stationary time series can be arrived at by appropriately differencing a homogeneous, nonstationary time series (Box and Jenkins 1976, p. 85). Preliminary application of an appropriate transformation followed by differencing of a series can enable model identification and parameter estimation in the class of homogeneous stationary autoregressive moving average models.

See Also