Statistical Machine Learning Model for Uncertainty Planning of Distributed Renewable Energy Sources in Distribution Networks

New energy power systems with high-permeability photovoltaic and wind power are high-dimensional dynamic large-scale systems with nonlinear, uncertain and complex operating characteristics. The uncertainty of new energies creates challenges in detailed analyses of operating conditions and the efficient planning of distribution networks. Probabilistic power flows (PPFs) are effective tools for uncertainty analyses of distribution networks, and they can be applied in stochastic programming, risk assessment and other fields. We propose different forms of PPFs, which are origin moments rather than means and variances, based on point estimation. We design a stochastic programming model suitable for new energy planning in practice, and the PPF results can be used to improve energy stochastic programming methods by considering the principle of maximum entropy (POME) and quadratic fourth-order moment (QFM) estimation. The origin moments of PPFs are transformed into central moments as inputs of QFM based on probability theory. QFM can efficiently estimate the constraint probability levels of stochastic optimal planning models, and the proposed method is verified based on an IEEE 33-node distribution network.


INTRODUCTION
In the context of smart grids and low-carbon power, the broad application of intermittent renewable distributed generation (DG) has led to uncertainty in distribution network planning (Injeti and Thunuguntla, 2020). Hydrogen production from renewable energy has become a hot spot of new energy application because of its low energy consumption (Zhang et al., 2021). The impact of new energy uncertainty on the operation optimization of distribution networks cannot be ignored, and high requirements for planning and design have been proposed. The stochastic optimal planning of distribution networks has become one of the key problems in the development of smart grids. The impacts of various uncertain processes on distribution network planning results can be formulated as part of a complex, nonlinear mixed-integer programming problem. The traditional planning method is based on typical daily deterministic scenarios, and the influence of uncertain factors is often not considered. The main methods that include uncertain programming in power systems are robust programming and stochastic programming.
Robust power system planning commonly combines the worst-case scenario approach and interval optimization theory (Liu et al., 2016). Roldán et al. presented an adaptive robust optimization theory in which correlated uncertainty and the worst-case operating cost are fully considered (Roldán et al., 2019). Considering the uncertainty of DG and the corresponding demand, Chatthaworn and Chaitusaney presented a robust model for transmission network expansion planning in which all possible scenarios are analyzed (Chatthaworn and Chaitusaney, 2015). Zhang et al. presented a sequential quadratic interval programming model for reactive power optimization based on the interval uncertainty of DG (Zhang et al., 2019). To efficiently solve reactive power planning problems, the applied planning model often approximated as a linear model (Zhang et al., 2018). Zhang et al. presented a scenario method for reactive power optimization, and the uncertainty of DG was obtained from distribution functions (Zhang et al., 2016). Compared with deterministic programming, robust programming can ensure the security of power grid systems under extreme conditions. However, the fluctuations in DG uncertainty considerably influence robust programming. When the fluctuations in uncertain factors are small, the superiority of robust programming may not be apparent. When the fluctuations in uncertain factors exceed the corresponding threshold values, robust programming may not yield sufficient planning results. In addition, for safety, robust programming may be too extreme in many scenarios.
With respect to stochastic programming, probability distributions are often used in uncertain programming modeling. Gan et al. presented a wind farm planning method based on a linearized bilevel model that was solved using a linear solver (Gan et al., 2016). The mixed-integer linear stochastic model has become a popular stochastic planning model for distribution networks, and various scenarios should be considered to capture DG uncertainty (Jooshaki et al., 2020). Park et al. presented a two-stage stochastic mixed-integer programming model that considers DG uncertainty (Park et al., 2015). Haghighat and Zeng presented a two-stage stochastic programming model in which correlations among uncertainties are reflected by a Gaussian copula (Haghighat and Zeng, 2018). In regard to new energy power systems, the operation scenario of power systems is often determined according to the DG outputs. Chen et al. suggested that the operation scenario should be established according to the relevant state variables (Chen et al., 2020). The uncertainty of DG is considered in stochastic programming, so decision makers can assess the relationship between risk and benefits, which can help balance the economy and security of distribution networks. However, the probability distribution of DG uncertainty in stochastic programming models is limited by the amount of historical data available, and this limitation can bias the empirical distribution. In addition, nonlinear stochastic programming methods often have poor solution efficiency. Thus, establishing an efficient planning model is important and is the research motivation of this paper.
Scholars conducted research in the stochastic planning and inquiry field. The decision variables of the stochastic planning scenario are related to DG levels, reactive power devices, PEV charging stations, etc. The decision variables include the optimal site, size, quantity or level. To decrease wind power (WP) curtailment, a novel reactive power allocation scheme was presented in (Niu et al., 2017) based on autonomous voltage security regions. To solve the problem of reactive power imbalance associated with DG, a robust reactive power potential estimation method was presented in (Li et al., 20196) based on two-stage robust optimization. To improve the efficiency of stochastic programming under the premise of fully considering refined scenarios, a new stochastic programming theory was presented in  based on statistical machine learning. To maximize the profit of PEV charging stations, a bilevel optimization model was formulated in (Zhao et al., 2020), and the optimal sites and station sizes were calculated. It can be concluded that the consideration of equivalence in programming models is a key to solving stochastic programming problems.
In uncertainty analyses of power systems, probabilistic digital information is important. Many works use probabilistic power flow (PPF) calculations to evaluate the influence of uncertainty on the power grid, and the final results include the mean and variance (Tang et al., 2016;Ren et al., 2017;Lin et al., 2020). In this paper, a novel concept is proposed for the stochastic planning of power grids. In stochastic programming models, the central moment is used instead of the mean and variance.
The innovation of this paper lies in: 1) PPF is applied to uncertain programming for the first time, which verifies the application value of PPF theory. Instead of the mean and variance, we use central moments as the results of the PPF calculation, and they are used to estimate the opportunity constraint levels in stochastic programming problems. 2) The principle of maximum entropy (POME) is applied twice to uncertain planning of distributed renewable energy sources in distribution networks. The first involves estimating the probability characteristics of temperature, which can influence photovoltaic (PV) power generation, and the second involves estimating the probability level of constraint satisfaction in stochastic programming. 3) We propose a novel uncertain planning model with the mean value as the objective function and confidence levels as constraints. The practical significance of the planning model is clear and can be expanded for real problems.
The remainder of this paper is organized as follows. First, a statistical model for uncertainty planning of distributed renewable energy sources is proposed based on statistical machine learning in Stochastic Programming Model Section. Second, uncertainty calculation method is given for expanding PPF results into a stochastic programming model with the proposed method in Uncertainty Calculation Method Section. Specifically, we propose methods for weather uncertainty calculation, PPF calculation and uncertainty constraint calculation. Finally, three cases are simulated in MATLAB to verify the effectiveness of the proposed statistical model and solution method in Simulation Section. Specifically, we successively verify the effectiveness of uncertainty constraints, PPF and uncertainty programming.

STOCHASTIC PROGRAMMING MODEL
Stochastic programming is an important part of uncertain programming, and it regards random variables as uncertain parameters. Combined with probability theory, the new energy system can be planned based on stochastic programming. We first introduce the stochastic programming problem and then introduce the stochastic programming model used in this paper.

Problem Description
As shown in Figure 1, the uncertain components of new energy distributions network are important to consider. The energy sources of PV and WP are natural, but these sources are highly unpredictable. When new renewable energy capacity is added to the grid, the uncertainty of the distribution network will increase, and the operation scenario become increasingly complex, thus creating challenges related to the efficient planning and use of new energies. In stochastic programming, decision variables can only take certain values, thereby limiting the potential operating scenarios.

Programming Model
We propose a PPF-based stochastic programming model for new energies in distribution networks as follows: where f obj (•) is the objective function of the planning scheme, p loss is the total active power loss in distribution and can be changed to other economic indicators based on the relevant decision-making requirements, E (•) is the mean function, Y PV is a decision variable and represents the rated capacity of PV power, Y PV − is the upper limit of the PV planning capacity, Y WP is another decision variable that represents the rated capacity of the WP, Y WP − is the upper limit of the WP planning capacity, num is the number of buses with new energy grid connections, num sys is the number of distribution network buses, V i is the ith bus voltage amplitude, V _ is the allowable lower limit of v i , Pr (•) is a probability function, and α is the confidence probability.
The above formula cannot clearly explain how the decision variables affect the objective and constraint functions. Therefore, we will explain these relations through the following formula.
where PPF(•) is the PPF estimation method, which is a point estimation method (PEM) in this paper. Additionally, p PV is the active PV power, and p WP is the active WP power. The power generated by new energy must be a function of the planned capacity, as shown below (Rohani and Nour, 2014).
where f PV is the PV derating factor, G is the amount of current solar radiation, STC is a subscript that represents standard test conditions, α p is the temperature coefficient, T C is the PV cell temperature, NOCT is a subscript that represents the nominal operating cell temperature, T a is the ambient temperature, ηmp is the maximum power efficiency, τ is the solar transmittance of a PV cell, α ab is the solar absorptance of a PV cell, v is the current wind speed, v r is the nominal wind speed, v ci is the cut-in wind speed, and v co is the cut-out wind speed. By substituting Equations 8-10 into Eq. 7 and treating the capacities and locations of new energies as decision variables, we can obtain Now, let us summarize the stochastic programming model for new energies in distribution networks. Notably, (2), (3), (4), and (5) are the upper and lower limits of decision variables, and these constraints can be implemented by limiting the feasible region when solving the stochastic programming model for new energies in distribution networks. Remark 1: The key to the solution is to efficiently and accurately solve Eqs 6, 11. As in the estimation in Eq. 1 based on Eqs 6, 11 can also be estimated based on a PPF. The solution processes for (6) and (11) are discussed in detail in the next section.

UNCERTAINTY CALCULATION METHOD
First, we introduce simulated weather data, which are the inputs of Eqs 8-10. Second, the PPF method is introduced, and the results are origin moments. Finally, the method used to solve Eq. 6 is introduced based on central moments and particle swarm

Uncertainty Weather
The weather simulation is based on a copula function, marginal probability distributions and logic, as shown in Figure 3. First, we introduce the marginal probability distributions for different weather types. Second, the copula function is introduced. The marginal probability distribution of G can be expressed as (Karaki et al., 1999): where pdf (•) is a probability density function (PDF), α and β are shape parameters, Γ is the gamma function, and G max is the maximum solar radiation.
The marginal probability distribution of v can be expressed as (Karaki et al., 1999): where k is a shape parameter and c is a scale parameter.
The marginal probability distribution of T a can be expressed using POME in (Shore and Johnson, 1980): subject to where H (•) is the entropy function, μ k is the kth given expectation, g k (•) is the kth known function, and λ k is the kth Lagrange parameter. λ k in Eq. 18 can be estimated using the program in (Mohammad-Djafari et al., 1992).
A Gaussian copula function is used to model the correlation among G, v and T a . We estimate rho for the matrix of linear correlation parameters using real weather data.
where rho is a coefficient estimated for a matrix of linear correlation parameters based on a Gaussian copula, copulafit (•) is a fitting function, and cdf (•) is a cumulative distribution function (CDF). The Monte Carlo (MC) method is used to generate random weather simulation samples from the Gaussian copula with rho.
where s is a superscript that indicates that a variable is simulated and copularnd (•) represents the generation of random vectors using a MC approach. According to the simulated CDFs, we can obtain the simulated weather samples. Remark 2: We input the weather variables into the model so that the research results can be applied to power grid planning under different weather conditions. There are classical probability functions for solar radiation and wind speed. With respect to the simulation of temperature, POME is used to estimate the unknown probability distribution.

PPF Calculation
PEM uses samples to obtain estimates. We can determine the statistical moments of the population using the PEM. The statistical moments of power flow solutions can be obtained from weighted samples at different positions. MATPOWER in (Zimmerman et al., 2011) is used for deterministic power flow (DPF) calculations. A two-point estimation (2PEM) approach is applied, and two values are determined on both sides of the mean value of each uncertain variable.
where x i is the ith uncertain variable (i.e., p PV or p WP ), i 1,2,. . .,m, m is the number of uncertain variables, X mean,i is the mean of x i , X standard,i is the standard deviation of x i , k 1 or 2 (where 2 reflects the values on both sides of X mean,i ), sk i is the sample skewness of x i , and sp ik is a location-specific measurement.
We introduce the following data into the DPF calculation using MATPOWER. P i,k X mean,1, X mean,2 , ..., X i,k , ..., X mean,m , where dpf (•) is the DPF calculated using MATPOWER and u is the obtained voltage, power flow, or other variable. Next, we give the origin moment formula for u: where M origin (•) is the function for the origin moment of order j and w ik represents the weights for a given location set. From Eq. 25, we can obtain the following equations: where p loss is one type of u, V is the PQ node voltage set related to u, and V om,j is the origin moment of order j. At this point, we have obtained the objective function formula, that is, (28), using the PPF calculation based on 2PEM. The next problem to address is how to transform PPF results into constrained probabilities. The quadratic fourth-order moment (QFM) estimation method is introduced for this probability transformation by converting 29) into (6). However, the inputs of QFM are central moments. Hence, we convert the origin moments to central moments. It is well known that where μ j (•) is the function for a central moment of order j. This equation can be used to obtain μ 4 (V) V om,4 − 4V om,3 V om,1 + 6V om,2 V 2 om,1 − 3V 4 om,1 .
Remark 3: PEM can be used to quickly and accurately obtain moment information for the output random variables, but Gram-Charlier series fitting is needed to obtain the PDFs of the output random variables. The proposed method combines PEM and QFM in stochastic programming to encompass the advantages of PEM (quick and accurate) and avoid the corresponding disadvantages (series expansion).

Uncertainty Constraint
A method for solving 6) with the QRM and central moments is introduced below. QRM is a theory for estimating failure probability, and we estimate the qualified voltage probability based on the principle that the sum of failure probability and qualified probability is equal to one.
where P f is the failure probability, which is an unqualified concept. The limit state function for the voltage amplitude is expressed as: By expanding g (V i ) to a Taylor's series at V i *, we obtain the following equation: where ∇g (•) is a gradient function and ∇ 2 g (•) is a Hessian matrix function. The moments of Z are We change the moments of the voltage amplitude into the moments of voltage amplitude constraints via (38)-(41).
The following formulas no longer limit the number of buses, and a portion of Z is removed. We transform moments to other digital features. csZ where csz is the skewness coefficient and cks is the kurtosis coefficient.
We transform Z to a standard normal vector Y, and the moments of Y are calculated with where Y is a standard normal vector and σ(•) is the standard deviation function. From Eq. 42, we can obtain the moments of Y, as follows: After the second step in the POME approach with four moments, we obtain where (48) and (17) have the same form but different physical meanings. By inserting (46), (47), and (49) into Eq. 48, λ k can be estimated. P f can be obtained using pdf(y): By inserting Eq. 50 into Eqs 6, 35 can be estimated. The voltage constraints for each node in the distribution network can be solved according to the above formula. Now, both 6) and 11) can be adjusted for a set of specific solutions. PSO in  is used to find the minimum to 11) while satisfying 6) by searching the solutions of Eqs 2-5.
Remark 4: The voltage probability information is transformed into voltage constraints via the QFM approach, which is a new way to apply PPFs to obtain constraint solutions in stochastic programming.

SIMULATION
Verification is performed in a step-by-step manner in this study, and the specific examples are as follows. Case 1 verifies the feasibility of estimating confidence levels using central moments from the perspective of pure mathematics, and we show that the QFM approach is suitable for solving the constraint satisfaction probability problem. Case 2 verifies the correctness of the proposed method for estimating different forms of PPF results. Case 3 uses the power quality qualification as a constraint to verify the effectiveness of the proposed method in stochastic programming for distribution networks.

Case 1
The result of the stochastic programming constraint function is a confidence level. The index accompanying the confidence level is the failure probability, which is a common reliability index, and the sum of the two is equal to 1. In using different methods to estimate the variable disqualification probability (i.e., failure probability), we make the following assumptions.
1) X 1 and X 2 are two uncertain variables, both of which obey normal distributions. The reason why we assume a normal distribution is that there are many algorithms that are based on the normal distribution; thus, the effectiveness of the proposed method can be verified. It should be noted that the normal distribution does not have to be used based on the use conditions of the proposed method. 2) We assume that the limit state equation with independent variables X 1 and X 2 is 3) The original sample set is shown in Figure 4, and the number of samples is one thousand.
We compared the proposed method (QFM estimation method) with classic, mature and effective methods that have been previously published, including the Iman method in (Iman and Conover, 1982), the Stein method in (Stein, 1987), the firstorder reliability method (FORM) in (Sankararaman et al., 2014), and the mean value first-order second moment (MVFSORM) method in (Du and Huang, 2008), as references to verify the proposed method. Considering the need for sampling, the Iman and Stein methods are applied with step size of 100-5,000. The simulation results are shown in Figure 5.
The results of different algorithms vary. Compared with those of other algorithms, the results of the proposed method are closest to the real values. The simulation results are related to the information that each algorithm considers and the algorithm design. The usage conditions and input probability information for the different algorithms are shown in Table 1.
It should be noted that the central moments can be calculated from the mean, standard deviation, skewness, and kurtosis. We can also obtain central moments using origin moments. The mean is an origin moment, and another origin moment (standard deviation, which is the arithmetic square root of the variance) is the second central moment.
The mean and standard deviation are the first two moments. Both MVFSORM and the proposed method do not use a probability distribution function, so they are not limited by a certain probability distribution and have high practical value.
More probability information is used when considering four moments than when considering two moments, so the proposed method based on four moments is more accurate than the MVFSORM method based on two moments. Compared with the Iman, Stein, and FORM methods, the proposed method does not need to solve the probability distribution function. In addition, the Iman and Stein methods are only suitable for the normal distribution, but the proposed method does not have this limitation. When the probability distribution is unknown, the proposed method can still determine the reliability or chance constraint level.
Discussion 1: This case shows how to transform digital features into unqualified probabilities, and qualified probabilities are used in the constraint conditions in stochastic programming. The typical results of PPF calculations are the mean and variance, which are first-order and second-order moments. However, the above results indicate that it is not appropriate to rely only on the mean and variance to estimate unqualified probabilities. Specifically, it is necessary to use additional central moments from the PPF results to estimate the probability of constraint satisfaction in stochastic programming.

Case 2
The main advantage of the proposed method is its computational efficiency. The computing time depends on both the efficiency of the algorithm and the hardware configuration of the computer. The simulations in cases 2 and 3 were performed on a ThinkBook with an Intel(R) Core (TM) i7-1065G7 CPU @ 1.50 GHz and 15.7 GB of available memory. POME is used to describe the cumulative distribution function (CDF) of the ambient temperature, which affects  As shown in Figures 6-8, the POME, beta and Weibull distributions are very similar to the empirical distributions, so the simulated ambient temperature, solar radiation and wind speed values are generally accurate. We use a Gaussian copula to model the correlation among the three weather CDFs. The MC method is used for sampling, and the sample size for sets of weather variables is 10,000.
The IEEE 33-bus distribution system from (Baran and Wu, 1989) is used to demonstrate the proposed method. We assume that both the PV and WP rated capacities are 2,000 kW, and the access buses are shown in Figure 9.
Figures 10, 11 cannot be used to verify the appropriateness of the PEM theory but do verify the suitability of the point PEM formula and the corresponding programming method in this paper. The proposed PEM method provides results that can support subsequent simulation analyses. The MC simulation takes 266.829 s, and the PEM simulation takes 0.147 s; thus, the disadvantage of MC is the comparatively longer computing time.
&& stands for logical AND. It should be noted that the proposed method refers to PEM&&QFM. In essence, the proposed method transforms the digital characteristics of PEMs to other digital characteristics that are suitable for stochastic programming. The purpose of assessing the simulation results of MC&&QFM is to verify the accuracy of the QFM approach and the proposed method. As shown in Figure 12, the voltage qualification probability of MC&&QFM is almost the same as that of MC&&Statistics (i.e., direct statistical qualification probability for the voltage amplitude), and it can be used as a reference standard. The voltage qualification probability of PEM&&QFM is close to that of MC&&Statistics.
As shown in Figure 13, although the PEM result is very similar to the MC result, there are still some errors associated with the mean value and the second, third and fourth central moments of the voltage amplitude. The errors in the voltage amplitude moments lead to differences in the qualified probability of the voltage amplitude in the MC&&QFM and PEM&&QFM cases, as shown in Figure 12.
Discussion 2: We use the maximum entropy principle to transform the quadratic fourth-order moment of the voltage amplitude into probability density function (PDF) information and then solve for the voltage qualification probability. The most important contribution of this paper is the novel PPF results, which include the mean loss and the probability of voltage qualification. These results provide the basis for the stochastic planning of distribution networks

Case 3
What we want to verify in this case is the efficiency of achieving a feasible solution to the objective function and constraint functions in programming. To verify the effectiveness of the proposed method, we compare the accuracy of some specific solutions, as listed in Table 2. We assume that the rated capacities of PV and WP are the same, and the access buses are shown in Figure 9.
It should be noted that one hundred percent accuracy is logically impossible for an efficient approximation solution algorithm. Stochastic optimal planning allows for certain error margins, and the error problem in power grid dispatching can be solved with this relative approach. It can be concluded that the proposed method supports stochastic programming in distribution networks. The simulation results using PSO are    Table 3. Compared with the values in Table 2, the values in Table 3 are better.
Discussion 3: We consider mean loss in the objective function in stochastic programming, and the probability of a constraint meeting a certain confidence threshold is a programming constraint based on a quadratic fourth-order moment. Our goal is not to improve the programming algorithm but to improve the efficiency of estimating the probabilistic numerical characteristics of objective functions and constraint functions corresponding to feasible solutions.
The superiorities of the proposed method can be summarized as follows. 1) The results of case 1 show that the proposed QFM method are more precise than other algorithms, and it is not limited by a certain probability distribution.
2) The results of case 2 show that the proposed PEM method spend much less time than MC, but PEM can achieve accuracy levels equivalent to MC. The proposed method can save more than 266 s 3) The results of case 3 show that PPF can be used in uncertainty planning of distributed renewable energy sources in distribution networks. It takes only 4,989 s for optimization solution, and the importance of simplifying the planning model is verified. Compared with the traditional programming methods, we improve the uncertainty planning model rather than the optimization solver.

CONCLUSION
The mean, variance and probability distribution function are commonly obtained from PPF calculations. However, the conventional PPF calculation results cannot be used to directly solve many actual operation and planning problems. The PPF results in this paper are central moments that are used to model objective and constraint functions in stochastic programming and provide a feasible way to address uncertainty problems in smart grid planning.