  Renewable energy forecasting is the workhorse for efficient energy dispatch.
However, forecasts with small mean squared errors (MSE) may not necessarily
lead to low operation costs. Here, we propose a forecasting approach
specifically tailored for operational purposes, by incorporating operational
problems into the estimation of forecast models via designing a loss function.
We formulate a bilevel program, where the operation problem is at the lower
level, and the forecast model estimation is at the upper level. We establish
the relationship between the lower-level optimal solutions and forecasts
through multiparametric programming. By integrating it into the upper-level
objective for minimizing expected operation cost, we convert the bilevel
problem to a single-level one and derive the loss function for training the
model. It is proved to be piecewise linear, for linear operation problem.
Compared to the commonly used loss functions, e.g. MSE, our approach achieves
lower operation costs.
