5.2 Feature indices
Time series X:
X= [x1,x2,…,xn]
Feature indices are atomic features characterizing time series trends. While countless mathematical methods exist, we apply Occam’s Razor principle—prefer simplicity when possible. The method here extends the derived series calculation introduced earlier, differing only in the calculation interval. Derived series are calculated in real-time scenarios, using only the i-th element xi and the data X[-k]i from the preceding interval. Detecting curve shapes, however, is to identify specific shapes from historical data. Therefore, feature indices can be computed using data both before and after xi, specifically within the element interval X[-k,k]i. This allows for a more accurate representation of the i-th element’s state.
1. Main line
Detecting specific shapes relies on the curve’s trend, which is represented by the main line - a concept we are already familiar with. Shape detection typically uses historical data, employing a least-squares fitting method to calculate the main line M.
M=Fm(X,K)
Where Fm(…) is the function that fits the main line, and K is the equilibrium coefficient for fitting the main line.
The smoothness of the main line should vary with the length of the observed time series. For example, if the time series interval is 1 second, an hour-level main line should be smoother than a minute-level one, with a correspondingly larger K. The equilibrium coefficient K and the length of the observed time series K’ have the following basic relationship:
K=2*4log(K’/15,2)-1
K’ is referred to as the observation level, and it can correspond to the length of the time series.
1. Rise/Fall index
The Rise/Fall index is the difference between two values on the main line, represented by the symbol L:
li=mi+k-mi-k
Where mi+k is the value of the k-th element after the i-th element on the main line M, and mi-k is the value of the k-th element before the i-th element on M. The index is calculated based on the main line, and the value of k is typically less than the equilibrium coefficient K of the main line.
2. Amplitude index
The amplitude index represents the fluctuation range within a certain interval, denoted by Va.
The fluctuation curve Wv is the difference between the original value and the main line:
Wv=X–M
vai=Fw(Wv[-k,k]i)
Where Fw(…) is the fluctuation amplitude function.
3. Amplitude Rise/Fall index
The amplitude rise/fall index is the rise/fall index of the amplitude index’s main line, denoted by VaL:
VaM=Fm(Va,K)
vali=vami+k-vami-k
Where VaM is the main line of the amplitude index, vami+k is the value of the k-th element after the i-th element on VaM, and vami-k is the value of the k-th element before the i-th element on VaM.
4. Frequency index
The frequency index represents the fluctuation frequency within a certain interval, denoted by Vf:
The fluctuation curve Wv is the difference between the original value and the main line:
Wv=X–M
vfi=Ff(Wv[-k,k]i)
Where Ff(…) is the fluctuation frequency function.
5. Frequency rise/fall index
The frequency rise/fall index is the rise/fall index of the frequency index’s main line, denoted by VfL:
VfM=Fm(Vf,K)
vfli=vfmi+k-vfmi-k
Where VfM is the main line of the frequency index, vfmi+k is the value of the k-th element after the i-th element on VfM, and vfmi-k is the value of the k-th element before the i-th element on VfM.
Within the same task, these feature indices can share a single parameter k, which is related to the observation level K’. When K’ is very large, k should also increase accordingly, approximately in direct proportion. Therefore, once K’ is set, k is also known. Based on experience, the multiple relationship between the two is approximately 40. That is:
k=K’/40
These feature indices are like the basic shapes of building blocks. Let’s look at the instructions for using these “basic shapes”:
No. | Feature index | Description |
---|---|---|
1 | Rise/Fall index (L) | Greater than 0: curve increases; Less than 0: curve falls; Close to 0: curve is stable. |
2 | Amplitude index (Va) | The larger Va, the greater the curve’s fluctuation amplitude. |
3 | Amplitude Rise/Fall index (VaL) | Greater than 0: amplitude increases; Less than 0: amplitude decreases; Close to 0: amplitude remains unchanged. |
4 | Frequency index (Vf) | The larger Vf, the higher the curve’s fluctuation frequency. |
5 | Frequency Rise/Fall index (VfL) | Greater than 0: frequency increases; Less than 0: frequency decreases; Close to 0: frequency remains unchanged. |
SPL Official Website 👉 https://www.esproc.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProcSPL
SPL Learning Material 👉 https://c.esproc.com
SPL Source Code and Package 👉 https://github.com/SPLWare/esProc
Discord 👉 https://discord.gg/sxd59A8F2W
Youtube 👉 https://www.youtube.com/@esProc_SPL