public class TimeSeriesClassFilterEx1 extends Object
Applies a time series filter to a classification variable.
The variable has the values 1, 2,..., 10 corresponding to one of 2 classes.
The values 1-4 are associated with class 1, and the values 5-10 are associated with
class 2. These values represent two separate time series, one for each class.
The time index for each series is provided in the array time
.
Listed in chronologically ascending order, starting with time = T0, the
values would be:
Class 1: T0=4, T1=3, T2=2, T3=1
Class 2: T0=10, T1=9, T2=8, T3=7, T4=6, T5=5
This example requests lag calculations for lags 0, 1, 2, 3. For lag = 0, no
lagging is performed. For lag=1, the value at time = \(t\) is replaced with the
value at time = \(t-1\), the previous value in that class. If \(t-1 \lt
0\), then a missing value is placed in that position.
For the time series values of Class 1 (lag = 1), these values are:
Class 1, lag 1: T0=NaN, T1=4, T2=3, T3=2
The second lag for time = \(t\) consists of the values at time = \(t-2\):
Class 1, lag 2: T0=NaN, T1=NaN, T2=4, T3=3
Notice that the second lag now has two missing observations. In general, lag = \(n\) will have n missing values. In some cases this can result in all missing values for classes with few observations. A class will have all missing values in any of its lag columns that have a lag value larger than or equal to the number of observations in that class.
Constructor and Description |
---|
TimeSeriesClassFilterEx1() |
public static void main(String[] args)
Copyright © 2020 Rogue Wave Software. All rights reserved.