1 Introduction

This article considers a perfectly competitive market for a single commodity that clears well in advance of the realization of an uncertain event \(\xi \). This event is a common source of uncertainty for all market players, namely \(y_1, y_2,\ldots , {Y}\). These players are uncertainty-aware, and forecast the probability distribution \(f(\xi )\) describing the uncertain event \(\xi \). Based on the individual probabilistic forecast, each player solves a stochastic optimization problem to determine her optimal market participation strategy, aiming to maximize her expected payoff. The collection of individual optimization problems results in a stochastic Nash equilibrium problem, whose solution provides the market-clearing outcome.

1.1 Ambiguity aversion: definition and its heterogeneity

One extreme case in modeling the common source of uncertainty is to assume that the true probability distribution \(f(\xi )\) is known and publicly available for all players. This case is illustrated in Fig. 1a. However, it is rather unlikely that this assumption holds true in reality.

Pursuing a more general case, we relax the assumption on the availability of the true probability distribution \(f(\xi )\) and generate a family of potential distributions, the so-called ambiguity set. This case is depicted in Fig. 1b. In this case, the players are ambiguity-averse [1, 2], meaning that they endogenously determine the worst-case distribution in their ambiguity set, and optimize their market participation strategy problem against such a distribution.Footnote 1 Although this case offers a more general framework for modeling uncertainty compared to the extreme case in Fig. 1a, it is not the most general case as it assumes homogeneous ambiguity aversion, i.e., an identical ambiguity set for all players.Footnote 2

The most general case, schematically depicted in Fig. 1c, is the one wherein every market player possesses her own private empirical data and builds her individual ambiguity set, which is not necessarily identical to that of other players. The rationale behind this case is that even if the empirical data are publicly available, market players may still differently build their individual ambiguity sets, reflecting their heterogeneous confidence in those empirical data. Hereafter, we call this case as the one with heterogeneous ambiguity aversion.

Fig. 1
figure 1

Plot a shows the case in which all players know the true probability distribution. Plot b illustrates the case in which the true distribution is unknown and thus players consider an ambiguity set, although it is identical for all. Plot c refers to the case in which each player forms her own individual ambiguity set, resulting in heterogeneous ambiguity aversion

1.2 Ambiguity aversion via distributionally robust chance-constrained optimization

We use a distributionally robust optimization approach [4,5,6] to include individual ambiguity sets within stochastic decision-making problems of players. This gives rise to a generalized formulation of a distributionally robust Nash equilibrium problem. We apply a Wasserstein probability distance metric to build individual ambiguity sets [7, 8]. Unlike the illustration in Fig. 1, the ambiguity set of each player includes an infinite number of probability distributions that are sufficiently close to the empirical distribution. With this approach, each ambiguity-averse player maximizes her payoff in expectation with respect to the worst-case probability distribution in her ambiguity set.

The stochastic optimization problems of players may include their operational constraints. This is the case of market players in physical systems, e.g., energy or transportation systems. In the case the uncertain parameter appears in constraints, the resulting optimization problem will embody an infinite number of probabilistic constraints, since every constraint should be fulfilled for any realization drawn from the worst-case probability distribution. Aiming to achieve a tractable problem formulation, we enforce probabilistic constraints in the form of distributionally robust chance constraints [9, 10]. We decompose the uncertain event \(L(\xi )\) into a deterministic forecast L and a stochastic component \(\xi \), showing the uncertain forecast error. Additionally, we recast uncertainty-dependent decision variables using an affine policy [11]. By introducing a linear reformulation of distributionally robust objective functions [7] as well as applying the worst-case Conditional Value-at-Risk (CVaR) approximation of distributionally robust chance constraints [9, 12], we define a tractable convex Nash game. For this Nash game, we show—given a quadratic regularizer in the objective function of certain players as well as convex and compact strategy sets for all players—the existence of a unique Nash equilibrium point. In addition, we provide the mathematical formulation of an equivalent single and convex optimization problem that can be efficiently solved.

1.3 State of the art, contributions, and paper organization

From a mathematical point of view, the work at hand generally lies in the domain of stochastic Nash games [13,14,15,16]. More precisely, this work models payoff functions by distributionally robust expected values and reformulates stochastic strategy sets through distributionally robust chance constraints, resulting in a distributionally robust Nash game [8, 10, 17,18,19, 19, 20]. The existing works on distributionally robust games can be divided into two research strands. The first one includes those works that build ambiguity sets using moments, e.g., mean and covariance, whose values are captured from the empirical data. Examples of such works are [10, 17, 18] and [19]. The research works within the second strand, e.g., [8, 19, 20], define ambiguity sets based on probabilistic distance metrics, e.g., Wasserstein metric. In both strands the possible existence of a Nash equilibrium point was proven [10, 19]. In addition, [8] and [10] show the equivalence of a distributionally robust chance-constrained Nash game to a single optimization problem.

From a conceptual perspective, our work investigates a market equilibrium given ambiguity-averse market players: The article at hand offers for the first time a comprehensive problem formulation of a market in which players may be ambiguity-averse and are subject to the same source of uncertainty. Depending on the parameterization of individual Wasserstein ambiguity sets, the proposed tractable Nash game is able to model various circumstances in which all players are (i) ambiguity-neutral, (ii) homogeneously ambiguity-averse, and (iii) heterogeneously ambiguity-averse owing to individual confidence in empirical data and/or access to private empirical data.

From a methodological perspective, differently to [20] that studies a generalized distributionally robust Nash equilibrium problem with coupling constraints, we consider a pure distributionally robust Nash equilibrium problem in which market players are only linked through their payoff functions. Their decision sets are independent of each other. Similar to [8, 10] we are interested in providing an analytical proof for the existences of a Nash equilibrium point. While [8] and [10] address a general game-theoretic framework, this work relies on an affine policy, the worst-case CVaR approximation of distributionally robust chance constraints, and quadratic regularizers, and thereby, proves the existence and uniqueness of a Nash equilibrium point. Furthermore, we show that for the underlying Nash game built upon Wasserstein ambiguity sets, the Nash equilibrium point coincides with the solution of a single optimization problem that can be efficiently solved by commercial solvers. Our numerical results highlight that the realized utility of a market player with a comparatively low consumption utility highly depends on the degree of ambiguity aversion of the rival market players.

The remainder of this paper is laid out as follows. In Sect. 2 we introduce the distributionally robust Nash equilibrium problem. Section 3 provides the problem reformulation based on distributionally robust chance constraints and an affine policy. In Sect. 4 we provide a linear reformulation of distributionally robust objective functions as well as the worst-case CVaR constraints as approximation of distributionally robust chance constraints, and define a tractable Nash game. We discuss numerical results in Sect. 5. Section 6 concludes. The methodology for the linear reformulation of objective functions and the worst-case CVaR approximation of chance constraints as well as all mathematical proofs are available in four appendices. The source code is publicly available in [21].

2 Problem statement

We consider a perfectly competitive local market.Footnote 3 Four types of players exist, as illustrated in Fig. 2. The first type of players is a single price-inelastic demand, representing the aggregation of all inelastic demands—these demands are willing to buy electricity an any price. This player is a pure stochastic load without a decision variable. The second type of players corresponds to a number of price-elastic demands \(n\in \mathcal {N}\) indicated by \((\cdot )^{\text {Ed}}\), who maximize their own consumption utility. The third type of players is a single spatial arbitrageur indicated by \((\cdot )^{\text {Ar}}\), who maximizes her profit from importing and exporting the trading commodity between the local market and the outside, e.g., a wholesale market. Thereby, she ensures liquidity of the local market. The last player is a single price-setter, who is a fictitious player [22], indicated by \((\cdot )^{\text {Ps}}\), who reveals social welfare maximizing prices.

Fig. 2
figure 2

Market structure with four types of players, namely a price-inelastic stochastic demand, a number of price-elastic demands, a spatial arbitrageur and a fictitious price-setter

An example of such a market is a local energy market inside an energy community, in which a number of spatially closely located households owning rooftop photovoltaic systems with uncertain power generation trade electricity [23, 24]. Such a local market may contribute to matching electricity supply and demand without stressing the surrounding infrastructure, e.g., high-voltage transmission and low-voltage distribution networks. In addition, a local energy market would allow the direct market participation of comparatively small entities, which usually do not have access to wholesale markets. However, the efficiency of such a local market significantly depends on the uncertainty and risk aversion of the market participants [25].

We model the ambiguity-averse decision-making problem of a given player through a distributionally robust optimization problem of the form

$$\begin{aligned}&\underset{z}{\text {Min}} \ \underset{F \in \mathcal {D}}{\text {max}} \ \mathbb {E}_{F} [ g(z,\xi ) ], \end{aligned}$$
(1)

where \(g(z,\xi )\) is an uncertainty-dependent disutility function. In detail, the player in question makes the decision z in expectation \(\mathbb {E}_{F}[\cdot ]\) of her disutility \(g(z,\xi )\), given the uncertain parameter \(\xi \). This parameter follows the worst-case probability distribution F that is endogenously selected from the ambiguity set \(\mathcal {D}\). Throughout this work we indicate parameters and variables depending on the uncertain event \(\xi \) by a tilde, i.e., \(\tilde{(\cdot )}\).

2.1 Distributionally robust Nash equilibrium problem

The consumption of the price-inelastic aggregated demand is the only source of uncertainty in this work, denoted by \(\tilde{L}(\xi )\) including the one and only stochastic parameter \(\xi \).Footnote 4 Given the market-clearing price \(\tilde{\lambda }(\xi )\) under any realization of \(\xi \), this demand pays

$$\begin{aligned} \tilde{\lambda }(\xi ) \tilde{L}(\xi ). \end{aligned}$$
(2)

For the same given market-clearing price \(\tilde{\lambda }(\xi )\), each price-elastic demand n minimizes her expected disutility as

$$\begin{aligned} \Big \{ \underset{ \tilde{d}_n (\xi ) }{\text {Min}} \ \ \underset{F^{\text {Ed}}_n \in \mathcal {D}^{\text {Ed}}_n}{\text {max}} \ \ \mathbb {E}_{F^{\text {Ed}}_n} \big [ \tilde{\lambda }(\xi ) \tilde{d}_n (\xi ) - U_n \tilde{d}_n (\xi ) \big ] \end{aligned}$$
(3a)
$$\begin{aligned} \text {s.t.} \ 0 \le \tilde{d}_n (\xi ) \le \overline{D}_n \ \Big \}, \ \forall n \in \mathcal {N}, \end{aligned}$$
(3b)

where the variable \(\tilde{d}_n (\xi )\) is her consumption, whose value is enforced by (3b) to lie between zero and the maximum consumption level \(\overline{D}_n\). The parameter \(U_n\) in the objective function (3a) indicates the value of one unit of the trading commodity for demand n. Accordingly, \(U_n \tilde{d}_n (\xi )\) gives the total value that demand n gains by consuming \(\tilde{d}_n (\xi )\), whereas \(\tilde{\lambda }(\xi ) \tilde{d}_n (\xi )\) is the total payment of this price-elastic demand. This player builds the ambiguity set \(\mathcal {D}^{\text {Ed}}_n\) and minimizes her expected disutility under the worst-case probability distribution \(F^{\text {Ed}}_n\).

Similarly, the spatial arbitrageur minimizes her expected disutility as

$$\begin{aligned} \underset{ \tilde{p}(\xi ) }{\text {Min}} \ \underset{F^{\text {Ar}} \in \mathcal {D}^{\text {Ar}}}{\text {max}} \ \mathbb {E}_{F^{\text {Ar}}} \big [ C \tilde{p}(\xi ) - \tilde{\lambda }(\xi )\tilde{p}(\xi ) \big ] \end{aligned}$$
(4a)
$$\begin{aligned} \text {s.t.} - \overline{P} \le \tilde{p}(\xi ) \le \overline{P}, \end{aligned}$$
(4b)

where the variable \(\tilde{p}(\xi )\) denotes the amount of the trading commodity to be imported to—if \(\tilde{p}(\xi ) > 0\)—or exported from—if \(\tilde{p}(\xi ) < 0\)—the local market, both at an identical fixed cost C. This cost shows the price of the commodity outside the local market. If \(\tilde{p}(\xi ) > 0\), the arbitrageur buys the trading commodity outside the local market at price C and sells it back in the local market at price \(\tilde{\lambda }(\xi )\). Similarly, if \(\tilde{p}(\xi ) < 0\), the arbitrageur buys the trading commodity from the local market at price \(\tilde{\lambda }(\xi )\) and sells it back outside the local market at price C. The constraint (4b) sets the bound \(\overline{P}\) on \(\tilde{p}(\xi )\), indicating the potential capacity limit of the trade between the local and the outside market. One can hypothesize that the market-clearing price \(\tilde{\lambda }(\xi )\) will be equal to C if this constraint is non-binding, otherwise it may take a different value. The arbitrageur builds the ambiguity set \(\mathcal {D}^{\text {Ar}}\) and minimizes her expected disutility under the worst-case probability distribution \(F^{\text {Ar}}\).

Finally, for given trading decisions \(\tilde{d}_n (\xi )\) and \(\tilde{p}(\xi )\) the price-setter determines the market-clearing price \(\tilde{\lambda }(\xi )\) by maximizing the utility of all players as

$$\begin{aligned} \underset{ \tilde{\lambda }(\xi ) }{\text {Max}} \ \tilde{\lambda }(\xi ) \Big ( \tilde{p}(\xi ) - \sum _{n \in \mathcal {N}} \tilde{d}_n (\xi ) - \tilde{L}(\xi ) \Big ). \end{aligned}$$
(5)

The price-setter chooses the price \(\tilde{\lambda }(\xi )\) in (5) under any realization of \(\xi \) such that the cost for buyers is minimized and the revenue for sellers is maximized.

Recall that the price \(\tilde{\lambda }(\xi )\) is given in the optimization problem (3) of each price-elastic demand and in the optimization problem (4) of the spatial arbitrageur. In contrast, the price \(\tilde{\lambda }(\xi )\) is a variable in the optimization problem (5) of the price-setter, while variables in (3) and (4), i.e., \(\tilde{d}_n (\xi )\) and \(\tilde{p}(\xi )\), are given in (5). This makes these three problems interconnected, such that they should be solved at once.Footnote 5 The collection of optimization problems (3), (4) and (5) constitutes the distributionally robust Nash equilibrium problem.

2.2 Wasserstein ambiguity sets

This section explains how to build the ambiguity set \(\mathcal {D}^{\text {Ed}}_n\) for each elastic demand n as well as the ambiguity set \(\mathcal {D}^{\text {Ar}}\) for the spatial arbitrageur. The ambiguity set \(\mathcal {D}^{\text {Ed}}_n\) comprises all probability distributions \(F^{\text {Ed}}_n\) in the neighborhood of a central empirical probability distribution \(\widehat{F}^{\text {Ed}}_{n}\), for which \(i \in \mathcal {I}^{\text {Ed}}_n\) denotes the set of empirical samples, e.g., historical observations, available to the respective elastic demand n. Following [7], we measure the distance between a distribution \(F^{\text {Ed}}_n\) and the empirical distribution \(\widehat{F}^{\text {Ed}}_{n}\) based on the Wasserstein distance \(\varDelta ( \cdot , \cdot )\) as

$$\begin{aligned}&\varDelta ( F^{\text {Ed}}_n, \widehat{F}^{\text {Ed}}_{n} ) = \underset{\varPi ^{\text {Ed}}_n}{\text {min}} \int _{}^{} \Big ( \sum _{i \in \mathcal {I}^{\text {Ed}}_n} | \xi - \widehat{\xi }^{\text {Ed}}_{ni} |^p \Big )^{\frac{1}{p}} \varPi ^{\text {Ed}}_n ( d \xi , d \widehat{\xi }^{\text {Ed}}_{ni} ), \ \forall n, \end{aligned}$$
(6a)

in which \(\varPi ^{\text {Ed}}_n\) is a joint probability distribution of the uncertain parameter \(\xi \) and empirical data \(\widehat{\xi }^{\text {Ed}}_{ni}\) with marginals \(F^{\text {Ed}}_n\) and \(\widehat{F}^{\text {Ed}}_{n}\), respectively. The symbol p refers to an arbitrary normFootnote 6 to be applied on the difference between the uncertain parameter \(\xi \) and empirical data \(\widehat{\xi }^{\text {Ed}}_{ni}\).

Similarly, the spatial arbitrageur has access to her own individual empirical samples \(i \in \mathcal {I}^{\text {Ar}}\), which are not necessarily identical to those of other players. We measure her Wasserstein distance \(\varDelta ( \cdot , \cdot )\) as

$$\begin{aligned}&\varDelta ( F^{\text {Ar}}, \widehat{F}^{\text {Ar}}_{} ) = \underset{\varPi ^{\text {Ar}}}{\text {min}}\int _{}^{} \Big ( \sum _{i \in \mathcal {I}^{\text {Ar}}} | \xi - \widehat{\xi }^{\text {Ar}}_{i} |^p \Big )^{\frac{1}{p}} \varPi ^{\text {Ar}} ( d \xi , d \widehat{\xi }^{\text {Ar}}_{i} ). \end{aligned}$$
(6b)

We now define Wasserstein ambiguity sets \(\mathcal {D}^{\text {Ed}}_n\) and \(\mathcal {D}^{\text {Ar}}\) as

$$\begin{aligned} \mathcal {D}^{\text {Ed}}_n&= \big \{ F^{\text {Ed}}_n \in \mathcal {M} ( \varXi ) :\varDelta ( F^{\text {Ed}}_n, \widehat{F}^{\text {Ed}}_{n} ) \le \rho ^{\text {Ed}}_{n} \big \}, \ \forall n, \end{aligned}$$
(6c)
$$\begin{aligned} \mathcal {D}^{\text {Ar}}&= \big \{ F^{\text {Ar}} \in \mathcal {M} ( \varXi ) :\varDelta ( F^{\text {Ar}}, \widehat{F}^{\text {Ar}}_{} ) \le \rho ^{\text {Ar}} \big \}, \end{aligned}$$
(6d)

in which the support \(\varXi ^{\text {}} = \{ \xi \in \mathbb {R} :\underline{H} \le \xi \le \overline{H}\}\) restricts the uncertain parameter \(\xi \) by a lower bound \(\underline{H}\) and an upper bound \(\overline{H}\), such that the worst-case probability distribution takes realistic values. We assume that all players have perfect and common information about the support. Lastly, the non-negative parameters \(\rho ^{\text {Ed}}_{n}\) and \(\rho ^{\text {Ar}}\) in (6c) and (6d), the so-called Wasserstein radii, limit the distance between probability distributions \(F^{\text {Ed}}_n\) and \(F^{\text {Ar}}\) within ambiguity sets and empirical probability distributions \(\widehat{F}^{\text {Ed}}_{n}\) and \(\widehat{F}^{\text {Ar}}_{}\), respectively.

Fig. 3
figure 3

The Wasserstein ambiguity sets \(\mathcal {D}^{\text {Ed}}_n\) and \(\mathcal {D}^{\text {Ar}}\) can represent four different circumstances. In the first case there is no ambiguity, and therefore all players consider a single and common probability distribution, see plot (a). In the second case there is homogeneous ambiguity aversion among all players, see plot (b). In the third case there is heterogeneous ambiguity aversion among players owing to their individual confidences in common empirical data, see plot (c-1). Finally, in the fourth case there is heterogeneous ambiguity aversion among players owing to not only their individual confidences but also their individual empirical data, see plot (c-2)

Figure 3 illustrates the implication of empirical probability distributions \(\widehat{F}^{\text {Ed}}_{n}\) and \(\widehat{F}^{\text {Ar}}_{}\) as well as the choice of \(\rho ^{\text {Ed}}_{n}\) and \(\rho ^{\text {Ar}}\), describing the confidence in those empirical distributions, and therefore the aversion against ambiguity in the empirical data [2, 26].Footnote 7

3 Towards computational tractability

The distributionally robust Nash equilibrium problem (3)–(5) is computationally intractable, since it optimizes over infinite-dimensional variables \(\tilde{d}_n (\xi )\), \(\tilde{p}(\xi )\), and \(\tilde{\lambda }(\xi )\), subject to infinite-dimensional constraints (3b) and (4b). To achieve tractability, we apply some convex reformulations as illustrated in Fig. 4. For the sake of clarity, this figure includes the inelastic demand, although there is no optimization problem for this player. In Sect. 3.1 we use distributionally robust chance-constrained programming [7] to cope with the infinite-dimensional nature of constraints (3b) and (4b). We then introduce an affine policy [11] in Sect. 3.2 to decompose uncertainty-dependent decision variables, and analytically derive the market-clearing price in Sect. 3.3. Based on a linear reformulation of distributionally robust objective functions [7] as well as the worst-case CVaR approximation of distributionally robust chance constraints [9, 12, 27] we define a tractable Nash game.Footnote 8

Fig. 4
figure 4

By introducing distributionally robust chance constraints, applying an affine policy, and reformulating objective functions as well as approximating chance constraints, we derive a tractable Nash game corresponding to the distributionally robust Nash equilibrium problem (3)–(5)

3.1 Distributionally robust chance constraints

We consider a generic individual distributionally robust chance constraint of the form

$$\begin{aligned}&\underset{F \in \mathcal {D}}{\text {min}} \ \mathbb {P}_{F} [ h(z,\xi ) \le 0 ] \ge 1 - \epsilon , \end{aligned}$$
(7)

where the decision z is made under the worst-case probability distribution F that is endogenously determined from the given ambiguity set \(\mathcal {D}\). The probability \(\mathbb {P}_{F}[\cdot ]\) of the probabilistic constraint \(h(z,\xi ) \le 0\) to be fulfilled is greater than or equal to \( 1 - \epsilon \). Note that \(\epsilon \) is a parameter to be tuned by the respective decision-maker, whose value lies between zero and one. Accordingly, we rewrite constraints (3b) as

$$\begin{aligned}&\underset{F^{\text {Ed}}_n \in \mathcal {D}^{\text {Ed}}_n}{\text {min}} \ \mathbb {P}_{F^{\text {Ed}}_n} \big [ 0 \le \tilde{d}_n(\xi ) \big ] \ge 1 - \epsilon , \ \forall n,&\end{aligned}$$
(8a)
$$\begin{aligned}&\underset{F^{\text {Ed}}_n \in \mathcal {D}^{\text {Ed}}_n}{\text {min}} \ \mathbb {P}_{F^{\text {Ed}}_n} \big [ \tilde{d}_n(\xi ) \le \overline{D}_n \big ] \ge 1 - \epsilon , \ \forall n. \end{aligned}$$
(8b)

Similarly, constraints (4b) are rewritten as

$$\begin{aligned}&\underset{F^{\text {Ar}} \in \mathcal {D}^{\text {Ar}}}{\text {min}} \ \mathbb {P}_{F^{\text {Ar}}} \big [ - \overline{P} \le \tilde{p}(\xi ) \big ] \ge 1 - \epsilon , \end{aligned}$$
(9a)
$$\mathop {{\text{min}}}\limits_{{F^{{{\text{Ar}}}} \in {\mathcal{D}}^{{{\text{Ar}}}} }} \;{\mathbb{P}}_{{F^{{{\text{Ar}}}} }} [\tilde{p}(\xi ) \le \bar{P}] \ge 1 - \epsilon. $$
(9b)

Without loss of generality, we consider identical \(\epsilon \) in all aforementioned chance constraints.Footnote 9

3.2 Affine policy

We decompose the uncertain event, i.e., the consumption \(\tilde{L}(\xi )\) of the aggregated inelastic demand, as

$$\begin{aligned}&\tilde{L}(\xi ) = L + \xi . \end{aligned}$$
(10a)

The parameter L is the nominal, e.g., tentative, inelastic demand, which is independent of uncertainty. However, \(\xi \) is the uncertain deviation, either positive or negative, from L at a future stage. Substituting (10a) in (2) yields the consumption cost of the inelastic demand as

$$\begin{aligned} \tilde{\lambda }(\xi ) ( L + \xi ). \end{aligned}$$
(10b)

We apply an affine policy [11] to decisions made by price-elastic demands and the spatial arbitrageur. Accordingly, the probabilistic decision variables \(\tilde{d}_{n}(\xi )\) and \(\tilde{p}(\xi )\) are approximated by

$$\begin{aligned} \tilde{d}_{n}(\xi )&= d_n - \alpha ^{\text {Ed}}_n \xi , \ \forall n, \end{aligned}$$
(10c)
$$\begin{aligned} \tilde{p}(\xi )&= p + \alpha ^{\text {Ar}} \xi , \end{aligned}$$
(10d)

where variables \(d_n\) and p are nominal trades given the expected inelastic demand L. In addition, the free variables, i.e., either positive or negative, \(\alpha ^{\text {Ed}}_n\) and \(\alpha ^{\text {Ar}}\), the so-called participation factors, are in per-unit and show the linear response of the price-elastic demand n and the spatial arbitrageur at a future stage to the uncertain deviation \(\xi \), respectively. In other words, they indicate the contribution of the corresponding player to offset any supply–demand imbalance at the future stage, when the uncertainty \(\xi \) is realized. For example, consider a deviation \(\xi > 0\), meaning that the realized consumption of the inelastic demand is more than the tentative one. According to (10c) and (10d), the price-elastic demand n and the spatial arbitrageur would respond to this deviation by decreased consumption—ensured by the minus in (10c)—and by additional imports—enforced by the plus in (10d)—, respectively.

By introducing distributionally robust chance constraints (8a) and (8b), and by applying the affine policy used in (10c), problem (3) of each price-elastic demand n reads

$$\left\{ {\mathop {{\text{Min}}}\limits_{{d_{n} ,\alpha _{n}^{{Ed}} }} \mathop {\max }\limits_{{F_{n}^{{Ed}} \in{\mathcal{D}}_{n}^{{Ed}} }} {\mathbb{E}}_{{F_{n}^{{Ed}} }} {\text{ }}\left[ {\left( {\tilde{\lambda }(\xi ) - U_{n} } \right)\left( {d_{n} - \alpha _{n}^{{Ed}} \xi } \right)} \right]} \right. $$
(11a)
$$\begin{aligned} \text {s.t.} \ \underset{F^{\text {Ed}}_n \in \mathcal {D}^{\text {Ed}}_n}{\text {min}} \ \mathbb {P}_{F^{\text {Ed}}_n} \left [ 0 \le (d_n - \alpha ^{\text {Ed}}_n \xi ) \right ] \ge 1 - \epsilon ,&\end{aligned}$$
(11b)
$$\begin{aligned} \underset{F^{\text {Ed}}_n \in \mathcal {D}^{\text {Ed}}_n}{\text {min}} \ \mathbb {P}_{F^{\text {Ed}}_n} \left [ (d_n - \alpha ^{\text {Ed}}_n \xi ) \le \overline{D}_n \right ] \ge 1 - \epsilon \ \Big \}, \ \forall n . \end{aligned}$$
(11c)

Similarly, we rewrite problem (4) of the spatial arbitrageur using (9a), (9b), and (10d) as

$$\begin{aligned} \underset{ p, \alpha ^{\text {Ar}} }{\text {Min}} \ \underset{F^{\text {Ar}} \in \mathcal {D}^{\text {Ar}}}{\text {max}} \ \mathbb {E}_{F^{\text {Ar}}} \left [ \left (C- \tilde{\lambda }(\xi ) \right ) \left ( p + \alpha ^{\text {Ar}} \xi \right ) \right ] \end{aligned}$$
(12a)
$$\begin{aligned} \text {s.t.} \ \underset{F^{\text {Ar}} \in \mathcal {D}^{\text {Ar}}}{\text {min}} \ \mathbb {P}_{F^{\text {Ar}}} \left [ - \overline{P} \le p + \alpha ^{\text {Ar}} \xi \right ] \ge 1 - \epsilon , \end{aligned}$$
(12b)
$$\mathop {\min }\limits_{{F^{{{\text{Ar}}}} \in {\mathcal{D}}^{{{\text{Ar}}}} }} \;{\mathbb{P}}_{{F^{{{\text{Ar}}}} }} [p + \alpha ^{{{\text{Ar}}}} \xi \le \overline{P}] \ge 1 - \epsilon . $$
(12c)

Lastly, substituting (10a), (10c), and (10d) in (5) yields

$$\begin{aligned} \underset{ \tilde{\lambda }( \xi ) }{\text {Max}} \ \tilde{\lambda }(\xi ) \left ( p + \alpha ^{\text {Ar}} \xi - \sum _{n \in \mathcal {N}} ( d_n - \alpha ^{\text {Ed}}_n \xi ) - L - \xi \right ) . \end{aligned}$$
(13)

3.3 Analytical derivation of market-clearing prices

This section focuses on the unconstrained problem (13), whose optimality condition imposes

$$\begin{aligned} { \frac{\partial \mathcal {L}^{(13)}}{\partial \tilde{\lambda }(\xi ) } = } ( p + \alpha ^{\text {Ar}} \xi ) - \sum _{n \in \mathcal {N}} ( d_n - \alpha ^{\text {Ed}}_n \xi ) - ( L + \xi ) = 0, \end{aligned}$$
(14a)

where \(\mathcal {L}^{(13)}\) denotes the Lagrangian function of (13). Given the response of the spatial arbitrageur \(\alpha ^{\text {Ar}}\) as well as the response of elastic demands \(\alpha ^{\text {Ed}}_n, \forall n\), the equality constraint (14a) holds true for any realization of \(\xi \) if

$$\begin{aligned} { \alpha ^{\text {Ar}} \xi + \sum _{n \in \mathcal {N}} \alpha ^{\text {Ed}}_n \xi = \xi \Leftrightarrow } \ \alpha ^{\text {Ar}} + \sum _{n \in \mathcal {N}} \alpha ^{\text {Ed}}_n = 1, \end{aligned}$$
(14b)
$$\begin{aligned} p - \sum _{n \in \mathcal {N}} d_n - L = 0. \end{aligned}$$
(14c)

The equality constraints (14b) and (14c) are derived by separating \(\xi \)-dependent uncertain and \(\xi \)-independent nominal terms in (14a). Thereby, the equality constraints (14b) imposes that the total response of the spatial arbitrageur and the price-elastic demands should be able to fully offset the supply–demand imbalance at the future stage.Footnote 10 In addition, the equality constraint (14c) imposes that all nominal demands should be fully supplied.

The analytical procedure from (13) to (14b)-(14c) suggests that one could also decompose the probabilistic market-clearing price \(\tilde{\lambda }(\xi )\) to two deterministic variables \(\lambda ^{\text {B}}\) and \(\lambda ^{\text {E}}\). Therefore, we rewrite the optimization problem (13) of the price-setter by a collection of two deterministic optimization problems as

$$\mathop {{\text{Max}}}\limits_{{\lambda ^{{\text{B}}} }} \lambda ^{{\text{B}}} \left( {\alpha ^{{{\text{Ar}}}} + \sum\limits_{{n \in {\mathcal{N}}}} {\alpha _{n}^{{{\text{Ed}}}} } - 1} \right), $$
(14d)
$$\mathop {{\text{Max}}}\limits_{{\lambda ^{{\text{E}}} }} \lambda ^{{\text{E}}} \left( {p - \sum\limits_{{n \in {\mathcal{N}}}} {d_{n} } - L} \right). $$
(14e)

Since the optimality conditions of (14d) and (14e) are identical to the equality constraints (14b) and (14c), any \(\lambda ^{\text {E}}\) and \(\lambda ^{\text {B}}\) are optimal solutions of (14d) and (14e) as long as these optimality conditions are fulfilled. The variable \(\lambda ^{\text {E}}\) provides the deterministic market-clearing price for the underlying commodity. In addition, \(\lambda ^{\text {B}}\) provides the payment due to balancing services, i.e., the payment to remunerate price-elastic demands and the spatial arbitrageur for their response to any supply–demand imbalance.

Eventually, given that (14b) and (14c) hold, we can replace the terms including the price \(\tilde{\lambda }(\xi )\) in (10b), (11a) and (12a) as

$$\begin{aligned}&\tilde{\lambda }(\xi ) L = \lambda ^{\text {E}} L;&\tilde{\lambda }(\xi ) \xi = \lambda ^{\text {B}}, \end{aligned}$$
(15a)
$$\begin{aligned}&\tilde{\lambda }(\xi ) d_n = \lambda ^{\text {E}} d_n;&\tilde{\lambda }(\xi ) \alpha ^{\text {Ed}}_n \xi = \lambda ^{\text {B}} \alpha ^{\text {Ed}}_n, \end{aligned}$$
(15b)
$$\begin{aligned}&\tilde{\lambda }(\xi ) p = \lambda ^{\text {E}} p;&\tilde{\lambda }(\xi ) \alpha ^{\text {Ar}} \xi = \lambda ^{\text {B}} \alpha ^{\text {Ar}}. \end{aligned}$$
(15c)

4 A tractable Nash game

We revisit our distributionally robust Nash equilibrium problem given the analytical prices derived in Sect. 3.3.

4.1 Price-inelastic demand

The payment of the inelastic demand (10b) recasts as

$$\begin{aligned} \lambda ^{\text {E}} L + \lambda ^{\text {B}} , \end{aligned}$$
(16)

indicating that the inelastic demand is charged at the price \(\lambda ^{\text {E}}\) for the nominal consumption L. In addition, she pays \(\lambda ^{\text {B}}\) for the balancing services, as she deviates \(\xi \) from her nominal consumption L.

4.2 Price-elastic demand

Next, we revisit the optimization problem (11) of the price-elastic demand n. Pursuing an equilibrium solution existence and uniqueness, we make two slight changes. First, we arbitrarily introduce theoretical lower and upper bound A on the participation factor \(\alpha _n\). The rationale behind these bounds is to achieve a compact and closed strategy set, which is required later for the equilibrium solution existence proof. However, we select sufficiently large values for these bounds, and check a posteriori that these constraints are non-binding. Second, we add a quadratic regularizer [28] in the form of \(c(z,x) = \frac{1}{2} \beta (z + x )^2\) to the objective function, in which \(\beta \) is a sufficiently small positive constant, e.g., \(10^{-3}\). A sufficiently small value for \(\beta \) will alter negligibly the social welfare of the market in comparison to \(\beta =0\). However, this quadratic regularizer, which can be institutionally interpreted as a transaction cost arising from trades, ensures an identical payoff for identical players. In addition, this regularizer yields a strongly monotone objective function, which is necessary later to achieve a unique equilibrium solution. The revisited problem (11) writes as

$$\begin{aligned} \Big \{ \underset{ d_n, \alpha ^{\text {Ed}}_n }{\text {Min}} &\big ( \lambda ^{\text {E}} - U_n \big ) d_n - \lambda ^{\text {B}} \alpha ^{\text {Ed}}_n + c ( d_n, \alpha ^{\text {Ed}}_n ) + \underset{F^{\text {Ed}}_n \in \mathcal {D}^{\text {Ed}}_n}{\text {max}} \mathbb {E}_{F^{\text {Ed}}_n} \big [ U_n \alpha ^{\text {Ed}}_n \xi \big ] \end{aligned}$$
(17a)
$$\begin{aligned} \text {s.t.} \ (11b) \text {--} (11c), \end{aligned}$$
(17b)
$$\begin{aligned}&- A \le \alpha ^{\text {Ed}}_n \le A \ \Big \}, \ \forall n, \end{aligned}$$
(17c)

in which the last \(\xi \)-dependent term in the objective function (17a) as well as the distributionally robust chance constraints (11b) and (11c) make the problem still intractable. We follow the convex reformulation technique proposed in [7] for a distributionally robust objective function. In addition, we use the worst-case CVaR constraints as an approximation of distributionally robust chance constraints [9, 12], and therefore, provide—except of the regularizer \(c( d_n,\alpha ^{\text {Ed}}_n )\) in the objective function—a purely linear approximation for (17).

Based on (22) and (23), we write the decision-making problem of the elastic demand n as

$$\begin{aligned} \Big \{ \underset{ \varXi ^{\text {Ed}}_n }{\text {Min}} \ J^{\text {Ed}}_n = \left ( \lambda ^{\text {E}} - U_n \right ) d_n - \lambda ^{\text {B}} \alpha ^{\text {Ed}}_n + c( d_n,\alpha ^{\text {Ed}}_n ) + \phi ^{\text {Ed}}_n \rho ^{\text {Ed}}_n + \frac{1}{|\mathcal {I}^{\text {Ed}}_n|} \sum _{i \in \mathcal {I}^{\text {Ed}}_n} \sigma ^{\text {Ed}}_{ni} \end{aligned}$$
(18a)

Reformulation of (17a):

$$\begin{aligned}& \text {s.t.} \ U_n \alpha ^{\text {Ed}}_n \widehat{\xi }^{\text {Ed}}_{ni} + \sum _{b \in \mathcal {B}} \gamma ^{\text {Ed}}_{nbi} \left ( H_{b} - Q_{b} \widehat{\xi }^{\text {Ed}}_{ni} \right ) \le \sigma ^{\text {Ed}}_{ni} \ :\ \ \zeta ^{\text {Ed.1a}}_{ni}, \forall i, \end{aligned}$$
(18b)
$$\begin{aligned}&- \phi ^{\text {Ed}}_n \le \sum _{b \in \mathcal {B}} Q_{b} \gamma ^{\text {Ed}}_{nbi} - U_n \alpha ^{\text {Ed}}_n \le \phi ^{\text {Ed}}_n \ :\ \underline{\zeta }^{\text {Ed.1b}}_{ni}, \overline{\zeta }^{\text {Ed.1b}}_{ni}, \forall i, \end{aligned}$$
(18c)
$$\begin{aligned}&0 \le \gamma ^{\text {Ed}}_{nbi} \ :\ \zeta ^{\text {Ed.1c}}_{nbi}, \forall b,i, \end{aligned}$$
(18d)

CVaR approximation of (11b):

$$\begin{aligned}&\underline{\tau }^{\text {Ed}}_n + \frac{1}{\epsilon } \big ( \underline{\phi }^{\text {Ed}}_n \rho ^{\text {Ed}}_n + \frac{1}{|\mathcal {I}^{\text {Ed}}_n|} \sum _{i \in \mathcal {I}^{\text {Ed}}_n} \underline{\sigma }^{\text {Ed}}_{ni} \big ) \le 0 \ :\ \zeta ^{\text {Ed.2a}}_{n}, \end{aligned}$$
(18e)
$$\begin{aligned} - d_n + \alpha ^{\text {Ed}}_n \widehat{\xi }^{\text {Ed}}_{ni} - \underline{\tau }^{\text {Ed}}_n + \sum _{b \in \mathcal {B}} \underline{\gamma }^{\text {Ed1}}_{nbi} \left ( H_{b} - Q_{b} \widehat{\xi }^{\text {Ed}}_{ni} \right ) \le \underline{\sigma }^{\text {Ed}}_{ni} :\zeta ^{\text {Ed.2b}}_{ni}, \forall i, \end{aligned}$$
(18f)
$$\begin{aligned} \sum _{b \in \mathcal {B}} \underline{\gamma }^{\text {Ed2}}_{nbi} \left ( H_{b} - Q_{b} \widehat{\xi }^{\text {Ed}}_{ni} \right ) \le \underline{\sigma }^{\text {Ed}}_{ni} \ :\ \zeta ^{\text {Ed.2c}}_{ni},& \forall i, \end{aligned}$$
(18g)
$$\begin{aligned} - \underline{\phi }^{\text {Ed}}_n \le \sum _{b \in \mathcal {B}} Q_{b} \underline{\gamma }^{\text {Ed1}}_{nbi} - \alpha ^{\text {Ed}}_n \le \underline{\phi }^{\text {Ed}}_n \ :\ \underline{\zeta }^{\text {Ed.2d}}_{ni}, \overline{\zeta }^{\text {Ed.2d}}_{ni}, \forall i, \end{aligned}$$
(18h)
$$\begin{aligned}&- \underline{\phi }^{\text {Ed}}_n \le \sum _{b \in \mathcal {B}} Q_{b} \underline{\gamma }^{\text {Ed2}}_{nbi} \le \underline{\phi }^{\text {Ed}}_n \ :\ \underline{\zeta }^{\text {Ed.2e}}_{ni}, \overline{\zeta }^{\text {Ed.2e}}_{ni},& \forall i, \end{aligned}$$
(18i)
$$\begin{aligned}&0 \le \underline{\gamma }^{\text {Ed1}}_{nbi} \ :\ \zeta ^{\text {Ed.2f}}_{nbi},& \forall b,i, \end{aligned}$$
(18j)
$$\begin{aligned}&0 \le \underline{\gamma }^{\text {Ed2}}_{nbi} \ :\ \zeta ^{\text {Ed.2g}}_{nbi},& \forall b,i, \end{aligned}$$
(18k)

CVaR approximation of (11c):

$$\begin{aligned}&\overline{\tau }^{\text {Ed}}_n + \frac{1}{\epsilon } \left ( \overline{\phi }^{\text {Ed}}_n \rho ^{\text {Ed}}_n + \frac{1}{|\mathcal {I}^{\text {Ed}}_n|} \sum _{i \in \mathcal {I}^{\text {Ed}}_n} \overline{\sigma }^{\text {Ed}}_{ni} \right ) \le 0 \ :\ \zeta ^{\text {Ed.3a}}_{n}, \end{aligned}$$
(18l)
$$\begin{aligned}&d_n - \alpha ^{\text {Ed}}_n \widehat{\xi }^{\text {Ed}}_{ni} - \overline{D}_n - \overline{\tau }^{\text {Ed}}_n + \sum _{b \in \mathcal {B}} \overline{\gamma }^{\text {Ed1}}_{nbi} \big ( H_{b} - Q_{b} \widehat{\xi }^{\text {Ed}}_{ni} \big ) \le \overline{\sigma }^{\text {Ed}}_{ni} : \zeta ^{\text {Ed.3b}}_{ni},& \forall i, \end{aligned}$$
(18m)
$$\begin{aligned}&\sum _{b \in \mathcal {B}} \overline{\gamma }^{\text {Ed2}}_{nbi} \big ( H_{b} - Q_{b} \widehat{\xi }^{\text {Ed}}_{ni} \big ) \le \overline{\sigma }^{\text {Ed}}_{ni} \ :\ \zeta ^{\text {Ed.3c}}_{ni},& \forall i, \end{aligned}$$
(18n)
$$\begin{aligned}&- \overline{\phi }^{\text {Ed}}_n \le \sum _{b \in \mathcal {B}} Q_{b} \overline{\gamma }^{\text {Ed1}}_{nbi} + \alpha ^{\text {Ed}}_n \le \overline{\phi }^{\text {Ed}}_n \ :\ \underline{\zeta }^{\text {Ed.3d}}_{ni}, \overline{\zeta }^{\text {Ed.3d}}_{ni},& \forall i, \end{aligned}$$
(18o)
$$\begin{aligned}&- \overline{\phi }^{\text {Ed}}_n \le \sum _{b \in \mathcal {B}} Q_{b} \overline{\gamma }^{\text {Ed2}}_{nbi} \le \overline{\phi }^{\text {Ed}}_n \ :\ \underline{\zeta }^{\text {Ed.3e}}_{ni}, \overline{\zeta }^{\text {Ed.3e}}_{ni},& \forall i, \end{aligned}$$
(18p)
$$\begin{aligned}&0 \le \overline{\gamma }^{\text {Ed1}}_{nbi} \ :\ \zeta ^{\text {Ed.3f}}_{nbi},& \forall b,i, \end{aligned}$$
(18q)
$$\begin{aligned}&0 \le \overline{\gamma }^{\text {Ed2}}_{nbi} \ :\ \zeta ^{\text {Ed.3g}}_{nbi},& \forall b,i, \end{aligned}$$
(18r)

Constraint (17c):

$$\begin{aligned}&- A \le \alpha ^{\text {Ed}}_n \le A \ :\ \underline{\zeta }^{\text {Ed.4a}}_{n}, \overline{\zeta }^{\text {Ed.4a}}_{n}& \Big \}, \ \forall n, \end{aligned}$$
(18s)

where \(\varXi ^{\text {Ed}}_n = \{ d_n, \alpha ^{\text {Ed}}_n, \phi ^{\text {Ed}}_n, \sigma ^{\text {Ed}}_{ni}, \gamma ^{\text {Ed}}_{nbi}, \underline{\tau }^{\text {Ed}}_n,\) \(\underline{\phi }^{\text {Ed}}_n,\) \(\underline{\sigma }^{\text {Ed}}_{ni},\) \(\underline{\gamma }^{\text {Ed1}}_{nbi},\) \(\underline{\gamma }^{\text {Ed2}}_{nbi},\) \(\overline{\tau }^{\text {Ed}}_n,\) \(\overline{\phi }^{\text {Ed}}_n, \overline{\sigma }^{\text {Ed}}_{ni},\) \(\overline{\gamma }^{\text {Ed1}}_{nbi},\) \(\overline{\gamma }^{\text {Ed2}}_{nbi} \}, \ \forall n \in \mathcal {N}\), and \(|\mathcal {I}^{\text {Ed}}_n|\) returns the cardinality of set \(\mathcal {I}^{\text {Ed}}_n\). Symbols followed a colon denote the dual variable of the respective constraint. We will need those dual variables later when we derive the Karush-Kuhn-Tucker conditions in Appendix C.2.

4.3 Spatial arbitrageur

Similarly, we revisit the optimization problem (12) of the spatial arbitrageur, yielding

$$\begin{aligned} \underset{ p, \alpha ^{\text {Ar}} }{\text {Min}} \big ( C - \lambda ^{\text {E}} \big ) p - \lambda ^{\text {B}} \alpha ^{\text {Ar}} + c(p,\alpha ^{\text {Ar}}) + \underset{F^{\text {Ar}} \in \mathcal {D}^{\text {Ar}}}{\text {max}} \mathbb {E}_{F^{\text {Ar}}} \big [ C \alpha ^{\text {Ar}} \xi \big ] \end{aligned}$$
(19a)
$$\begin{aligned} \text {s.t.} (12a) \text {--} (12b), \end{aligned}$$
(19b)
$$-A \le \alpha^{ar} \le A $$
(19c)

whose linear approximation writes as

$$\begin{aligned} \underset{ \varXi ^{\text {Ar}} }{\text {Min}}&\ J^{\text {Ar}} = \big ( C - \lambda ^{\text {E}} \big ) p - \lambda ^{\text {B}} \alpha ^{\text {Ar}} + c(p,\alpha ^{\text {Ar}}) + \phi ^{\text {Ar}} \rho ^{\text {Ar}} + \frac{1}{|\mathcal {I}^{\text {Ar}}|} \sum _{i \in \mathcal {I}^{\text {Ar}}} \sigma ^{\text {Ar}}_{i} \end{aligned}$$
(20a)

Reformulation of (19a):

$$\begin{aligned}&\text {s.t.} \ C \alpha ^{\text {Ar}} \widehat{\xi }^{\text {Ar}}_i + \sum _{b \in \mathcal {B}} \gamma ^{\text {Ar}}_{bi} \big ( H_{b} - Q_{b} \widehat{\xi }^{\text {Ar}}_i \big ) \le \sigma ^{\text {Ar}}_i \ :\ \zeta ^{\text {Ar.1a}}_{i},& \forall i, \end{aligned}$$
(20b)
$$\begin{aligned}&- \phi ^{\text {Ar}} \le \sum _{b \in \mathcal {B}} Q_{b} \gamma ^{\text {Ar}}_{bi} - C \alpha ^{\text {Ar}} \le \phi ^{\text {Ar}} \ :\ \underline{\zeta }^{\text {Ar.1b}}_{i}, \overline{\zeta }^{\text {Ar.1b}}_{i},& \forall i, \end{aligned}$$
(20c)
$$\begin{aligned}&0 \le \gamma ^{\text {Ar}}_{bi} \ :\ \zeta ^{\text {Ar.1c}}_{bi},& \forall b,i \end{aligned}$$
(20d)

CVaR approximation of (12a):

$$\begin{aligned}&\underline{\tau }^{\text {Ar}} + \frac{1}{\epsilon } \big ( \underline{\phi }^{\text {Ar}} \rho ^{\text {Ar}} + \frac{1}{|\mathcal {I}^{\text {Ar}}|} \sum _{i \in \mathcal {I}^{\text {Ar}}} \underline{\sigma }^{\text {Ar}}_{i} \big ) \le 0 \ :\ \zeta ^{\text {Ar.2a}}_{}, \end{aligned}$$
(20e)
$$\begin{aligned}&- \overline{P} - p - \alpha ^{\text {Ar}} \widehat{\xi }^{\text {Ar}}_{i} - \underline{\tau }^{\text {Ar}} + \sum _{b \in \mathcal {B}} \underline{\gamma }^{\text {Ar1}}_{bi} \big ( H_{b} - Q_{b} \widehat{\xi }^{\text {Ar}}_i \big ) \le \underline{\sigma }^{\text {Ar}}_{i} :\zeta ^{\text {Ar.2b}}_{i},& \forall i, \end{aligned}$$
(20f)
$$\begin{aligned}&\sum _{b \in \mathcal {B}} \underline{\gamma }^{\text {Ar2}}_{bi} \big ( H_{b} - Q_{b} \widehat{\xi }^{\text {Ar}}_i \big ) \le \underline{\sigma }^{\text {Ar}}_{i} \ :\ \zeta ^{\text {Ar.2c}}_{i},& \forall i, \end{aligned}$$
(20g)
$$\begin{aligned}&- \underline{\phi }^{\text {Ar}} \le \sum _{b \in \mathcal {B}} Q_{b} \underline{\gamma }^{\text {Ar1}}_{bi} + \alpha ^{\text {Ar}} \le \underline{\phi }^{\text {Ar}} \ :\ \underline{\zeta }^{\text {Ar.2d}}_{i}, \overline{\zeta }^{\text {Ar.2d}}_{i},& \forall i, \end{aligned}$$
(20h)
$$\begin{aligned}&- \underline{\phi }^{\text {Ar}} \le \sum _{b \in \mathcal {B}} Q_{b} \underline{\gamma }^{\text {Ar2}}_{bi} \le \underline{\phi }^{\text {Ar}} \ :\ \underline{\zeta }^{\text {Ar.2e}}_{i}, \overline{\zeta }^{\text {Ar.2e}}_{i},& \forall i, \end{aligned}$$
(20i)
$$\begin{aligned}&0 \le \underline{\gamma }^{\text {Ar1}}_{bi} \ :\ \zeta ^{\text {Ar.2f}}_{bi},& \forall b,i, \end{aligned}$$
(20j)
$$\begin{aligned}&0 \le \underline{\gamma }^{\text {Ar2}}_{bi} \ :\ \zeta ^{\text {Ar.2g}}_{bi},& \forall b,i, \end{aligned}$$
(20k)

CVaR approximation of (12c):

$$\begin{aligned}&\overline{\tau }^{\text {Ar}} + \frac{1}{\epsilon } \big ( \overline{\phi }^{\text {Ar}} \rho ^{\text {Ar}} + \frac{1}{|\mathcal {I}^{\text {Ar}}|} \sum _{i \in \mathcal {I}^{\text {Ar}}} \overline{\sigma }^{\text {Ar}}_{i} \big ) \le 0 \ :\ \zeta ^{\text {Ar.3a}}_{}, \end{aligned}$$
(20l)
$$\begin{aligned}&p + \alpha ^{\text {Ar}} \widehat{\xi }^{\text {Ar}}_{i} - \overline{P} - \overline{\tau }^{\text {Ar}} + \sum _{b \in \mathcal {B}} \overline{\gamma }^{\text {Ar1}}_{bi} \big ( H_{b} - Q_{b} \widehat{\xi }^{\text {Ar}}_i \big ) \le \overline{\sigma }^{\text {Ar}}_{i} :\zeta ^{\text {Ar.3b}}_{i},& \forall i, \end{aligned}$$
(20m)
$$\begin{aligned}&\sum _{b \in \mathcal {B}} \overline{\gamma }^{\text {Ar2}}_{bi} \big ( H_{b} - Q_{b} \widehat{\xi }^{\text {Ar}}_i \big ) \le \overline{\sigma }^{\text {Ar}}_{i} \ :\ \zeta ^{\text {Ar.3c}}_{i},& \forall i, \end{aligned}$$
(20n)
$$\begin{aligned}&- \overline{\phi }^{\text {Ar}} \le \sum _{b \in \mathcal {B}} Q_{b} \overline{\gamma }^{\text {Ar1}}_{bi} - \alpha ^{\text {Ar}} \le \overline{\phi }^{\text {Ar}} \ :\ \underline{\zeta }^{\text {Ar.3d}}_{i}, \overline{\zeta }^{\text {Ar.3d}}_{i},& \forall i, \end{aligned}$$
(20o)
$$\begin{aligned}&- \overline{\phi }^{\text {Ar}} \le \sum _{b \in \mathcal {B}} Q_{b} \overline{\gamma }^{\text {Ar2}}_{bi} \le \overline{\phi }^{\text {Ar}} \ :\ \underline{\zeta }^{\text {Ar.3e}}_{i}, \overline{\zeta }^{\text {Ar.3e}}_{i},& \forall i, \end{aligned}$$
(20p)
$$\begin{aligned}&0 \le \overline{\gamma }^{\text {Ar1}}_{bi} \ :\ \zeta ^{\text {Ar.3f}}_{bi},& \forall b,i, \end{aligned}$$
(20q)
$$\begin{aligned}&0 \le \overline{\gamma }^{\text {Ar2}}_{bi} \ :\ \zeta ^{\text {Ar.3g}}_{bi},& \forall b,i, \end{aligned}$$
(20r)

Constraint (19c):

$$\begin{aligned}&\nonumber \\&- A \le \alpha ^{\text {Ar}} \le A \ :\ \underline{\zeta }^{\text {Ar.4a}}_{}, \overline{\zeta }^{\text {Ar.4a}}_{}, \end{aligned}$$
(20s)

where \(\varXi ^{\text {Ar}} = \{ p, \alpha ^{\text {Ar}}, \phi ^{\text {Ar}},\) \(\sigma ^{\text {Ar}}_i,\) \(\gamma ^{\text {Ar}}_{bi},\) \(\underline{\tau }^{\text {Ar}},\) \(\underline{\phi }^{\text {Ar}},\) \(\underline{\sigma }^{\text {Ar}}_{i},\) \(\underline{\gamma }^{\text {Ar1}}_{bi},\underline{\gamma }^{\text {Ar2}}_{bi},\) \(\overline{\tau }^{\text {Ar}},\) \(\overline{\phi }^{\text {Ar}},\) \(\overline{\sigma }^{\text {Ar}}_{i},\) \(\overline{\gamma }^{\text {Ar1}}_{bi},\) \(\overline{\gamma }^{\text {Ar2}}_{bi} \}\).

4.4 Price-setter

Lastly, the optimization problem (13) of the price-setter is revisited by a deterministic problem comprising (14d) and (14e), but with theoretical constraints. This optimization problem writes as

$$\begin{aligned} \underset{ \lambda ^{\text {E}}, \lambda ^{\text {B}} }{\text {Max}} \ J^{\text {Ps}} = \lambda ^{\text {E}} \Big ( p - \sum _{n \in \mathcal {N}} d_n - L \Big ) + \lambda ^{\text {B}} \Big ( \alpha ^{\text {Ar}} + \sum _{n \in \mathcal {N}} \alpha ^{\text {Ed}}_n - 1 \Big ) \end{aligned}$$
(21a)
$$\begin{aligned} \text {s.t.} - \varLambda \le \lambda ^{\text {E}} \le \varLambda \ {:\ \underline{\zeta }^{\text {Ps.E}}_{}, \overline{\zeta }^{\text {Ps.E}}_{}}, \end{aligned}$$
(21b)
$$\begin{aligned}&- \varLambda \le \lambda ^{\text {B}} \le \varLambda \ {:\ \underline{\zeta }^{\text {Ps.B}}_{}, \overline{\zeta }^{\text {Ps.B}}_{}}. \end{aligned}$$
(21c)

Recall that the sufficiently large parameter \(\varLambda \) constitutes theoretical bounds, such that the feasible set is closed and compact, which is required later for the proof of the equilibrium solution existence. In our numerical study, we check a posteriori that these bounds are inactive.

Definition 1

Based on the decision-making problems (18), (20), and (21), we define the tractable Nash game \(\varGamma (\mathcal {Z},K,\{J_i\}_{\forall i \in \mathcal {Z}})\) corresponding to the distributionally robust Nash equilibrium problem (3), (4), and (5). The symbol \(\mathcal {Z}\) is the set of all players, and \(J_i\) their respective payoff function, i.e., \(\{ \{J^{\text {Ed}}_{n}\}_{\forall n \in \mathcal {N}}, J^{\text {Ar}}, J^{\text {Ps}}\}\). The symbol \(K = ( K^{\text {Ed}}_{n_1} \times \cdots \times K^{\text {Ed}}_{N} \times K^{\text {Ar}} \times K^{\text {Ps}} )\) denotes the strategy set of the game, where \(K^{\text {Ed}}_{n}\) is the strategy set of the price-elastic demand \(n \in \mathcal {N}\), \(K^{\text {Ar}}\) is the strategy set of the spatial arbitrageur, and lastly \(K^{\text {Ps}}\) is the strategy set of the price-setter.

Proposition 1

For the Nash game \(\varGamma (\mathcal {Z},K,\{J_i\}_{\forall i \in \mathcal {Z}})\) a Nash equilibrium point exists.

Proof 1

We provide the proof in Appendix B. \(\square \)

Proposition 2

For the Nash game \(\varGamma (\mathcal {Z},K,\{J_i\}_{\forall i \in \mathcal {Z}})\) an equivalent convex optimization problem exists, whose global solution is unique and, thereby, gives a unique Nash equilibrium point.

Proof 2

We provide the proof in Appendix C. \(\square \)

Remark 1

Note that our proofs rely on the affine policy, the worst-case CVaR approximation of distributionally robust chance constraints,Footnote 11 and the quadratic regularizer. In detail, the affine policy allows for a linear reformulation of distributionally robust objective functions, and—along with the worst-case CVaR approximation—the definition of a tractable and convex Nash game. The quadratic regularizer is needed to obtain strict monotonicity of players’ preferences, which we take advantage of to prove uniqueness of the Nash equilibrium point.

Remark 2

This article generalizes the findings in [3] by showing that although different players may have access to different empirical data and are heterogeneously ambiguity-averse, an equivalent optimization to the competitive market equilibrium problem still exists.

5 Numerical results and discussion

This section numerically analyzes the implications of heterogeneous ambiguity aversion on local market-clearing outcomes. To identify the Nash equilibrium point, i.e., market-clearing outcomes, we solve the single optimization problem (26), which is—according to Proposition 2—equivalent to the Nash game \(\varGamma (\mathcal {Z},K,\{J_i\}_{\forall i \in \mathcal {Z}})\). This optimization problem is a convex quadratic program that can be solved by available commercial solvers such as the Gurobi Optimizer or the IBM CPLEX Optimizer. Without the quadratic regularizer in the objective function, this single optimization problem becomes a linear program. All source codes are available in our online companion [21].

Let us consider a local market for a general commodity. Figure 5 illustrates the players in the game as well the arbitrarily selected input data. In detail, a spatial arbitrageur is restricted to import and export a given commodity up to a maximum quantity \(\overline{P}\) of 30 units at a fixed cost C of €0.5 per unit. This restriction is imposed by the physical network constraints. Two elastic demands, namely \(n_1\) and \(n_2\), may consume a maximum quantity \(\overline{D}_{n}\) of 10 units each. The elastic demand \(n_1\) gains a utility \(U_{n_1}\) of €0.6 per unit, while \(n_2\) earns a slightly higher utility \(U_{n_2}\) of €0.7 per unit. The aggregated inelastic demand expects to consume \(L = 15\) units, while her uncertain deviation \(\xi \) follows a multivariate Gaussian distribution \(N(\mu , \sigma )\), with a mean of \(\mu = 0\) and a standard deviation of \(\sigma = 3\).

Fig. 5
figure 5

Case study: A local market with two elastic demands, namely \(n_1\) (green) and \(n_2\) (blue), an aggregated inelastic demand (yellow), and the spatial arbitrageur (red). The maximum consumption as well as the import/export capacity are given in units (u.). The import cost and export revenue as well as the consumption utility are expressed in € per unit (€ p.u.)

From \(N(\mu , \sigma )\) we draw \(10^{5}\) random samples, and provide the spatial arbitrageur as well as the elastic demands \(n_1\) and \(n_2\) with 500 randomly selected samples, the so-called training data. These training samples for different players are not necessarily identical. We will use \(10^{4}\) number of the remaining samples later as test data. Given the training data, we solve the Nash equilibrium problem and determine the optimal values for quantities p\(d_{n_1}\)\(d_{n_2}\), participation factors \(\alpha ^{\text {Ar}}\)\(\alpha ^{\text {Ed}}_{n_1}\)\(\alpha ^{\text {Ed}}_{n_2}\), price \(\lambda ^{\text {E}}\) and balancing service payment \(\lambda ^{\text {B}}\). Given the test data, we compute a posteriori the expected out-of-sample disutility of the players. Note that we do not solve another optimization problem for the out-of-sample computations, since the optimal values of the participation factors have been already determined.Footnote 12 We set the regularizer to \(\beta =10^{-6}\), and the violation probability of the chance constraints to \(\epsilon =0.05\).

5.1 The impact of ambiguity aversion

Two elastic demands \(n_1\) and \(n_2\) and the spatial arbitrageur contribute to offsetting any consumption deviation \(\xi \) of the inelastic demand from her nominal consumption L. Based on their expectation on \(\xi \) the spatial arbitrageur and two elastic demands make an individual trade-off between the quantity of the commodity to be bought and their participation factor. This trade-off highly depends on their individual belief on the deviation \(\xi \). As the ambiguity set for a specific player enlarges, she contributes more actively to balancing services.

Fig. 6
figure 6

Evolution of quantities to be traded (plot a), participation factors (plot b), and expected out-of-sample disutility as well as its standard deviation highlighted by the shaded area (plot c) as a function of the radius

This effect is illustrated in Fig. 6, where the radius of all players is assumed to be identical, i.e., \(\rho ^{\text {Ed}}_{n_1} = \rho ^{\text {Ed}}_{n_2} = \rho ^{\text {Ar}}\). This assumption will be relaxed later. By increasing the radius, players become more ambiguity-averse. Meanwhile, all players possess the same empirical data, i.e., \(\widehat{F}^{\text {Ed}}_{n_1} = \widehat{F}^{\text {Ed}}_{n_2} = \widehat{F}^{\text {Ar}}\), yielding homogeneous ambiguity sets. As the ambiguity aversion of all players increases, all players reduce their quantity of the commodity to be traded as shown in Fig. 6a. However, we observe that this decrease is less steep for the elastic demand \(n_1\), since her utility from consumption is slightly lower than that of \(n_2\). The commodity price \(\lambda ^{\text {E}}\) falls as the ambiguity aversion increases. Figure 6b shows the evolution of the participation factors \(\alpha ^{\text {Ar}}\), \(\alpha ^{\text {Ed}}_{n_1}\), and \(\alpha ^{\text {Ed}}_{n_2}\). As the ambiguity aversion increases the elastic demand \(n_2\) as well as the spatial arbitrageur provide a greater contribution to balancing services. Meanwhile, the elastic demand \(n_1\) proportionally reduces her participation, although starting from a significantly higher value. The balancing price \(\lambda ^{\text {B}}\) rises as the ambiguity aversion increases. Lastly, we observe in Fig. 6c that the expected disutility only slightly changes, whereas its standard deviation, indicated by the shaded area around the expected disutility, is positively correlated to the participation factor.

5.2 On heterogeneous ambiguity aversion

In the following we are interested in exploring the impact of heterogeneous ambiguity aversion. For this purpose, we assume the radius of the spatial arbitrageur to be \(\rho ^{\text {Ar}} = 0.1\). At the same time, we gradually increase the radius of both elastic demands.

Figure 7 illustrates the expected disutility, i.e., the negative utility, of elastic demands \(n_1\) and \(n_2\), respectively, as a function of own as well as rival ambiguity aversion. As own ambiguity aversion of a demand increases her expected disutility increases as well. However, it also depends on the ambiguity aversion of the rival. According to Fig. 7a, corresponding to demand \(n_1\), her expected disutility significantly depends on the ambiguity aversion of the elastic demand \(n_2\). Given a high ambiguity aversion of both elastic demands, player \(n_1\) does not earn any utility. In contrast, as shown in Fig. 7b, the disutility of the elastic demand \(n_2\) hardly depends on the rival ambiguity aversion. Given a high ambiguity aversion of both elastic demands, she still earns a utility from consumption. These observations highlight that a player with a comparatively low consumption utility is highly exposed to the rival ambiguity aversion.

Fig. 7
figure 7

Expected disutility of the elastic demand \(n_1\) and \(n_2\) as a function of the radius of the own and the rival’s ambiguity sets

6 Conclusion

We studied a perfectly competitive local market, in which players trade a single commodity while being subject to the same source of uncertainty. These players could be heterogeneously ambiguity-averse by having individual knowledge about and confidence in empirical data describing the uncertain event. We proposed a generalized formulation of a distributionally robust Nash equilibrium problem and applied a Wasserstein distance metric to model the ambiguity set of each player. Through the application of distributionally robust chance constraints, an affine policy and a quadratic regularizer, we defined a tractable Nash game. We mathematically proved that for this game an equivalent single optimization problem exists, whose solution is unique. This implies the existence of a unique Nash equilibrium point. Numerical results indicated that a player with a comparatively low consumption utility is highly subject to rival ambiguity aversion.