# Machine Learning Based Prediction of Output PV Power in India and Malaysia with the Use of Statistical Regression

Authors: Ojaswa Yadav; Ramani Kannan; Sheikh T. Meraj; Ammar Masaoud
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

Climate change and pollution are serious issues that are driving people to adopt renewable energy instead of fossil fuels. Most renewable energy technologies rely on atmospheric conditions to generate power. Solar energy is a renewable energy source that causes the least environmental damage. Solar energy can be converted to electricity, which necessitates the use of a PV system. This study presents a design, which analyses the output power performance of PV, using machine learning technique in India and Malaysia; using this, we would get the predicted amount of solar power using different weather conditions for both India and Malaysia. This study is divided into two sections, such as the data collection section and the implementation system. Dataset was collected from a weather NASA website, which took various weather parameters, based on which the model will be evaluated. The proposed research work is developed using ANN and is an amalgamation of statistical regression and neural networks, which help the model to get high accuracy by helping the model learn more complex relationships between parameters, which is able to evaluate the output power performance of photovoltaic cells with different environmental condition parameters in India and Malaysia. The ANN models are found to successfully predict PV output power with root mean square error (RMSE) of 1.5565, which was used as a measure of our model’s accuracy. This ANN model also outperforms other models available in the literature. This will have a noteworthy contribution in scaling the PV deployment in countries such as India and Malaysia and will increase the share of PV power in their national power production, as it would give the industry and the two countries an idea as to how the predicted output PV power would vary based on weather conditions, such as temperature.


---

## Body

## 1. Introduction

The basic necessity of a human being is electricity or power. Electrical energy is essential for us to be able to go about our everyday lives without encountering any difficulties. Electrical energy may be obtained from a variety of sources, including wind, fossil fuels, hydropower, solar power, and nuclear and coal power. Renewable and nonrenewable energy are the two forms of energy.Due to the massive consumption of fossil fuels in recent decades, global warming and the energy crisis have had a significant impact on government economic policy, climatic conditions, and energy security issues, motivating the development and use of alternative, sustainable, and clean energy sources to replace current energy production [1]. The entire world was compelled to focus on the utilization of renewable energy resources in order to avoid an emergency power outage, cut CO2 emissions, and maintain pollution control. However, equipping such energy resources is a significant challenge, and as a result, we cannot entirely rely on the amount of renewable energy generated for the national power grid. One way to reduce future greenhouse gas emissions is to employ solar energy. Photovoltaic (PV) may offset 50% of all future development in thermal energy generation, reducing yearly worldwide carbon dioxide emissions by 10% in 20 years and 32% in 50 years, compared to predicted increases [2].Photovoltaic power forecasting is a vital feature for large-scale integration into the conventional energy system that is both reliable and cost-effective. Furthermore, photovoltaic (PV) power forecasting is necessary for reorganizing and installing large PV producing stations, power system stabilization, green power business, and power disturbance warning on self-governing power systems. As of February 28, 2021, India’s installed solar power capacity, which includes both ground and roof-mounted plants, was 39,083 MW. From April 2019 through March 2020, solar power output totalled 50.1 TWh, or 3.6 percent of total power generation. In January 2022, renewable energy generation reached 13.15 billion units (BU), up from 11.51 BU in January 2021. By 2030, the government hopes to have installed renewable energy capacity of around 450 gigawatts (GW), with solar accounting for roughly 280 GW (almost 60%) [3]. Malaysia’s yearly average daily solar radiation, on the other hand, ranges from 4.21 kWh/m2 to 5.56 kWh/m2. During the forecast period of 2022–2027, the Malaysia renewable energy market is predicted to grow at an annual rate of 8.5 percent. The COVID-19 epidemic has had a minor impact on Malaysia’s renewable energy sector, since the government has postponed ambitious solar bids, including a 1 GW procurement in 2020 [4, 5]. These countries intend to increase their contribution to renewable energy (RE) over time. Because of its abundance, solar energy is the focus of renewable energy. In order to assess and analyse PV performance in terms of forecasting output PV power with minimal error, the impacts of important environmental factors on PV performance must be examined.The main objective of this manuscript is achieved by developing a machine learning model based on statistical regression method. Statistical models are created by analysing historical data. Among them are time-series models, satellite data-based models, sky image-based models, artificial neural networks (ANN) models, and wavelet analysis-based models. This approach is selected for the study because of its high accuracy, novelty, and ease of use. We were able to make an ANN model, which is simple to understand, easy to use, and highly accurate with a root mean square error (RMSE) of 1.5565. The lesser the RMSE the better trained a model is considered. This model was also able to outperform various older regression models. Implementation of the ANN model has made it possible to calculate PV power in countries such as India and Malaysia with high accuracy in this manuscript, authors have reported the following new contributions:(1)
Developing a PV power prediction system algorithm to accurately predict the output solar power in the countries of India and Malaysia, since till now, no research based on these two countries combined have been done.(2)
Comparison of different machine learning based models and techniques to find the best one suited for our needs.(3)
Development of a model, which could outperform various old regression models.(4)
Exploring ANN carefully and finding the best prediction model, which could be made using our knowledge to help and provide the lowest RMSE, when compared with other models.


## 2. Related Literature

Several recent studies have reported on several methods for forecasting and estimating PV output power. The literature on PV plant power production estimation offers different types of models in detail, which are demonstrated in Table1. In Reference [6], a phenomenological model is used, which is a scientific model that represents the actual relationships between events in a way that is consistent with fundamental theory but is not generated directly from theory. To put it another way, a phenomenological model is not based on basic principles. A phenomenological model makes no attempt to explain why the variables interact in the manner they do, instead focusing on describing the connection, assuming that the link continues beyond the observed values, which gives it a major drawback.Table 1
Characteristics of prediction models used for forecasting PV output power.
ObjectiveAdvantageDisadvantageReferenceForecast of PVHighly versatile, made up of four different modules. High accuracyNot easy to understand. Needs high computing power[6]Forecast of PV powerPhysics inspired, and uses stochastic to increase efficiency. Uses three separate modules, two for numerical forecasting and other for AI based models.Data collection is tougher than other methods. Solution is long and complicated.[7, 8]Solar power forecastingUses adaptive and linear time series. Easy to implementLow accuracy during dusk and dawn[9]Estimate PV powerHybrid model uses SARIMA and SVM methods. Good accuracyExtremely complex to execute[10]Forecast PV plant outputUses a physical model with software such as PVSyst and SAMDeterministic forecasting is common. Fails to account for uncertainties in PV power data. High computing cost[11, 12, 14]Solar PV forecastingPresents sate of the art PV power forecasting technique using extreme learning methodCan lead to over fitting. Uncertain performance of the model[13, 15]PV performanceIncreased accuracy. Use of physical systems to get dataExpensive during setting up and can get complex[16–18]PV power forecastingPredicted the solar irradiance using machine learning techniques, rather than PV power itselfMore complexity. Did not get the PV power[15, 20–23]PV power forecastingIncreased accuracyUses expensive and restricted equipment[24, 25, 28, 29]PV power predictionHigh accuracy. Simple model to understandData collection is done on hardware basis and would be expensive[26]Various hybrid models for predicting PV power have grown in popularity. For example, reference [7, 8] suggested a method for power forecasting that incorporates three forecasting modules: two models for numerical weather forecasting and other one for AI based models, but this could become extremely complicate, since it would require a lot of resources and also because three different modules were used, which would make them difficult to understand. Reference [9] proposed a two-stage method, where, first, the clear-sky model approach is used to normalize the solar power, and then, adaptive linear time-series models are applied for prediction. This method, however, can also be used for short time predictions, and the accuracy decreases significantly around dusk and dawn. Reference [10] combines two well-known methods: the seasonal autoregressive integrated moving average technique (SARIMA) and the support vector machines method (SVMs), but it could only be used to determine short term PV power. The goal of these hybrid models for PV power forecasting is to take use of the strengths of each model to achieve worldwide forecasting performance, to establish the optimal weight between online data and meteorological forecasts, for example, many statistical and AI-based approaches are used.Deterministic methods, based on physical events, attempt to forecast PV plant output by utilizing software such as PVSyst and System Advisor Model (SAM) to consider the electrical model of the PV devices that make up the plant. The electrical, thermal, and optical properties of PV modules were modelled using a deterministic method in [11–14]. The majority of published research on PV power forecasting focuses solely on deterministic forecasting, i.e., point forecasting. In certain cases, deterministic forecasting approaches fail to account for the uncertainties in PV power data.Recently, there has been a lot of interest in probabilistic PV power forecasting models that can quantitatively explain these uncertainties [13, 15]. Using an ensemble of deterministic forecasters is one of the most common methods for creating probabilistic uncertainty. The primary drawback of ensemble-based PV power forecasting models is their high computing cost, which may pose a real-time difficulty in practice. Another shortcoming of deterministic and probabilistic PV power forecasting techniques is their shallow learning models.In [16], for the cities of Kuala Lumpur and Lucknow, researchers examined the capabilities and outputs of 8 MW solar mono-Si and poly-Si PV systems. PVsyst software was used to run the simulations. The findings provided light on the impact of temperature variations, the sun’s location in relation to the Earth’s horizon, and the impact of mono-Si vs poly-Si systems. In [17], a grid-tied 100 kWp solar photovoltaic power plant, erected on an institute’s building rooftop in Bhopal, India, was simulated and energy analysed. The study sheds light on the performance of solar power plants connected to the medium-term grid in real-world settings in central India. The plant’s standard performance ratio and capacity factor were discovered to be 80.72 percent and 19.27 percent, respectively; [18] included a comprehensive investigation of the PV plant’s performance over time and estimated the energy output based on key meteorological data gathered from a solar radiation resource assessment (SRRA) station established at the PV power plant’s site. The wet seasons have an impact on solar output and performance, which is a common occurrence in the humid tropical area. Based on various meteorological characteristics, a regression model of solar production for all seasons was created.Insights into the features of data relationships and the relevance of particular qualities in datasets are provided by machine learning [19]. Jawaid et al. [11] examined several ANN algorithms without revealing the characteristics of the prediction model or their numerical performance. Several additional studies used machine learning approaches to estimate solar irradiance rather than PV power [20–22]. Some studies [23] focused solely on the training and testing of a single machine learning model for PV power prediction. Using a minimal input dataset, an adaptive ANN was utilised to simulate and size a stand-alone PV plant [24, 25]. The many components that make up a PV power system, as well as their output signals, were modelled using an ANFIS [7].Artificial neural networks (ANN), support vector machines (SVM), multiple linear regression (MLR), and adaptive neuro-fuzzy inference system (ANFIS) are examples of statistical and machine learning algorithms that function without any prior knowledge of the system under investigation [26, 27]. Statistical learning algorithms provide several benefits. They can, first and foremost, operate with incomplete data. Secondly, they can generalize and make predictions once they’ve been trained. Their characteristics allow them to be utilised in a variety of situations. Different machine learning (ML) methods have been studied for output power prediction of renewable energy sources. References [15, 20, 22] predicted the solar irradiance using machine learning techniques, rather than PV power itself. However, due to increased complexity, the use of a convolution neural network was not useful. References [28–31] used satellite images, sky imaging and methods to increase the accuracy, but the data collection method was expensive and restricted. The method is also more expensive.


## 3. Proposed Model and Working Principle

Machine learning based photovoltaic (PV) performance forecast with various environmental conditions parameters for India and Malaysia is used. Artificial neural network (ANN) based regression technique has been used to calculate the predicted power generated by photovoltaic cells. In the proposed method, the division of data would be random, with a ratio of 70:30 for training and validating. Moreover, statistical regression technique would be used for ANN. Levenberg Marquardt method is used to conduct the training of the dataset. The performance of the proposed method is verified using mean squared error (MSE).This study makes use of statistical regression method. Generally, the study of historical data is used to create statistical models. Time-series models, satellite data-based models, sky image-based models, artificial neural networks (ANN) models, and wavelet analysis-based models are among them. Due to its high accuracy, novelty, and easy usage, this method is selected in this manuscript. The flowchart of the proposed model is illustrated in Figure1.Figure 1
Flowchart of the proposed ANN model for predicting PV output.


## 4. Reading of Datasheet

The dataset collected from the Internet was stored as an excel file and then sent to MATLAB. This included importing the data and reading the dataset as a CSV file [15]. The dataset consisted of weather information and readings for the entire countries by taking out the averages, and currently no specific locations were chosen. For this research, knowing the load and capacity of the plant was not necessary and is something, which can be added to the project on a later stage.


## 5. Data Prepossessing

After importing the data, the preprocessing of the data is initiated. This included removing missing values and dropping the nonrelevant columns. Once the nonrelevant columns have been removed, the process is continued by detecting and removing the outlines. To sum it up, the procedure will detect outliers based on factors such as wind speed, relative humidity, and temperature, make a threshold and range and check for outliers, as shown in Figure2.Figure 2
Detection of outliers.


## 6. Normalization or Scaling

The process of arranging data in a database is known as normalization. It is used to reduce the amount of redundancy in a relationship or group of relationships. It is also used to get rid of unnecessary features like insertion, update, and deletion anomalies. Scaling is the process of measuring and assigning numbers to items based on predetermined principles. Scaling, in other terms, is the act of placing measurable things on a continuum using a continuous succession of numbers, to which they are allocated. In the proposed method, normalization and scaling have been performed and the results are shown in Figure3.Figure 3
Normalization process of the targeted data: (a) before normalization; (b) after normalization.
(a)(b)


## 7. Correlation between Solar Power and Temperature

Here, a relation describes the degree to which two variables move in coordination with one another. The two variables that have been selected in this case are solar power and the temperature in India and Malaysia. The results are combined, calculated, and graphically illustrated in Figure4. Since, in this figure, the two variables are moving in the same direction with respect to one another, it can be stated that temperature and solar power are in a positive corelation to one another.Figure 4
Correlation between solar power and temperature.Variety of basic and common regression and prediction models: in this work, the ANN was also used to predict daily PV output power, which is a very popular machine learning tool for classification and regression application. With a layered structure (input, hidden, and output layers), the ANN attempts to recreate machine learning in a manner comparable to that of the human brain. Artificial neurons are used to model ANNs, with each neuron receiving a set of inputs. These inputs are subjected to the activation function, which results in a neuron activation level (neuron output value), and learning knowledge is delivered in the form of training inputs and output pairs. The proposed model of ANN is shown in Figure5. Some of the features of the proposed ANN are listed as follows:(1)
Model Creation. The hidden layers taken here are 30, the dataset has been divided into a ratio of 70 for testing and 30 for validating.(2)
Performance. We start training our model and check its performance.(3)
Visualize the Prediction from ANN Model. Visualize the prediction from ANN model Figure 6, depicts a graph, which is plotted to illustrate the actual vs predicted model for the artificial neural network designed here after completion of the program.(4)
Custom Test Data Prediction. Here, we calculate and store the predicted solar power in both the countries combined.Figure 5
Proposed ANN model.Figure 6
Predicted vs actual output.


## 8. Analysis

To assess the efficacy of machine learning algorithms for PV output power prediction, many statistical studies were conducted. Various evaluation criteria are widely used to compare the performance of models: (i) The correlation coefficient, which determines the linear relationship between two variables; (ii) mean absolute error (MAE), which is calculated by averaging the absolute difference between two variables; (iii) mean square error (MSE) calculates and aggregates the square discrepancy between target and projected values; (iv) root mean square error (RMSE) is the square root of MSE and identical to MAE except that it averages the squares of the difference before finding the square root, giving greater mistakes more weight. Here, for the calculation of accuracy, MSE and RMSE were considered as the main factors to measure the success of the model.(1)r=ConX,Yσxσy,MAE=n×nX−Y,MSE=2n×PX−Y,RMSE=2n×rPX−Y,r2=1−MSE,MSE=∑X−Y2.


## 9. Results and Discussion

The dataset used consists of parameters such as relative humidity, wind speed, temperature. Our machine learning technique was based on statistical regression method, which makes use of historical data to find the results. Our dataset was collected from a website link available of NASA’s web page [32]. This method was used for its high accuracy and noncomplexity. Figure 7 summarizes the progress of our model and consists of the number of epochs, time taken to train, the performance of the model, gradient of model, Mu, and the validation check.Figure 7
Performance of neural network.The validation performance is used to ensure that the system performs consistently and accurately over a wide range of characteristics by checking the performance of our system at different stages, as shown in Figure8, the best training performance was observed at different epochs for different techniques. Out of the various models developed by the ANN using the different set of features, the best epochs were obtained at 6 epochs, respectively, with a value of 2.4228. This could be used in future to derive the model for predicting the PV power.Figure 8
Performance of neural network.Figure9 shows the error histogram (a histogram of error between the target value and predicted value after training a feed forward neural network) with 20 bins, where bins represent the vertical bars in the graph. Total error from each neural network ranges from −7.054 to −4.794. Each vertical bar represents the number of samples from corresponding dataset, which lies in a particular bin. There is a zero-error line in the graph, and more than 80% of the errors lie within +10 Watt. It is typically assumed that any algorithm, which could predict the output, where 80% of the error lying within 10%.Figure 9
Error histogram.The training set, Figure10 consists of three different graphs: the gradient graph, whose gradient value (which is a measure of change in all weights with respect to change in error) at epoch 12 is 0.56399. The Mu graph has a Mu value (a control parameter for algorithm used in the neural network) of 0.001 at 12 epochs. The validation check graph (an automatic check performed by computer to see if data entered is sensible and reasonable) is equal to 6 at epoch 12.Figure 10
Graph depicting the gradient value, the Mu value, and the validation check value, respectively.Figure11 shows the relation between the original power output and the predicted power output, using the best epochs from the ANN. The dots represent the original power output; the blue, red, and green line is the best linearized predictive model derived from ANN, and the dotted line represents the best linear relation for the true target. However, the difference between the predictive model trend-line and the true trend-line was noticed for all features, which is evident in Figure 11.Figure 11
Graph depicting the gradient value, the Mu value, and the validation check value, respectively.Finally, Figure12 shows the result of the predicted power of the PV in countries such as India and Malaysia. It is divided into two different graphs, one for the predicted solar power in India, which is depicted in Figure 12(a), and other for the predicted solar power in Malaysia, which is illustrated in Figure 12(b). The x axis of the graph is labeled as the number of days ranging from 0–600 in India and 0–800 in Malaysia. The y axis is labeled as predicted solar power from given features, with a range of 0–18000 in India and Malaysia. A brief comparison among other prediction methods is presented in Table 2.Figure 12
Predicted solar power in (a) India and (b) Malaysia.
(a)(b)Table 2
Comparison between proposed method and other methods.
MethodParameterResultCFSRMSE06.1555ReliefRMSE5.5351Proposed methodRMSE1.5565


## 10. Conclusions

The predicting photovoltaic power is an important research field that employs various forecasting approaches to mitigate the consequences of solar output unpredictability. In smart grid and microgrid concepts, there is an increasing amount of photovoltaic (PV) generating penetration. PV power is intermittent and heavily dependent on irradiance, temperature, and humidity, due to the irregular nature of solar sources. Solar energy generation has a lot of potential in India. The country’s geographic position is advantageous for solar energy generation. The reason for this is because India is a tropical nation that receives solar radiation practically all year, averaging 3,000 hours of sunlight. This equates to almost 5,000 trillion kWh. In the case of Malaysia, it will be a center for solar cell production by 2030, according to the Malaysian Solar PV Roadmap 2017. According to the Renewable Energy Policy and Action Plan, electricity generated from renewable sources such as solar PV, biomass, biogas, minihydro, and solid wastes could total to 11,227 GWh by 2020 (NREPAP). Solar power will generate a clean and green environment in the future, and by employing the tracking system, the power produced will be maximized. Solar power as a source of energy will also assist to minimize global warming and the greenhouse effect by reducing the usage of nonrenewable energy. When compared to other models, our model was more accurate in calculating the output power with a RMSE of 1.556.(1)
Our trained ANN model is simple and easy to understand, which can be used to calculate and predict the output power of PV system in India and Malaysia with performing complex calculations.(2)
Since the research was based for counties of India and Malaysia, it can help other researchers in these countries who can use our method and its performance for the prediction in their region.For further research, we can acquire more PV and environmental data by setting up a physical system and collecting the data from it, this would help us acquire better data, which would help build more accurate models. This would help in making a more predictive model using the approach from this research and can be compared with other CNNs in the future. Cooling and cleaning effects can also be added in the future and can be used with a dataset being collected for five years, making a more accurate model.



---

*Source: 5680635-2022-07-15.xml*