**3. Materials and methods**

## **3.1 Correlation analysis**

The correlation between the parameters of the model has a significant impact on the accuracy of the forecasted models. To simplify computations, the correlation of different inputs with PV power generation was evaluated. The correlation matrix is calculated with the help of the covariance Eq. (2) and correlation metrics Eq. (3). Below are the equations:

$$cov(a, b) = \frac{1}{N} \sum\_{i=1}^{N} (\mathbf{x}\_i - \overline{\mathbf{x}}) \times \left(\mathbf{y}\_i - \overline{\mathbf{y}}\right) \tag{2}$$

$$corr(a, b) = \frac{cov(\mathbf{x}, \mathbf{y})}{s(\mathbf{x}) \times s(\mathbf{y})} \tag{3}$$

where *x*, *y* represent the means of the x and y values, respectively, and s represents the standard deviation. It's used to figure out how dispersed the data is around the mean value.

#### **3.2 Principal component analysis**

The dataset must be pre-processed and dimensionally reduced before the training of the machine learning models. Principal component analysis (PCA) is a dimensionality reduction and feature extraction technique based on linear transformations. Using an orthogonal transformation, this approach converts correlated variables into mutually uncorrelated variables. The major components calculated from the Eigen vector of the covariance matrix can be lower or equal to the original variables. The first principal components, which reflect a high correlation between input variables, account for the majority of the variance [11].

#### **3.3 Forecasting models**

In this study, we decided to assess the efficiency of two popular machine learning methods using the R software [12].

## *3.3.1 Multiple linear regression*

Multiple Linear Regression (MLR) is a technique for predicting the power generated by solar PV panels using a range of predictor variables. The following is the regression equation (see Eq. (4)):

$$Y = \beta\_0 + \beta\_1 X\_1 + \beta\_2 X\_2 \dots + \beta\_k X\_k \tag{4}$$

where *X*1*:X*2, … ,*X*<sup>n</sup> are predictor variables and *β*1,*β*2, … *β*<sup>n</sup> are their coefficients.

*Principal Component Analysis and Artificial Intelligence Approaches for Solar… DOI: http://dx.doi.org/10.5772/intechopen.102925*
