Statistics for Data-Driven Simulation and Optimization of Renewable Energy Systems