# KAN-Transformer Model for UltraShort-Term Wind Power Prediction Based on EWMA Data Processing
## 2 Research Methodology and EWMA-KAN-Transformer Model
### Structure of KAN-Transformer Prediction Model Based on EWMA Data Processing
#### 2.2.1 Data Processing Method of EWMA  
When predicting future wind power, the forecast is influenced by past wind power features and multiple variable features. To improve predictions, variables such as wind speed, wind direction, and temperature are introduced alongside wind power features. However, the introduction of these multiple variable features can introduce noise, which reduces the accuracy of the model. Therefore, this paper applies the EWMA method for data smoothing on the introduced multivariable features. This method helps to suppress noise and retain data trends, making the smoothed data more reflective of actual changes.  
Taking the variable 30 m wind speed in sequence 2 as an example, the original data are plotted as shown in Figure 3.  
In Figure 3, the data show frequent fluctuations and unclear trends, which may indicate the presence of noise. The noise in serials 1-13 can reduce the model's prediction accuracy. To address this, EWMA smoothing is applied to serials 1-13. The EWMA is given using Formula (1):  
\[\left\{\begin{array}{l}\alpha=\frac{2}{span+1}\\ E_{(t)}=\alpha\times X_{(t)}+(1-\alpha)\times E_{(t-1)}\end{array}\right., \tag{1}\]  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Serial Number** & **Feature Name** \\ \hline
1 & 10 m wind speed \\
2 & 30 m wind speed \\
3 & 50 m wind speed \\
4 & 70 m wind speed \\
5 & Hub height wind speed \\
6 & 10 m wind direction \\
7 & 30 m wind direction \\
8 & 50 m wind direction \\
9 & 70 m wind direction \\
10 & Hub height wind direction \\
11 & Temperature \\
12 & Pressure \\
13 & Humidity \\
14 & Actual power generation \\ \hline \hline \end{tabular}
\end{table}
Table 1: Feature serial number and feature name.  
Figure 3: Partial data points from serial number 2.  
where _span_ is the span parameter that determines the value of \(\alpha\), \(X_{(t)}\) represents the current observation value at time \(t\), \(E_{(t-1)}\) is the exponential moving average value at the previous time point \((t-1)\), and \(E_{(t)}\) is the exponential moving average value for the current time point \(t\).  
In Formula (1), \(\alpha\) typically ranges between 0 and 1. When \(\alpha\) is larger, the smoothed sequence adapts more quickly to recent trends and fluctuations but retains less long-term trend information. Conversely, when \(\alpha\) is smaller, the smoothed sequence retains more long-term trend information but adapts more slowly to recent trends and fluctuations. For the specific implementation, using data points from serial number 2 as an example, by setting _span_ = 10 and an initial value \(E_{(t)}\), \(\alpha\) is determined. The observation value \(X_{(2)}\) is then substituted into the formula to get \(E_{(2)}\). This process is iteratively applied to achieve data smoothing, as illustrated in Figure 4.  
In Figure 4, the smoothed curve is more stable compared to that in Figure 3. By applying EWMA smoothing, noise is suppressed, and the original data trends are retained. The architecture of the EWMA data processing method is shown in Figure 5.  
In Figure 5, \(X\)(mf) represents the original dataset, where mf denotes the concatenation of the introduced multivariable feature serials and the wind power feature serial. The multivariable feature serials within mf are processed using EWMA and then concatenated with the original wind power feature serial to form the multivariable channel data MF. Through the EWMA process, the original dataset \(X\)(mf) is transformed into a new dataset \(X_{1}\)(MF).