FIRST_DIFF Name
FIRST_DIFF
Purpose
This function returns the first difference vector of the input.
Category
Time Series Analysis
Calling Sequence
Result = FIRST_DIFF( Vect )
Inputs
Vect: A vector of type integer or floating point.
Keyword Parameters
BACKWARD: Forces calculation of the backward difference. This
is the default.
FORWARD: Forces calculation of the forward difference. The
default is the backward difference.
CENTRED: Forces calculation of the centred difference. The
defalut is the backward difference.
Outputs
Result: Returns the first difference of the input vector.
Procedure
The function calculates the first difference of the values in
the input vector. Note that it cycles around and includes the
difference between the first and last elements.
Example
Define a vector.
x = [1,2,3]
Calculate the forward first differenc of x.
result = first_diff( x )
Modification History
Written by: Daithi A. Stone, 2000-06-27.
Modified: Daithi A. Stone, 2000-07-06 (removed
LENGTH.pro).
Modified: Daithi A. Stone, 2000-07-10 (removed for loops).