# A Novel Method of Local Anode Effect Prediction for Large Aluminum Reduction Cell
## 3 Anode Rod Sequence Fluctuation Detection Algorithm Based on Sliding Window
### Fluctuation Monitoring of Current Sequence  
To better monitor the fluctuation of the current sequence, the classification monitoring is performed by setting the distance radius threshold of the slope confidence interval to determine whether the time series produces fluctuations, and let the distance radius \(d_{j}\) of the slope confidence interval of the \(j\)-th sub-time window current sequence \(Y_{j}\) be:  
\[d_{j}=\frac{\left|\overline{\theta}_{j}-\underline{\theta}_{j}\right|}{2} \tag{3}\]  
\[\overline{\theta}_{j}=\overline{s}_{j}+\frac{\sigma_{j}}{\sqrt{l}}Z_{\frac{ \alpha}{2}} \tag{4}\]  
\[\underline{\theta}_{j}=\overline{s}_{j}-\frac{\sigma_{j}}{\sqrt{l}}Z_{\frac{ \alpha}{2}} \tag{5}\]  
where, \(\overline{\theta}_{j}\) is the upper confidence limit; \(\underline{\theta}_{j}\) is the lower confidence limit. \(\overline{s}_{j}\) is the mean slope of the current sequence of the \(j\)-th sub-time window; \(\sigma_{j}\) is the mean square deviation of the current sequence slope of the \(j\)-th sub-time window; \(Z\) is the standard normal distribution; \(\alpha\) is the confidence level, which is used to improve or reduce the sensitivity of the confidence interval. After obtaining its confidence interval radius, the fluctuation threshold is set to \(\beta\) according to the historical current fluctuation. If \(d_{j}>\beta\), the current sequence of sub-time window is judged to fluctuate, and the serial number \(j\) of the fluctuating sub-time window is output. In order to further improve the detection rate, the density difference between the array matrix \(X_{i}(m,K_{mean},c)\) and ten adjacent sliding windows (select the first five and the last five of the current windows) is compared. If there are more densities similar to this current sequence, the smaller the probability of its generation fluctuations. The array density  
Figure 3: Principle of current sequence sliding window. of sliding windows and the distance between different sliding windows are somewhat correlated. For example, the time window object \(X_{1}\) and \(X_{2}\) define its distance as:  
\[d(X_{1},X_{2})=\sqrt{\frac{\left(m_{1}-m_{2}\right)^{2}+\left(K_{mean1}-K_{mean2 }\right)^{2}+\left(c_{1}-c_{2}\right)^{2}}{3}} \tag{6}\]  
Then the fluctuation monitoring algorithm process is:  
STEP1: Select ten sliding windows;  
STEP2: For the sliding window, the attainable density \(lrd_{k}(X)\) is calculated according to Equation (7):  
\[lrd_{k}(X)=\frac{|N_{k}(X)|}{\sum_{o\in N_{k}(X)}reachist(X,o)} \tag{7}\]  
where, \(|N_{k}(X)|\) is the number of sub time series in the neighborhood of the \(k\)-th distance of sub window object \(X\) (expressed as \(k\)-\(distance(X)\), where \(distance(X)\) is calculated by Formula (8)), \(N_{k}(X)\) is the set of sub-time window objects in the neighborhood of the \(k\)-th distance of sub-time window object \(X\), and \(o\) is an element of it. The \(k\)-th distance neighborhood is defined as the set of objects whose distance between the selected sample space and object \(X\) is less than or equal to \(k\)-\(distance(X)\). \(reachist(X,o)=max\{k\)-\(distance(o),\|X-o\|\}\) is the maximum value of the \(k\)-th distance of sub-time window \(o\) and the distance between sub-time window object \(o\) and sub-time window object \(X\). STEP3: Calculate the ratio \(LOF_{k}(X_{i})\) of the mean value of reachable density of the ten neighboring sub-time-window objects \(X\) to the local reachable density of object \(X_{i}\) as shown in Formula (8):  
\[LOF_{k}(X_{i})=\frac{\frac{1}{|N_{k}(X_{i})|}\frac{|\sum_{o\in N_{k}(X_{i})} lrd_{k}(X_{i})}{lrd_{k}(X_{i})}}{ \tag{8}\]  
STEP4: The calculated results are compared with 1. The closer the reachable density ratio is to 1, the closer the density is, the more stable the current sequence remains; and the greater the calculation result is than 1, the greater the difference between it and the mean of the attainable density of the time window of the nearest neighbor, and the stronger the fluctuation of the current sequence.