Example 24.4 Searching for Historical Analogies

This example illustrates how to search for historical analogies by using seasonal sliding similarity analysis of transactional
time-stamped data. The SASHELP.TIMEDATA data set contains the variable (VOLUME), which represents activity over time. The following statements create an example data set that contains two time series
of differing lengths, where the variable HISTORY represents the historical activity and RECENT represents the more recent activity:

The goal of seasonal sliding similarity measures is to find the seasonal slide index that corresponds to the most similar
seasonal subsequence of the input series when compared to the target sequence. The following statements perform similarity
analysis on the example data set with seasonal sliding:

The DATA=TIMEDATA option specifies that the input data set WORK.TIMEDATA be used in the analysis. The OUT=_NULL_ option specifies that no output time series data set is to be created. The OUTSEQUENCE=SEQUENCES
and OUTSUM=SUMMARY options specify the output sequences and summary data sets, respectively. The ID statement specifies that
the time ID variable is DATETIME, which is to be accumulated on a daily basis (INTERVAL=DTDAY) by summing the transactions (ACCUMULATE=TOTAL). The ID statement
also specifies that the data is accumulated on the weekly boundaries starting on the week of 27JUL1997 and ending on the week
of 15OCT2000 (START=’27JUL1997:00:00:00’DT END=’21OCT2000:11:59:59’DT). The INPUT statement specifies that the input variable
is HISTORY, which is to be normalized using absolute normalization (NORMALIZE=ABSOLUTE). The TARGET statement specifies that the target
variable is RECENT, which is to be normalized by using absolute normalization (NORMALIZE=ABSOLUTE) and that the similarity measure be computed
by using mean absolute deviation (MEASURE=MABSDEV). The SLIDE=SEASON options specifies season index sliding.

To illustrate the results of the similarity analysis, the output sequence data set must be subset by using the output summary
data set.