Examine the theoretical basis of renewable energy forecasting, including concepts such as numerical weather prediction, machine learning algorithms, and statistical modeling techniques, and discussing their applications in predicting renewable energy generation from sources such as solar, wind, and hydroelectric power.