## 3 The Method Presented in This Paper
### Wind Power Forecasting During Cold Wave Events  
The Ns-Transformer model is an enhanced version of the Transformer model designed to address the challenges of unstable time series forecasting [39]. This model retains the standard encoder-decoder architecture of the original Transformer used for time series forecasting. To overcome the issue of over-stabilization when directly stabilizing the data, the Non-Stationary Transformer replaces the standard self-attention module with a de-stationary attention module, thereby improving the model's forecasting performance on non-stationary sequences. The Ns-Transformer model primarily consists of a series stationarization and a de-stabilization attention module. Figure 8 illustrates the structure of the Ns-Transformer model.  
\(x\) is the input matrix, \(x\prime\) is the matrix obtained after the normalization of \(x\), and \(\mu_{x},\sigma_{x}\) is the mean and standard deviation of \(x\). \(\mathcal{H}\) is the module, including the embedding layer, encoder and decoder, \(Q\), \(K\) and \(V\) are three matrices of the same size obtained by smoothing  
Figure 8: Non-Stationary Transformer model structure.  
Figure 7: The optimization process of the duration and continuity of cold wave.  
the input characteristic variables, \(G\) is the matrix obtained after the \(\mathcal{H}\) module, \(y\) is the matrix of \(y\prime\) after de-normalization, and \(\tau,\Delta\) is the destabilization factor.  
Series stationarization primarily consists of the standardization and de-standardization modules. To mitigate the non-stationarity of each input sequence, the temporal dimension is normalized using an \(x\) sliding window approach. Each input matrix \(x\) is transformed through translation and scaling operations to produce \(xt\). The expression for the normalization module is as follows:  
\[\mu_{x}=\frac{1}{k}\sum_{c=1}^{k}x_{c} \tag{8}\]  
\[\sigma_{x}=\frac{1}{k}\sum_{c=1}^{k}\left(x_{c}-\mu_{x}\right)^{2} \tag{9}\]  
\[x_{h}t=\frac{1}{\sqrt{\sigma_{x}}}(x_{c}-\mu_{x}) \tag{10}\]  
where \(k\) represents the total number of samples of \(x\), \(\sigma_{x}\) is the variance in \(x\), \(x_{c}\) is the value of the fixed column in \(x\), and \(x_{h}t\) is the value of the fixed column in \(xt\).  
After passing through the \(\mathcal{H}\) module to obtain \(y\), the de-normalization module uses the information of \(\mu_{x}\) and \(\sigma_{x}\) recorded during normalization to map the model's output back to \(y\), recovering the information lost during normalization. The expression of the de-normalized module is as follows:  
\[y\prime=H(x\prime) \tag{11}\]  
\[y=\sigma_{x}(y\prime+\mu_{x}) \tag{12}\]  
In order to learn attention directly from the time series before stationarity, the disappeared non-stationary information was reintroduced into the calculation of the non-stationary sequence, and the non-stationary factors \(\tau\) and \(\Delta\) were learned from statistics \(\mu_{x}\) and \(\sigma_{x}\) of the non-stationary \(x\) through the Multilayer Perceptron module. The non-stationary attention module can enhance the predictability of the stationary sequence while preserving the inherent time dependencies of the original sequence, as expressed below.  
\[M(Q,K,V,\tau,\Delta)=Softmax(\frac{\tau QK^{\mathrm{T}}+\Delta^{\mathrm{T}}}{ \sqrt{e}})V \tag{13}\]  
\(M\) is the attention function; \(e\) is the input dimension.  
The Softmax function operates on the scaled attention score matrix to generate a normalized attention weight matrix. Each row of this weight matrix corresponds to a query position, with element values constrained within the interval (0,1) and normalized to sum to unity across each row. This probabilistic formulation enables the weighted aggregation of the value matrix V, dynamically capturing long-range dependencies within the sequence while establishing a rigorous probabilistic foundation for subsequent feature integration.