public class TimeSeriesClassFilter extends Object implements Serializable
TimeSeriesClassFilter can be used with a data array,
to compute a new data array, z, containing lagged
When using the method
computeLags, the output array, z
of lagged columns,
can be symbolically represented as:
where x(i) is a lagged column of the incoming data array
x, and nLags is the number of computed lags. The lag associated with x(i) is equal to the value in
lag[i], and lagging is done within the nominal categories given in
iClass. This requires the time series data in
xbe sorted in time order within each category
Consider an example in which the number of observations in
is 10. There are two lags requested in
then, all the time series data fall into a single category, i.e.
nClasses= 1, and z would contain 2 columns and 10 rows. The first column reproduces the values in
lags=0, and the second column is the 2nd lag because
On the other hand, if the data were organized into two classes with
nClassesis 2, and z is still a 2 by 10 matrix, but with the following values:
The first 5 rows of z are the lagged columns for the first category, and the last five are the lagged columns for the second category.
|Constructor and Description|
|Modifier and Type||Method and Description|
Computes lags of an array sorted first by class designations and then descending chronological order.
public TimeSeriesClassFilter(int nClasses)
intspecifying the number of nominal categories associated with the time series.
public double computeLags(int lags, int iClass, double x)
intarray containing the requested lags. Every lag must be non-negative.
intarray containing class number associated with each element of
x, sorted in ascending order. The i-th element is equal to the class associated with the i-th element of
xmust be the same length.
doublearray containing the time series data to be lagged. This array is assumed to be sorted first by class designations and then descending chronological order, i.e., most recent observations appear first within a class.
doublematrix containing the lagged data. The i-th column of this array is the lagged values of
xfor a lag equal to
lags[i]. The number of rows is equal to the length of
Copyright © 1970-2015 Rogue Wave Software
Built October 13 2015.