# Anomaly Monitoring of Process Based on Recurrent Timeliness Rules (AMP-RTR)
## 3 Design of AMP-RTR Model
### Implementation of AMP-RTR Model
#### 3.2.1 Timeliness Evaluation Process of Periodic Data  
The Recurrent Timeliness Rules (RTR) defines the attenuation function of the regularity change for periodic data timeliness in the process of data iteration and update. We effectively evaluate the timeliness of periodic data according to RTR. We assume that at the beginning of the first cycle, the score based on the Recurrent Timeliness Rules is 1. In each cycle, the timeliness score of the data decreases exponentially until the updated data of the next cycle arrives. The principle of regularity change for periodic data timeliness can be summarized as follows: first, if the data update time is equal to the set cycle, the updated timeliness evaluation value is equal to the initial timeliness evaluation value of the current cycle; second, if the time when the data are updated is earlier than the set cycle, the updated timeliness evaluation value should be greater than the initial timeliness evaluation value of the current cycle; third, if the time when the data are updated is later than the set cycle, the updated timeliness evaluation value should be less than the initial timeliness evaluation value of the current cycle. When the data update frequency is equal to a predetermined period (the error is less than one unit after removing the dimension), the updated timeliness score value is equal to the initial timeliness score value of the current period. \[f_{n+1}(t,\lambda|A)=f_{n}(t,\lambda|A) \tag{2}\]  
The \(f_{n+1}(t,\lambda|A)\) is the initial timeliness score of the next cycle after updating. \(f_{n}(t,\lambda|A)\) is the initial timeliness score of the current cycle. When the update time of data is earlier or later than the set period, the iterative update rule can be expressed by the following formula:  
\[f_{n+1}(t,\lambda|A)=f_{n}(t,\lambda|A)+\alpha\times Q_{decay}(t,\lambda\Big{|}A) \tag{3}\]  
The \(\alpha\) is the cycle update rate (it should be set reasonably, usually a relatively small value). \(Q_{decay}(t,\lambda\Big{|}A)\) is the timeliness score after attenuation at the end of this week. From Formula (3), we can see that the aging score value after attenuation in the cycle multiplied by the periodic update rate, plus the initial aging score value of the current cycle will be taken as the aging score value of the updated data. The \(Q_{decay}(t,\lambda\Big{|}A)\) value is positive when the time of data update is earlier than the set period, and negative when the time of data update is later than the set period. The highest score of data timeliness is 1. If the updated timeliness score is greater than 1, it will be reset to 1. This principle should be followed when calculating the initial score of each recurrent update of data. In each updated cycle of the data, we assume that the timeliness score of the data always decays exponentially with time. Exponential distribution is a typical life probability distribution, which has been proved to be very useful in quality management [3]. Therefore, in each update cycle, the evaluation value of data timeliness can be calculated by Formula (7). \[Q_{decay}(t,\lambda|A)=\left(1-\frac{t}{T_{life}}\right)\times\mathrm{e}^{-fall (A)*age(t,\lambda)} \tag{4}\]  
It is assumed that the law of decline of score values obey exponential decay. \(A\) is a data attribute (e.g., temperature), \(fall(A)\) indicates the decay rate of the attribute value that expires within a time cycle. For example, the value of \(fall(A)=0.2\) must be interpreted as follows: on average, \(20\%\) of the value of attribute \(A\) loses its validity over a cycle of time. \(age(t,\lambda)\) is a function of time \(t\), which indicates the time that the data may change. When \(age(t,\lambda)=0\), \(Q_{decay}(t,\lambda\Big{|}A)=1\); when \(age=T_{life}\), \(Q_{decay}(t,\lambda\Big{|}A)=0\). The definition also complies to the general principle that when the attribute will not change at all, for example, date of product code, for which \(fall(A)=0\) and \(T_{life}\longrightarrow\infty\), the \(Q_{decay}(t,\lambda|A)\) is always 1 [9].