# Improved Probability Prediction Method Research for Photovoltaic Power Output
## 2 Single Improved Prediction Model
### Improved Sparse Gaussian Process Regression Model  
#### 2.1.1 Sparse Gaussian Process Regression  
In the Gaussian process (GP) [31] model, it is assumed that the prior distribution of the observed values is \(\mathbf{y}\) given by a Gaussian whose mean is zero and whose covariance is defined by a Gram matrix \(\mathbf{K}+\sigma_{n}^{2}\mathbf{I}\) so that  
\[\mathbf{y}\sim N(0,\mathbf{K}+\sigma_{n}^{2}\mathbf{I}) \tag{1}\]  
where \(\mathbf{K}=k(\mathbf{x}_{nt}\mathbf{x}_{nt})\) with \(k\) as the kernel function. For a new input \(\mathbf{X}_{*}\), a prediction of the target variable \(\mathbf{f}_{*}\) can be made by using the rules for conditioning Gaussians. The predictive distribution \(\mathbf{f}_{*}\) is a Gaussian distribution with mean \(\overline{\mathbf{f}_{*}}\) and covariance \(\mathrm{cov}(\mathbf{f}_{*})\). The posterior distribution of the predicted values is  
\[\mathbf{f}_{*}\big{|}\mathbf{X},\mathbf{y},\mathbf{X}_{*}\sim N(\overline{ \mathbf{f}_{*}},\mathrm{cov}(\mathbf{f}_{*})) \tag{2}\]  
where \(\overline{\mathbf{f}_{*}}=E[\mathbf{f}_{*}|\mathbf{X},\mathbf{y},\mathbf{X}] =\mathbf{K}(\mathbf{X}_{*},\mathbf{X})[\mathbf{K}(\mathbf{X},\mathbf{X})+ \sigma_{n}^{2}\mathbf{I}]^{-1}\mathbf{y},\mathrm{cov}(\mathbf{f}_{*})=\sigma _{n}^{2}+\mathbf{K}(\mathbf{X}_{*},\mathbf{X}_{*})-\mathbf{K}(\mathbf{X}_{*} \mathbf{X})(\mathbf{K}(\mathbf{X},\mathbf{X})+\sigma_{n}^{2}\mathbf{I})^{-1}* \mathbf{K}(\mathbf{X},\mathbf{X}_{*})\).  
In this paper, the commonly used automatic relevance determination function is chosen as the covariance function.  
\[k(x_{p},x_{q})=\sigma_{f}^{2}\exp(-\frac{1}{2l^{2}}\|x_{p}-x_{q}\|^{2})+\sigma _{n}^{2}\delta_{pq} \tag{3}\]  
where \(x_{p},x_{q}\) are the variables of training or test sets, \(l\), \(\sigma_{f}\), \(\sigma_{n}\) are the hyper-parameters, and \(\delta_{pq}\) is the symbolic function.  
A main drawback of GP is its high time complexity. A training process requires inverting a matrix \(\mathbf{K}+\sigma_{n}^{2}\mathbf{I}\), which costs \(\mathrm{O}(n^{3})\). In order to solve this problem, in this paper, an SPGP model that adopts the fully independent training conditional approximation (FITC) approximation method [32] is introduced. The FITC method adopts a pseudo dataset D and uses M samples to approximately simulate the original dataset, where the number of samples M << N. So the posterior distribution \(\overline{\mathbf{f}}\) over pseudo targets \(\overline{\mathbf{X}}\) can be obtained.  
\[p(\overline{\mathbf{f}}|D,\overline{\mathbf{X}})= N(\mathbf{K}_{M}\mathbf{Q}_{M}^{-1}\mathbf{K}_{MN}(\Lambda+\sigma^{2} \mathbf{I})^{-1}\mathbf{y},\mathbf{K}_{M}\mathbf{Q}_{M}^{-1}\mathbf{K}_{M}) \tag{4}\]  
where \([\mathbf{K}_{M}]_{mm^{\prime}}=K(\overline{x}_{m},\overline{x}_{m^{\prime}})\), \(\mathbf{Q}_{M}=\mathbf{K}_{M}+\mathbf{K}_{MN}(\Lambda+\sigma^{2}\mathbf{I})^{ -1}\mathbf{K}_{NM}\), \([\mathbf{K}_{MN}]_{mm}=K(x_{m},\overline{x}_{n})\), and \(\Lambda=diag(\lambda),\ \Lambda_{n}=K_{nn}-\mathbf{k}_{n}^{\top}K_{M}^{-1}k_{n}\). Finally, predictive distribution of test data \(y_{*}\) can be obtained and it is a Gaussian distribution with mean \(\mu\), and covariance \(\sigma_{*}^{2}\).  
\[p(y_{*}|\mathbf{x}_{*},D,\overline{\mathbf{X}})= \int p(\overline{\mathbf{f}}|D,\overline{\mathbf{X}})p(y_{*}| \mathbf{x}_{*},\overline{\mathbf{X}},\overline{\mathbf{f}})\mathrm{d}\overline {\mathbf{f}}=N(\mu,\sigma_{*}^{2}) \tag{5}\]where \(\mu_{*}=\mathbf{k}_{*}^{\top}\mathbf{Q}_{M}^{-1}\mathbf{K}_{MN}(\Lambda+\sigma^{2} \mathbf{I})^{-1}\mathbf{y},\sigma_{*}^{2}=\mathbf{K}_{**}-\mathbf{k}_{\mathbf{x} }^{\top}(\mathbf{K}_{M}^{-1}-\mathbf{Q}_{M}^{-1})\mathbf{k}_{*}+\sigma^{2}, \sigma_{*}^{2}=\mathbf{K}_{**}-\mathbf{k}_{\mathbf{x}}^{\top}(\mathbf{K}_{M}^{ -1}-\mathbf{Q}_{M}^{-1})\mathbf{k}_{*}+\sigma^{2}\).  
The matrix \(\mathbf{K}_{MN}(\Lambda+\sigma^{2}\mathbf{I})^{-1}\mathbf{K}_{NM}\) is O(M\({}^{2}\)N). Since M is much less than N, the computational costs are lower than those of the GP.