# Time Series Prediction Based on Adaptive Weight Online Sequential Extreme Learning Machine
## 3 The Proposed Adaptive Weight Online Sequential Extreme Learning Machine
### Formula Derivation  
The assessed weight of the data chunk at time \(k\) is \(\lambda_{k}\), then \(\beta_{k+1}^{\prime}\) is the least squares solution of the following equation:  
\[\left[ \begin{array}{c}\lambda_{0}\mathbf{H}_{0}\\ \lambda_{1}\mathbf{h}_{1}\\ \vdots\\ \lambda_{k+1}\mathbf{h}_{k+1}\end{array} \right]\mathbf{\beta}^{\prime}= \left[ \begin{array}{c}\lambda_{0}\mathbf{T}_{0}\\ \lambda_{1}\mathbf{t}_{1}^{T}\\ \vdots\\ \lambda_{k+1}\mathbf{t}_{k+1}^{T}\end{array} \right] \tag{19}\]  
\[\text{Let }\mathbf{H}_{k+1}^{\prime}:=\left[ \begin{array}{c}\mathbf{H}_{k}^{ \prime}\\ \lambda_{k+1}\mathbf{h}_{k+1}\end{array} \right]\mathbf{,H}_{0}^{\prime}:= \lambda_{0}\mathbf{H}_{0}\text{, }\mathbf{T}_{k+1}^{\prime}:=\left[ \begin{array}{c}\mathbf{T}_{k}^{\prime}\\ \lambda_{k+1}\mathbf{t}_{k+1}^{T}\end{array} \right]\mathbf{,T}_{0}^{\prime}:= \lambda_{0}\mathbf{T}_{0}\text{, then Equation (19) can be described in a compact way as:  
\[\mathbf{H}_{k+1}^{\prime}\mathbf{\beta}^{\prime}=\mathbf{T}_{k+1}^{\prime} \tag{20}\]  
**Theorem 1**. : _The solution of Equation (20) in the sense of least squares is able to be obtained in an iterative way as follows:_  
Figure 1: Block diagram of the adaptive weight online sequential extreme learning machine (AWOS-ELM) algorithm. \[ \begin{array}{l}\boldsymbol{\beta}_{k+1}^{\prime}=\boldsymbol{\beta}_{k}^{\prime}+ \mathbf{K}_{k+1}\big{(}\mathbf{t}_{k+1}-\mathbf{h}_{k+1}\boldsymbol{\beta}_{k}^ {\prime}\big{)}\\ \mathbf{P}_{k+1}^{\prime}=(I-\mathbf{K}_{k+1}\mathbf{h}_{k+1})\mathbf{P}_{k}^ {\prime}\end{array}  \tag{21}\]  
\[ \begin{array}{l}\mathbf{K}_{k+1}=\mathbf{P}_{k}^{\prime}\mathbf{h}_{k+1} \Bigg{(}\frac{I}{\lambda_{k+1}^{2}}+\mathbf{h}_{k+1}\mathbf{P}_{k}^{\prime} \mathbf{h}_{k+1}^{T}\Bigg{)}^{-1}\end{array}  \tag{23}\]  
_where \(\mathbf{P}_{k}^{\prime}:=\left(\mathbf{H}_{k}^{\prime T}\mathbf{H}_{k}^{\prime }\right)^{-1}\), \(\boldsymbol{\beta}_{k}^{\prime}=\mathbf{P}_{k}^{\prime}\mathbf{H}_{k}^{\prime T }\mathbf{T}_{k}^{\prime}\)._  
**Proof. ** According to the definition of \(\mathbf{P}_{k}^{\prime},\mathbf{P}_{k+1}^{\prime}\) can be found as follows:  
\[\mathbf{P}_{k+1}^{\prime}=\left(\left[ \begin{array}{c}\mathbf{H}_{k}^{ \prime}\\ \lambda_{k+1}\mathbf{h}_{k+1}\end{array} \right]^{T}\left[ \begin{array}{c} \mathbf{H}_{k}^{\prime}\\ \lambda_{k+1}\mathbf{h}_{k+1}\end{array} \right]\right)^{-1}=\left(\mathbf{H}_{ k}^{\prime T}\mathbf{H}_{k}^{\prime}+\lambda_{k+1}^{2}\mathbf{h}_{k+1}^{T} \mathbf{h}_{k+1}\right)^{-1} \tag{24}\]  
Apply the Sherman-Morrison-Woodbury formula [23] into Equation (24), and then \(\mathbf{P}_{k+1}^{\prime}\) can be determined iteratively as follows:  
\[ \begin{array}{lcl}\mathbf{P}_{k+1}^{\prime}&=&\mathbf{P}_{k}^{\prime}- \mathbf{P}_{k}^{\prime}\mathbf{h}_{k+1}^{T}\Bigg{(}\frac{I}{\lambda_{k+1}^{2} }+\mathbf{h}_{k+1}\mathbf{P}_{k}^{\prime}\mathbf{h}_{k+1}^{T}\Bigg{)}^{-1} \mathbf{h}_{k+1}\mathbf{P}_{k}^{\prime}\\ &=&\mathbf{P}_{k}^{\prime}-\mathbf{K}_{k+1}\mathbf{h}_{k+1}\mathbf{P}_{k}^{ \prime}\end{array}  \tag{25}\]  
According to Equation (25) and \(\boldsymbol{\beta}_{k+1}^{\prime}=\mathbf{P}_{k+1}^{\prime}\mathbf{H}_{k+1}^{ \prime T}\mathbf{T}_{k+1}^{\prime}\), the output matrix \(\boldsymbol{\beta}_{k+1}^{\prime}\) can be obtained from the following equation:  
\[