{'fraction_non_alphanumeric': 0.027163158841518258, 'fraction_numerical': 0.012892006955687475, 'mean_word_length': 4.437887186175415, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Online Detection Of Supply Chain Network Disruptions Using Sequential Change-Point Detection for Hawkes Processes

In this paper, we attempt to detect an inflection or change-point resulting from the Covid-19 pandemic on supply chain data received from a large furniture company. To accomplish this, we utilize a modified CUSUM (Cumulative Sum) procedure on the company's spatial-temporal order data as well as a GLR (Generalized Likelihood Ratio) based method. We model the order data using the Hawkes Process Network, a multi-dimensional self and mutually exciting point process, by discretizing the spatial data and treating each order as an event that has a corresponding node and time. We apply the methodologies on the company's most ordered item on a national scale and perform a deep dive into a single state. Because the item was ordered infrequently in the state compared to the nation, this approach allows us to show efficacy upon different degrees of data sparsity. Furthermore, it showcases use potential across differing levels of spatial detail.


Introduction
Covid-19 caused wide sweeping changes in society and affected all of the elements of our lives from the way we work to the way we socialize. As such, it created new needs, and it is logical to question whether supply chains were affected as people looked for new products to satisfy those needs. Such a question is normally extremely difficult to answer because of the lack of publicly available, up to date, and robust supply chain data. We, however, are in the fortunate position of having access to some of the proprietary data of a large furniture company that operates internationally. We choose to model the network of orders as a point process because the relative scarcity of the data limits the use of some traditional time series models (e.g. auto-regressive process). Specifically, we use a Hawkes process network, a type of point process which is mutually and self exciting, where each node represents a territorial region such as a state or county depending on the level of analysis. The rationale behind the use of the Hawkes process is that it has an element that accounts for a triggering influence of past events on future ones. For example, if a customer buys an item of furniture and likes it, it is possible that she recommends it to a friend.
To detect change-points resulting from Covid-19, we apply two methods: a modified CUSUM (Cumulative Sum) procedure proposed by (Wang et al. 2022) and the window-limited GLR (Generalized Likelihood Ratio) based procedure discussed in (Li et al. 2017a). The two method serves different scenarios. When we have a reasonable estimate of the form of the inflection, CUSUM is computation efficient and has better performance. The GLR on the other hand can deal with completely unexpected anomaly types.
To our knowledge, this is the first attempt at using sequential change-point detection algorithms on real supply chain data in a peer-reviewed setting. As such, it serves as a proof of concept and a potential framework for others who wish to try a similar task. We believe the use of the Hawkes process network could be applicable to many other supply chain situations given a similar triggering effect would be present. Additionally, we show that the modified CUSUM method is not only effective in simulation, but in a real life case.

Literature Review
The Hawkes process was proposed in (Hawkes 1971) and has since become popular for use in modeling situations where there is a clear triggering effect. For example, it has been used in modeling for seismology in (Ogata 1998) as an earthquake is generally followed by aftershocks. It has also been used to model biological neural networks in (Reynaud-Bouret, Rivoirard, and Tuleau-Malot 2013) as the firing of other neurons has an impact on the firing other neurons in the network. Other applications include stock price (Embrechts, Liniger, and Lin 2011), crime events (Mohler 2013), social media activities (Rizoiu et al. 2017).
However, there has been far less work done on changepoint detection for the Hawkes process. In addition, the majority of the work that has been done has explored offline change-point detection which references the entire time series and do not work in real time. For example, (Rambaldi, Filimonov, and Lillo 2016) develops a procedure for financial data to find the times when bursts in the intensity of the Hawkes process begin. However in our paper, we seek to detect change-points in real time as quickly as possible using an online method. In terms of such work, (Li et al. 2017b) examines the use of the GLR (Generalized Likelihood Ratio) test for Hawkes processes in situations in which the post-change parameters were not known. (Wang et al. 2022) develops a memory efficient modified CUSUM implementation that gives less consideration to events in the far past. This algorithm is further explained in the Background Sec-tion. The previously mentioned GLR and modified CUSUM algorithms are two tests we use on our supply chain data.

Background and Problem Formulation
In this section we describe the Hawkes process model on networks as well as the change-point detection problem, and how the two detecting procedures are applied to the furniture sales data.

Hawkes Process
The Hawkes process is one kind of point process, which models the probability of events happening in continuous time. It can be characterized by the intensity function λ : R + → R + , where at each time t ≥ 0 the intensity λ(t) is the probability that a new event happens in the infinitesimal near future, An example is the Poisson process, where the intensity function is a constant, λ(t) = µ, ∀t ≥ 0. In the Hawkes process, the intensity λ(t) is decided by the history. Let 0 < t 1 < t 2 < t 3 < . . . be the events occurrence times. Let H t be the set of event occurrence times up to and including time t, and N t be counting process, i.e. the number of events in H t . The Hawkes process captures the triggering effect between events by letting where µ > 0 is the background intensity, ϕ is a non-negative kernel function describing how the influence of an event is distributed into the future. A common choice is ϕ(t) = β exp(−βt) for some β. α ≥ 0 is the magnitude of the triggering effect. The integral over the counting measure N t is equivalent to taking the summation over past event times.
Hawkes process with marks. The Hawkes process can be generalized to fit events data with marks to capture the triggering effect acted through information other than temporal relationship. In our setup, each event i is an order placed online by individual customers, with the occurrence time t i and the shipping address u i discretized into states or zip codes. Then the orders can be treated as event data on a network, where each node is one location. For each pair of nodes with index i and j, we consider the triggering effect α ij from i to j when the two geographical locations are adjacent. Then for each node i, the intensity function λ i (t) at this location is here D is the size of the network, µ i > 0, N i t is the background intensity and counting process on node i. The kernel function ϕ is exponential.

Change-point Detection
We look to detect an abrupt change in the parameters i,j=1 as quickly as possible. The problem can be formu-lated as follows: Here κ is the unknown change-point. Then we carry out a repeated test to decide whether there has been a changepoint. The pre-change model is learnt using historical data, including the decay rate β in the kernel function ϕ. The post- sometimes represent an unexpected anomaly and thus are treated as unknown. In correspondence to whether or not the post-change parameters are known or can be estimated, we apply the CUSUM and GLR procedure described in the following paragraphs.
CUSUM (Wang et al. 2022). When the post-change parameters can be estimated accurately, CUSUM is a computational and memory efficient detecting procedure which also enjoys asymptotic optimality in performance. Similar with the traditional i.i.d. case, here the CUSUM statistic over the dynamic Hawkes network is where ν,t is the log-likelihood ratio up to time t between H 1 and H 0 as if ν is the true change-point, where λ i,ν (t) is the intensity at node i as if ν is the true change-point, and we use infinity for the case under H 0 . The procedure raises an alarm when the statistic S CUSUM t exceeds some pre-determined threshold (same with GLR). With a proper truncation on the kernel function ϕ, the CUSUM statistic can be computed recursively with high precision. Also the integral can be replaced with the sum over past events to avoid numerical evaluation because we know the closed form expression of t 0 ϕ(τ )dτ for every t. GLR (Li et al. 2017a). When the post-change parameters are unknown, we can compute the generalized likelihood ratio in a sliding window to reflect the difference between the current data and the pre-change model. For a properly chosen window length w that we believe is long enough to successfully capture the change and yet not too large which results in a large detection delay, the GLR statistic is where t−w,t,µ 1 ,A1 is the log-likelihood ratio up to time t as if t − w is the true change-point, are the post-change parameters. For each t, t−w,t,µ 1 ,A1 is convex in µ 1 , A 1 , and the supremum can be found using the Expectation-Maximization (EM) algorithm. The merit of the GLR procedure is it can detect an unexpected and unknown change, while also gives the estimated post-change parameters when it raises an alarm.

Experimental Setup
In each of the experiments, we use the March 2018 to March 2019 data to train the pre-change parameters of the Hawkes network using the likelihood function. To verify the effectiveness of the change-point detection procedures, we would expect the statistics S CUSUM t , S GLR t to remain small until roughly March 2020 when the WHO declared Covid-19 a global pandemic (Katella 2021), and raise significantly after that. The decay rate 1/β = 5 days in the kernel function ϕ is found manually since the likelihood ratio is non-convex over β, and the pre-change parameters are the maximum likelihood estimates (MLE). For the GLR, we design a window length w = 100 days based on life experiences. For the CUSUM, the post-change parameter µ 1 can be set to 2µ 0 or 0.5µ 0 to detect a change in average demand. If it is desired to detect a local change in the demand correlation, we can design the post-change A 1 to have vanishing edges especially for large states such as California/Texas/Florida/Pennsylvania. We believe more meaningful post-change parameters can be designed with a better understanding of the reasons behind the average demand and spatial correlation.

Work Desk -United States
We analyze the sales of a specific work desk which is the mostly commonly ordered item in the company on the national level. We group the addresses into the 50 states and Washington DC for the purpose of creating nodes in the Hawkes process. There is an average of 40 orders per day over the 50 states and Washington DC. You can see from Figure 1, there is a drastic jump in orders between the start and end of March 2020.
(c) (d) Figure 1: A mapping of the number of orders in each state for a week, for the weeks of (a) 2020-02-23, (b) 2020-04-12

Detection with GLR
As can be seen from Figure 2(a), the GLR score spikes after March of 2020 in a way that it never does between March of 2019 and March of 2020. As shown in Figure 3(a) which displays the fitted pre-change Hawkes process model, there exists a very strong causal effect between states, especially from the more populated states to their neighboring ones. Additionally we can see in Figure 3(b) which models the fitted post-change Hawkes process that when the detecting procedure raises an alarm at the beginning of Covid, the most salient change in the fitted model is in the magnitude of the background intensities (represented as node sizes), as well as the disappearing influence from California to its neighboring states.

Detection with CUSUM
We tested both possible post-change parameter for µ 1 , 2µ 0 and 0.5µ 0 . As shown in Figure 2 (b), we were able to successfully capture the disruption in the distribution of orders caused by Covid-19 by doubling µ 0 . Given the jump in demand in April 2020 that can be observed in Figure 1, it would make sense in hindsight to attempt to detect a surge in demand. The spike in CUSUM after March 2020 is clearly visible and greatly differs in magnitude in comparison to any of the smaller spikes preceding it. CUSUM appears to contain slightly less noise but both the CUSUM and GLR are very comparable in this situation. For CUSUM, we don't perform an analysis of pre-change vs post-change parameters as post-change parameters are predetermined.

Work Desk-California
For experimentation with finer granularity, we isolate the subset of the orders that came from California. We then group the addresses into the 54 counties that exist in the state for which we have data to use for the Hawkes Process nodes.
There is an average of 3.5 orders a day, meaning the data is more sparse than the national level orders. The counties with the biggest increase in orders are all in the densely populated Southern part of the state as can be seen from Figure 4.
(a) (b) Figure 4: A mapping of the number of orders in each county in California for the weeks of (a) 2020-02-23, (b) 2020-04-12

Detection with GLR
As can be noted in Figure 5 (a), GLR spikes post March 2020 in a way that exceeds the previous apex of the GLR score. However, this spike is not extreme in magnitude when compared to the spikes that came between March 2019 and March 2020, or to the relative magnitude of the post March 2020 spike that we saw in the GLR score of the national case. There are some interesting patterns in the pre-change fitted Hawkes process displayed in Figure 6(a). Several of the counties in the middle part of California have small populations but still exhibit some influence on surrounding counties possibly because of how close the residents of those counties are in proximity. In the South, we see stronger influences from more populous counties. Moving to Figure 6(b), we see major shifts in inter-county influences in Southern California.

Detection with CUSUM
We again test the possible post-change parameters design and ended up finding success in setting the post-change µ 1 = 2µ 0 . The CUSUM model is then successfully able to detect the surge in demand as can be observed in Figure 5 score after the beginning of Covid while the preceding year is relatively flat. In such a way, the change point is far more clearly defined in the CUSUM model than the GLR model.

Discussion
Sequential change-point detection is a valuable tool for monitoring inflections in temporal data. This is the first time it has been applied to real supply chain data in peer reviewed literature. There are several novel features regarding the techniques used. Firstly, we show that the Hawkes Process can successfully be used to model a specific supply chain network. This has evident implications for other situations in which there is a clear triggering effect and data sparsity precludes the use of other traditional methods. Secondly, we show that the GLR and CUSUM procedure can be successfully applied to online detection of changepoints in the supply chain. Both methodologies were able to successfully detect surges in demand as they were happening. However, CUSUM performed far better than GLR in the case of California and exhibited far less noise. This may have been because the specification of reasonable post change parameters prior to running the CUSUM algorithm.
There are obviously however several limitations to the approach that we used. Firstly, under regular conditions, it is not an easy task to verify the change points that have been detected. The algorithm detects a signal but it may be difficult to understand what that signal corresponds to. Additionally, a limitation of the CUSUM algorithm in particular is that it requires post-change parameter specification. This presents challenges in situations where post change parameters are difficult to predict. In future work, it would be interesting to apply change-point detection on other tiers of supply chain data. For example the furniture company also makes sales to downstream sellers such as Amazon and Wayfair. Such orders comes in batches and happen less frequently than sales made to individual buyers, which makes the fitting and change-point detection potentially harder.