  Demand response (DR) programs play a crucial role in improving system
reliability and mitigating price volatility by altering the core profile of
electricity consumption. This paper proposes a game-theoretical model that
captures the dynamic interplay between retailers (leaders) and consumers
(followers) in a tariffs-based electricity market under uncertainty. The
proposed procedure offers theoretical and economic insights by analyzing demand
flexibility within a hierarchical decision-making framework. In particular, two
main market configurations are examined under uncertainty: i) there exists a
retailer that exercises market power over consumers, and ii) the retailer and
the consumers participate in a perfect competitive game. The former case is
formulated as a mathematical program with equilibrium constraints (MPEC),
whereas the latter case is recast as a mixed-integer linear program (MILP).
These problems are solved by deriving equivalent tractable reformulations based
on the Karush-Kuhn-Tucker (KKT) optimality conditions of each agent's problem.
  Numerical simulations based on real data from the European Energy Exchange
platform are used to illustrate the performance of the proposed methodology.
The results indicate that the proposed model effectively characterizes the
interactions between retailers and flexible consumers in both perfect and
imperfect market structures. Under perfect competition, the economic benefits
extend not only to consumers but also to overall social welfare. Conversely, in
an imperfect market, retailers leverage consumer flexibility to enhance their
expected profits, transferring the risk of uncertainty to end-users.
Additionally, the degree of consumer flexibility and their valuation of
electricity consumption play significant roles in shaping market outcomes.
