# Management of Distributed Renewable Energy Resources with the Help of a Wireless Sensor Network
## 3 System Description
### Kernel Recursive Least Square Model  
The KRLS handles the nonlinear issues as a nonlinear online prediction model by depicting samples from the actual space to the high-dimensional space using the kernel functions [64]. It adapts and dynamically updates the model depending on time series data, lowering model complexity and computation time. Since its inception, it has become a popular approach for online prediction due to its natural recursive shape, being an extension of the traditional RLS algorithm via the kernel method [65]. The ARMAX model is used in this work to represent the prediction linearly. \[y_{k}=\sum_{x=1}^{x_{0}}\delta_{x}y_{(k-x)}+\sum_{z=1}^{z_{z}}\alpha_{z}u_{(k -z)}+\varrho\cdot 1+\sigma_{k} \tag{9}\]  
where \(y_{k}\) represents the measured signal and \(u\) represents the desired response; \(\delta_{x}\), \(\alpha_{z}\), and \(\varrho\) are unidentified coefficients that have to be recursively estimated; and \(x_{0}\) and \(z_{o}\), are the input and output orders of the system, respectively. The following is a simplified vector representation of Equation (9):  
\[y_{k}=\alpha_{k}^{T}\beta_{k}+\gamma_{k} \tag{10}\]The variables \(\alpha\wedge\beta\) are defined in Equations (11) and (12). \(\alpha\) contains the previous sample points, \(\beta\) contains the values of model parameters, and \(\gamma_{k}\) represents the state noise in the feature space. \[\alpha_{k}^{T}=\left[y_{k-1}\cdots y_{k-x_{0}},\wedge u_{k-1}\cdots u_{k-z_{0}}1\right] \tag{11}\]  
\[\beta_{k}=\left[\delta_{1}\cdots\delta_{x_{0}},\wedge\alpha_{1}\cdots\alpha_{ z_{0}}e\right] \tag{12}\]  
where the regression vector is denoted by the letter \(\alpha_{k}\in Q^{(x_{0}+z_{0}+1)\times 1}\), and the transpose operator is denoted by the letter \(T\). Figure 5 presents the prediction scheme of the proposed forecasting model. KRLS is used to evaluate and upgrade the unknown coefficients in Equation (10) based on the objective function defined by  
\[\mathbb{Q}_{KRLS}=\min\sum_{k=1}^{N}\Psi^{N-k}\Big{|}y_{k}-K(\alpha_{k},\cdot) ^{T}\beta_{k-1}\Big{|}^{2}+R\Psi^{N}\parallel\beta_{k-1}\parallel_{H}^{2} \tag{13}\]  
\[\chi_{k}=\left[K(\alpha_{1},\cdot)K(\alpha_{2}),\cdot)\cdots K(\alpha_{k}), \cdot)\right]^{T} \tag{14}\]  
where \(K\) is the Mercer kernel, \(\chi\) represents the matrix of all \(k\) inputted samples, \(R\) is the regularization parameter, \(H\) addresses the reproducing kernel Hilbert space (RKHS) related to the Mercer kernel, and \(\Psi\) (0.98 in this case) is the forgetting factor. The Gaussian kernel, polynomial kernel, and sigmoid kernel are the three most regularly used kernels evaluated for their ability to improve prediction accuracy [66]. The Gaussian kernel is given by  
\[K_{\alpha,A^{\prime}}=\exp\left(-\frac{\parallel\alpha-\alpha^{\prime} \parallel^{2}}{2\rho^{2}}\right) \tag{15}\]  
where \(\rho\) represents the scaling factor, and \(\alpha^{\prime}\) is the new forthcoming information. The polynomial kernel is given as  
\[K_{\alpha,A^{\prime}}=\left(\alpha^{T}\alpha^{\prime}+c\right)^{p} \tag{16}\]  
where \(c\) is a positive value and \(p\) is the order of polynomial kernel and the sigmoid kernel is given by  
\[K_{\alpha,A^{\prime}}=\tanh\left(s\left(\alpha^{T}\alpha^{\prime}\right)+t\right) \tag{17}\]  
where \(s\) and \(t\) are appropriate positive constants. The fundamental concept is that the input data are mapped with high-dimensional feature space (i.e., RKHS). This interaction allows linear inner products to be transformed into RKHS by just modifying their inner product to kernels [67]. The linear approach is then  
Figure 5: Proposed KRLS forecasting model. used to solve the transformed feature space. Kernel-based algorithms offer the benefit of being able to find a global solution by solving a convex optimization problem. In addition, if the data have no linear relationship, LR algorithms may not be able to accurately model it. This problem can be solved using the kernel technique, which is more likely to respond to a linear model.