|
JMSLTM Numerical Library 5.0.1 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.imsl.stat.Difference
public class Difference
Differences a seasonal or nonseasonal time series.
Class Difference performs m = periods.length
successive backward differences of period
and order
on the n =
z.length observations
.
Consider the backward shift operator B given by
![]()
for all k. Then, the backward difference operator with period s is defined by the following:
![]()
Note that
and
are defined only for
. Repeated
differencing with period s is simply
![]()
where
is the order of differencing. Note that
![]()
is defined only for
.
The general difference formula used in the class Difference
is given by
![]()
where
represents the number of observations
"lost" because of differencing and NaN represents the missing value code.
Note that
![]()
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.
| Constructor Summary | |
|---|---|
Difference()
Constructor for Difference. |
|
| Method Summary | |
|---|---|
double[] |
compute(double[] z,
int[] periods)
Computes a Difference series. |
void |
excludeFirst(boolean exclude)
If set to true, the observations lost due to differencing will be excluded. |
int |
getObservationsLost()
Returns the number of observations lost because of differencing the time series. |
void |
setOrders(int[] orders)
Sets the orders for the Difference object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Difference()
Difference.
| Method Detail |
|---|
public final double[] compute(double[] z,
int[] periods)
throws IllegalArgumentException
z - a double array containing the time series.periods - an int array containing the periods at which
z is to be differenced.
double array containing the differenced series.
IllegalArgumentExceptionpublic void excludeFirst(boolean exclude)
exclude - a boolean specifying whether or not to exclude
lost observations due to differencing.public int getObservationsLost()
compute method must be invoked
first before invoking this method. Otherwise, the return value is
0.
int containing the number of observations
lost because of differencing the time series z.public void setOrders(int[] orders)
orders - an int array of length equal to length of periods,
containing the order of each difference given in periods. The elements of orders
must be greater than or equal to 0.
|
JMSLTM Numerical Library 5.0.1 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||