Efficiently Detecting Trends in Customer Demand Time Series

Efficiently Detecting Trends in Customer Demand Time Series


In many business applications, time series records of customer demand can embed a long-term slowly-changing non-linear trend that is impossible to observe directly, due to the presence of spikes and cycles at daily or other intervals. The problem is further compounded when these occluding dynamics are highly non-stationary, and exhibit changes in amplitude variance that are either random or a systematic function of time. Nonetheless, it is necessary to observe the trend in order to determine whether there is an ongoing evolution towards expansion or contraction of the business activity. While it might be possible to capture that trend by fitting a smoothing polynomial, this is a tedious process because the order parameter of this function must be determined by manual inspection, and will yield spurious fluctuations if not correctly specified. This is further compounded when there are tens or hundreds of customer engagement locations, each with a distinct time series history requiring an individualized polynomial order selection before trending analysis can be performed.



During this study, AlgoTactica has investigated a highly efficient method for time series trend identification, based on the Discrete Wavelet Transform (DWT). The DWT analyzes time series histories by performing several stages of smoothing, each stage operating at a coarser scale than the previous. The coarsest stage will ultimately produce a very smooth trend which contains only the slowly evolving changes occurring over extremely long time scales. Although mathematically quite sophisticated, the DWT can be easily implemented via just a few lines of code in Python or MATLAB.  Once a user has made a singular selection of the coarsest scale to be used, the same DWT can then be applied to each member of a time series ensemble without requiring any further individualized tuning or intervention.  Here, the DWT at scale level 9 has been used to extract trending information from customer cash withdraw histories at 100 bank ATM locations during a 791-day period.



The Cash Withdrawal Volume figure at the upper right summarizes two of the ATM locations, in terms of total cash withdrawals per day. Time series histories are shown in grey along with the extracted DWT trend superimposed in red. For ATM 1 the usage trend is seen to be increasing, while ATM 2 shows an overall decreasing trend. When a first-difference operation is performed, the rate of change in the slope of these trends is more clearly revealed, as shown in the Trend Rate plots. For ATM 1 the rate is overall positive, indicating continued usage growth which gained momentum during the first half of the period, but which is slowing during the second half, as indicated by the downward trajectory of the curve. With ATM 2 the rate is consistently negative, indicating decreasing demand, however, the slight upward trajectory near the end suggests that this contraction might be slowing. These examples show that the overall state of growth can be rapidly assessed by performing a coarse scale DWT to reveal the trend, and then taking a first-difference to reveal the rate of change of the trend.

In the middle right, the Trend Rates for 25 ATM Locations figure shows a plot matrix of the growth rates obtained from differencing the DWT trend for selected machines. It is clear that this type of summary allows the viewer to very quickly assess the growth health of each ATM. For instance, in column 2, the top plot shows an ATM that had initially positive growth, but has since shown negative usage trend rates indicating contraction. The plot beneath it shows a case of initially negative growth that has since turned positive. The other plots show similar cases of growth preceding contraction or contraction preceding growth, as well as cases of relatively unchanging trends denoted by rate curves that remain close to the horizontal zero reference line.

The bottom right figure, Principal Rate Groups, further demonstrates that the trend rate lines can also ultimately be used to classify the growth health into groups. These plots show how each of the ATM trend rates, shown in grey, falls into one of four main groupings that have been detected by a Self-Organizing Map (SOM), with a red line denoting the centroid of each group.

Back to top