# A Statistical Approach to Discovering Process Regime Shifts and Their Determinants
## 3 Methodology
### Statistical Modeling and Testing
In this case, the minimal models presented in Equation (2a) and Equation (2b) can be rewritten as:  
\[p_{i}^{\prime}=t_{i}\alpha_{i}+\varepsilon_{i}\ \ \ \ \ (i=i_{j-1}+1,\ldots,i_{j},\ j=1, \ldots,m) \tag{4a}\] \[\log(p_{i}^{\prime})=t_{i}\alpha_{i}+\varepsilon_{i}\ \ \ \ (i=i_{j-1}+1, \ldots,i_{j},\ j=1,\ldots,m) \tag{4b}\]  
We also note that the number and locations of regime shifts are generally unknown for this scenario. Thus, all shifts need to be empirically determined. Moreover, as we are not limiting ourselves to a particular model form, a generally applicable statistical testing approach is needed that is valid for the respective assumptions applied to these models. Accordingly, we resort to the statistical procedure that tests for the unknown number of regime changes and finds their number and locations. These shift dates are then used to fit the model for stable regime segments. The key to this procedure is two statistical tests developed by [PERSON] and [PERSON] (2016); [PERSON] and [PERSON] (2016) and [PERSON] et al. (2017). The tests are quite robust in terms of assumptions on the nature and distribution of both regressors and noise. To further explain the nature of tests, we use tests developed by [PERSON] and [PERSON] (2016) that applicable to a single regime change. The first is an F-test ([PERSON] and [PERSON], 2016), in which there is only one shift assumed, though of unknown timing. The F-statistic used is:  
\[F_{i}=\frac{\varepsilon^{T}\varepsilon-\varepsilon(i)^{T}\varepsilon(i)}{ \frac{\varepsilon(i)^{T}\varepsilon(i)}{n-2k}} \tag{5}\]The test assumes an alternative hypothesized regime shift at the considered time \(i\), which uses a sequence of \(F_{i}\) statistics for any change at \(i\), i.e., \(i=n_{h},\ldots,n-n_{h}\) (\(n_{h}\geq k\)). The residuals above \(\ell(i)\) are then compared for the competing models, i.e., with and without regime segments. A certain threshold is used for rejecting the null hypothesis when the supremum of these statistics is above this threshold. We note here that the index \(h\) in the term \(n_{h}\) represents a parameter for a reasonably minimum time segment length choice, and thus, \(n_{h}\) is estimated as \(\lfloor nh\rfloor\). In other words, based on the system and process scenario, a minimum period length is defined for a shift to be considered. For the generalized case of \(m\) regimes, we use a test variant developed by [PERSON] and [PERSON] in [62] and [63]. In this case, the same evaluation is performed for \(m\) vs. \(m+1\) regime shifts. We also make use of a second generalized fluctuation testing framework. In this test, the models are fitted to the data for which residual fluctuations using a process governed by the fluctuational central limit theorem is determined [64]. Any increase in the fluctuations or the process trajectory suggests a deviation from the null hypothesis. We refer the readers to [62; 63; 64] for full details of both the procedures. As these tests confirm the presence of a regime shift, the points where shifts have occurred are to be dated, and the confidence interval is to be determined. The dates are needed to specify the segments' timeline ranges and to fit the corresponding models. Assuming an arbitrary model fit, i.e., in terms of the dates, its sum of squared residuals (\(R\)) can easily be determined as \(R(i_{1},\ldots,i_{m})=\sum_{j=1}^{m+1}r(i_{j-1}+1,i_{j})\) (\(r\) being the squared residuals sum of a regime segment). Thus, the actual regime shift dates are the ones that globally minimize the function \((\hat{i}_{1},\ldots,\hat{i}_{m})=\underset{\hat{i}_{1},\ldots,\hat{i}_{m}}{ \operatorname{argmin}}R(i_{1},\ldots,i_{m})\)[63]. Due to the computational complexity of the problem when the number of segments is large, [PERSON] and [PERSON] [63] proposed a dynamic programming method, which suggests the optimal segmentation to occur for \(R(M_{m,n})=\underset{m_{h}\leq i\leq n-n_{h}}{\operatorname{min}}[R(M_{m-1,i })+r(i+1,n)]\). They also suggested a method for finding confidence intervals.