## 1 Introduction
The authors in [21] have investigated a multi-objective DG placement and sizing problem subject to reduce loss and to enhance the voltage profile using the shuffled frog leap algorithm. Optimal sizing of renewable energy resources with the goal of loss reduction in distribution grids using the ant lion optimization method is presented in [22]. A battery placement problem is also presented in [23], in which it is objected to reducing losses in a distribution grid with high penetration of solar sources. In [24], optimal allocation and sizing of renewable distributed generation are investigated. Reference [25] has delved into the optimal sizing and placement of RESs in distribution systems considering load growth. The optimal allocation of DG units for a distribution network is presented in [26]. In addition, optimal sizing renewable and dispatchable DGs in distribution networks has been investigated in [27]. The authors in [28] have proposed a new method to deal with the optimization problem of optimal placement and sizing of energy storage systems subject to improve the reliability of hybrid power distribution networks encompassing renewable energy sources. In [29], a multi-objective dynamic and static reconfiguration model with the optimized placement of solar unit and battery storage system is proposed. A meta-heuristic algorithm is employed to find the optimal size and installation location of DG sources with the objective of loss reduction in [30; 31]. As it is clear, none of the works in the literature has paid attention to the uncertainties of distribution-side resources. In other words, the uncertainties of load and demand-side generation sources can have a great impact on the operation and planning of the distribution sector as well as microgrids that should be taken into account. In [32; 33], lightning attachment procedure optimization is employed to solve a non-smooth and non-convex dispatch problem, including uncertain variables pertaining to wind power sources. The authors in [34] also have presented a novel method to deal with the uncertainty of load forecasts as well as the uncertainty of renewable generation sources to solve a placement problem. Similar studies are conducted in which the uncertainty of load, price, and renewable sources are investigated [35; 36; 37]. In this paper, a hybrid energy system is designed, which is regarded as a microgrid in a distribution network. The costs of operation, maintenance, and investment are also taken into account. In order to deal with uncertain variables of solar generation, the lognormal distribution model is employed to exploit the trends and patterns of solar irradiance. In addition, the Gaussian process quantile regression is applied as the forecasting approach to deal with uncertainties of load forecasting. A novel optimization algorithm is employed in order to optimize the performance and to find the optimal location for the installation of DGs. It is supposed that the microgrid is connected to the upstream network. Hence, the cost of energy exchange with the main grid is also taken into consideration in the objective function. The proposed scheme is implemented on the 69-bus IEEE test system in order to evaluate the effectiveness of the model. In Section 2, the problem outlines are described. In this section, the objective function and the constraints of the problem are expressed. In Section 3, the employed optimization algorithm is explained, and in Section 4, the simulation and results are discussed. Ultimately, in the last section, the conclusions are drawn.