Ambiguities and nonmonotonicities under prosumer power

Prosumers adopt distributed energy resources (DER) to cover part of their own consumption and to sell surplus energy. Although individual prosumers are too dispersed to exert operational market power, they may collectively hold a strategic advantage over conventional generation in selecting DER capacity via aggregators. We devise a bilevel model to examine DER capacity sizing by a collective prosumer as a Stackelberg leader in an electricity industry where conventional generation may exert market power in operations. At the upper level, the prosumer chooses DER capacity in anticipation of lower-level operations by conventional generation and DER output. We demonstrate that exertion of market power in operations by conventional generation and the marginal cost of conventional generation affect DER investment by the prosumer in a nonmonotonic manner. Intuitively, in an industry where conventional generation exerts market power in operations similar to a monopoly (MO), the prosumer invests in more DER capacity than under perfectly competitive operations (PC) to take advantage of a high market-clearing price. However, if the marginal cost of conventional generation is high enough, then this intuitive result is reversed as the prosumer adopts more DER capacity under PC than under MO. This is because the high marginal cost of conventional generation prevents the market-clearing price from decreasing, thereby allowing for higher prosumer revenues. Moreover, competition relieves the chokehold on consumption under MO, which further incentivises the prosumer to expand DER capacity to capture market share. We prove the existence of a critical threshold for the marginal cost of conventional generation that leads to this counterintuitive result. Finally, we propose a countervailing regulatory mechanism that yields welfare-enhancing DER investment even in deregulated electricity industries.


Introduction
Over the past 40 years, the electricity industry in most OECD countries has experienced two structural reforms. First, it has gone from being a mostly state-regulated enterprise with vertically integrated investor-owned utilities to a decentralised one with separation of generation and retailing functions (Wilson 2002;Baek et al. 2014;Ajayi et al. 2017). Second, in the last decade, concerns about climate change have prompted decarbonisation of the power sector and electrification of wider energy use in other sectors. This orientation towards sustainability has been facilitated by policies for supporting renewable energy technologies and carbon pricing (von Hirschhausen 2014;de Leon Barido et al. 2020).
In particular, climate policy has catalysed the adoption of distributed energy resources (DER) (Burger and Luke 2017), such as rooftop solar photovoltaic (PV) panels (van Kooten and Mokhtarzadeh 2019) and plug-in electric vehicles (PEVs) (Fox et al. 2017). For example, small-scale PV generation by end users in the U.S. has increased fivefold in the past seven years. 1 While renewable-energy subsidies and targets have made DER technologies more economically attractive for residential and commercial entities, the rise of the so-called prosumer, i.e., an agent that both produces and consumes energy, 2 is further enabled by underpinning regulation. For example, FERC Order 2222 3 and EU Directive 2019/944 (Article 16) 4 ensure non-discriminatory access to electricity markets for DER providers. In this context, aggregators can pool DER capacity to participate more effectively in markets (Wang et al. 2019). 5 Thus, while a single prosumer may have limited influence in the electricity market, an aggregator with a diverse portfolio of DER can potentially exert market power (Iria et al. 2019;Yin et al. 2020).
Early work on aggregators focused on managing their risk through stochastic programming (Liu et al. 2015;Davatgaran et al. 2018;Mehdizadeh et al. 2018). In such a setting, electricity prices are taken as uncertain but exogenous, and aggregators devise trading strategies for scheduling PEVs (Momber et al. 2015) or deploying flexible loads (Ottesen et al. 2016). More recent work has acknowledged the growing influence of aggregator-enabled prosumers on electricity markets by making prices endogenous (Ruhi et al. 2018). This can be implemented in either Nash-Cournot frameworks or Stackelberg leader-follower models. For example, Momber et al. (2016) use a bilevel model to enable a PEV aggregator to set retail prices in anticipation of electricity-market clearing. In a similar vein, Ruhi et al. (2018) assess how a strategic aggregator acting as a leader may have the incentive to manipulate electricity prices by "spilling" output from its DER. Xiao et al. (2020) use a bilevel optimisation framework with an aggregator as a Stackelberg leader to model strategic bidding in joint energy and regulation markets, building upon earlier work that also used bilevel optimisation with an aggregate prosumer as a Stackelberg leader in electricity markets (Jia et al. 2019;Kardakos et al. 2015;Bahramara et al. 2017;Jia et al. 2018).
Focusing on the prosumer's role as either a net buyer or a net seller in the electricity market beyond just a net consumer or a net producer of energy,  introduce a prosumer into the standard transmission-constrained oligopoly model (Hobbs 2001). Such a prosumer has not only DER with intermittent output but also a backup generator and its own benefit function from consumption. Via some simplifying assumptions, the authors prove that if the prosumer is a net buyer (net seller) in the electricity market as a price taker, then it will also be a net buyer (net seller) in the electricity market as a strategic entity. Moreover, the prosumer is always better off as a price taker rather than exerting market power. Intuitively, there is no gain from attempting to manipulate the market-clearing price because of the response of the other producers and consumers who are all price takers. These insights are illustrated using a 24-node test network, which is also subsequently deployed in a Stackelberg model of a strategic prosumer . By anticipating the decisions of the other market participants, the prosumer is always better off as a Stackelberg leader than a price taker or a Cournot player. Meanwhile, the distributional impacts of prosumer behaviour are assessed via a Nash-Cournot framework by Chen et al. (2021).
While the extant literature focuses on the strategic role that aggregator-enabled prosumers can play in market operations, the impact of strategic DER investment is not directly assessed. For example,  and  treat the effective DER capacity as an exogenous parameter and vary it to explore its impact on market operations. Yet, in spite of the rise of prosumers, DER's ability to affect market-clearing prices is likely to be limited because only a fraction of the self-generated electricity is actually being sold into markets. Indeed, data for the U.S. during 2019-2020 indicate that about 5% of the small-scale PV generation is sold back. 6 Moreover, given the relatively flexible assets of incumbent generators, market power in operations by prosumers who deploy intermittent DER, even if coupled with flexible loads, is likely to be limited for the foreseeable future. Instead, leverage by prosumers may be possible at 1 3 Ambiguities and nonmonotonicities under prosumer power the investment stage (Siddiqui et al. 2019a) because of incentives for adoption of renewable DER to replace decommissioned thermal capacity.
Given this background, we take the perspective of a strategic profit-maximising prosumer that is able to invest in DER capacity while anticipating its impact on market operations. As such, it acts as a Stackelberg leader vis-à-vis the conventional consumer and generator, which leads to a bilevel decision-making problem. At the upper level, the prosumer determines its DER capacity, while market operations are decided at the lower level. This framework is in line with a closed-loop capacity equilibrium as described by Wogrin et al. (2013), where the upper-level investment decision anticipates the prosumer's own reaction as well as that of the rest of the market. Specifically, the lower level comprises an equilibrium among the consumer, conventional generation, and net sales by the prosumer. In line with  and , the prosumer's net sales directly to the bulk market are endogenously determined by supply and demand conditions in addition to the prosumer's benefit function. Moreover, market operations may be either perfectly competitive or exhibit market power in conventional generation. Thus, there are two types of bilevel models: perfectly competitive operations (PC) and simultaneous-move market power in operations (MO) by conventional generation (von der Fehr 2010). As a reference point, we compare the results of the two bilevel models, PC and MO, with a firstbest central-planning model (CP) in which all decisions are made by a welfaremaximising entity. Via this setup, we address the following research questions:

Research Question RQ1 How are the DER investment decisions of a profit-maximising prosumer affected by market settings in a deregulated industry?
Research Question RQ2 Which countervailing regulatory measures lead to welfareenhancing DER investment by the prosumer in a deregulated industry?
To address Research Question RQ1, we compare the DER investment decisions among the three market settings. We find that investment under PC should be lower than that under CP in a bid to boost the market-clearing price by restricting capacity. Yet, this result may be reversed if the marginal cost of conventional generation is low enough. In fact, a profit-maximising prosumer may actually adopt more DER capacity because price-taking conventional generation sets the market-clearing price at a low level. Thus, strategic withholding of capacity at the upper level has limited leverage when the marginal cost of conventional generation is low, and the prosumer is better off resorting to a volumetric strategy, i.e., profiting from the volume of energy sold rather than the price per unit. Likewise, we expect higher DER investment under MO vis-à-vis PC because the market-clearing price is higher ceteris paribus in the former setting as a result of conventional generation's exertion of market power, which leads to a higher market-clearing price and obviates the need for the prosumer to restrict capacity investment. However, this is not the case if the marginal cost of conventional generation is high, resulting in a high market-clearing price and curbed consumption.

3
Additionally, the PC setting will benefit from the lack of a chokehold on consumption, which means that capacity expansion will not be concomitant with a price-depressing effect as under MO. Turning to comparative statics, we find that the impact of the marginal cost of conventional generation on DER investment under CP is monotonic, i.e., an increase in the marginal cost of conventional generation causes conventional generation to recede from market operations and increases the market share of DER. By contrast, under both PC and MO, the marginal cost of conventional generation affects prosumer DER adoption nonmonotonically: at a relatively low level, DER investment increases in the marginal cost of conventional generation as under CP. Once the marginal cost of conventional generation becomes high enough, the prosumer's DER investment decreases with the marginal cost of conventional generation because the market-clearing price is sufficiently high that any further capacity expansion will depress it without offering substantial additional market share and erode the prosumer's profit. Hence, it becomes optimal to reduce DER capacity investment for infinitesimal increases in the marginal cost of conventional generation.
With respect to Research Question RQ2, we devise counterfactual bilevel problems under each decentralised setting of PC and MO to obtain the welfare-maximising DER capacity levels in deregulated electricity industries. In contrast to the aforementioned bilevel problems, these counterfactual ones replace the profit-maximising prosumer at the upper level by a welfare maximiser that maximises the sum of all agents' objective functions. The resulting DER capacity levels may be considered as second-best outcomes, i.e., the best that society can achieve given a deregulated electricity industry. By offering a capacity-equalising subsidy on the DER investment cost to the prosumer, a regulator can enforce the second-best outcome such that the DER capacity adopted by a profit-maximising prosumer equals that of a welfare maximiser. Under PC, such a regulatory mechanism fully aligns private and public incentives, thereby ensuring a first-best outcome with the capacity-equalising subsidy. However, under MO, the capacity-equalising subsidy only imperfectly aligns private and public incentives because the distortion from conventional generation's market power in operations cannot be completely mitigated. In effect, while the capacity-equalising subsidy boosts DER investment to the benefit of prosumers and consumers, the resulting contraction in conventional generation in conjunction with the exercise of market power keeps the market-clearing price above the marginal cost of conventional generation. Furthermore, the cost of the subsidy to the regulator and the loss in generator surplus mean that the first-best level of social welfare is not attained. Nevertheless, the capacity-equalising subsidy is still welfare enhancing even under MO.
The rest of this paper is organised as follows. Section 2 lays out the modelling assumptions, while Sect. 3 sets up and solves for the reference CP setting. Section 4 analyses bilevel models under both PC and MO settings along with comparative statics to tackle Research Question RQ1. Next, Sect. 5 obtains the welfare-enhancing regulation under PC and MO settings to address Research Question RQ2. Section 6 illustrates the main findings via numerical examples, and Sect. 7 summarises the work's contributions and charts out directions for future research. All proofs of propositions are in Appendix A, supplementary numerical results are in Appendix B, and an equilibrium problem with equilibrium constraints (EPEC) is implemented in Appendix C to assess the impact of competing prosumers.

Modelling assumptions
We take a stylised modelling approach to understand how a prosumer's strategic investment is affected by market settings and whether a regulatory mechanism can align its incentives better with those of society. Our stylised modelling focuses on a single representative time period without uncertainty allowing us to pursue analytical solutions for conducting comparative statics. Likewise, we neglect transmission constraints in our analysis.
We have three types of agents in our model: (i) consumers, (ii) conventional generation, and (iii) an aggregate prosumer. Consumers are passively represented by a linear inverse-demand function, A is the consumers' maximum willingness to pay for electricity. Market clearing is implicit, i.e., q equals total electricity generation. Conventional generation is represented by a single entity that can either behave as a price taker or exert market power in operations via a simultaneous-move game. The cost of generation is 1 2 Cx 2 [in $/MW], where C > 0 [in $/MW 2 ] and x [in MW] is generation output. By contrast, the aggregate prosumer is assumed to be a price taker in market operations because of its relatively less flexible output vis-à-vis conventional generation. As in , we elide the issue of net billing versus net metering by assuming that the aggregator-enabled prosumer "...interact[s] with the bulk market directly." At the operating stage, the prosumer decides its sales to the grid, y [in MW]. Note that y can be either positive or negative. However, the prosumer behaves strategically because it can also select its DER adoption, z [in MW], in anticipation of market operations. Its DER investment cost is Iz, where I > 0 [in $/MW] is the marginal investment cost (amortised to a single time period), and it incurs no operating cost because DER is from a renewable source like PV. The prosumer also has a gross benefit from consumption, B(z − y) − 1 2 (z − y) 2 , which reflects diminishing marginal returns from consumption. Note that B > 0 [in $/MW] is the maximum valuation on electricity consumption by the prosumer and is distinct from the consumers' maximum willingness to pay, A.
In a deregulated industry, strategic prosumer investment may be analysed via a bilevel framework in which we seek a subgame-perfect Nash equilibrium ( Fig. 1). At the lower level, DER investment by the prosumer, z, is taken as given, and the electricity market is cleared via a simultaneous-move game such that sales from conventional generation (x) and the prosumer (y) equal the quantity demanded (q). The resulting Nash equilibrium also leads to the market-clearing price of electricity, p [in $/MW], which enters into the prosumer's upper-level problem. At the upper level, the prosumer anticipates the lower-level equilibrium and selects z to maximise its profit. Only the prosumer is allowed to make a capacity investment in line with decarbonisation pathways that envisage a phaseout of fossil-fuelled plants. Although conventional generation may also replace its existing fleet with PV and other renewable assets, in the medium term, it is likely to be encumbered with the existing fossil-fuelled portfolio. Consequently, DER investment by the prosumer has a strategic advantage over conventional generation during this transitional window. Thus, the prosumer acts as a Stackelberg leader that can indirectly influence the marketclearing price to its advantage via DER adoption.
We have two settings with a deregulated industry: one in which conventional generation acts perfectly competitively (PC) and another in which conventional generation alone exerts market power in a simultaneous-move game (MO). In either case, the prosumer invests in DER at the upper level, thereby leading to a bilevel problem. As a benchmark, we also have a central-planning setting (CP) in which all decisions, x, y, and z, are treated as if they were made by a single benevolent entity that maximises social welfare. Thus, CP is handled as a single-level optimisation problem.
We also need to restrict the parameters so that the prosumer's consumption, z − y , is always positive and that A − I > 0 . Interpreted another way, the prosumer cannot sell more in the electricity market than its installed DER capacity. Note that the prosumer's consumption decision is distinct from its position in the electricity market, i.e., whether y is positive or negative, which is determined endogenously. Likewise, we require x > 0 and z > 0 for interior solutions. Assumptions A1, A2, A3, A4, and A5 summarise the parameter restrictions to ensure interior analytical solutions. Intuitively, Assumptions A1 and A2 bound consumer and prosumer willingness to pay for electricity in terms of the cost of DER investment, i.e., the assumptions rule out economically uninteresting results without DER adoption. Note that Assumption A4 is stronger than Assumptions A1 and A2 together, which lead to C(A + B) − 2IC > 0 if added. Assumption A4 is necessary to ensure that DER adoption under CP is strictly greater than zero, cf. Proposition P1, thereby avoiding trivial results without DER adoption. Finally, Assumption A5 puts a lower bound on prosumer willingness to pay in terms of consumer willingness to pay to avoid irrelevant results without both strictly positive consumption and production by prosumers in both PC and MO settings, cf. Propositions P3 and P6.

Central planning
Under CP, a single welfare-maximising entity makes all decisions by solving the following quadratic program (QP): Note that (1) comprises consumer surplus (CS), generator surplus (GS), and prosumer surplus (PS) decomposed as follows: • CS is the gross benefit to consumers from consumption, A(x + y) − 1 2 (x + y) 2 , minus the cost of electricity purchased, p(x + y). • GS is the revenue from conventional generation sales, px, less the cost of conventional generation, 1 2 Cx 2 . • PS is the revenue from prosumer sales, py, plus the gross benefit to prosumers from consumption, B(z − y) − 1 2 (z − y) 2 , minus the cost of DER investment, Iz.
Since the cost of electricity purchased by the consumer, p(x + y) , cancels the revenue terms accruing to the conventional generation, px, and the prosumer, py, social welfare may be expressed as in (1). 7 Since (1) is a convex optimisation problem, it may be replaced by its Karush-Kuhn-Tucker (KKT) conditions for optimality: Note that the second-order sufficiency conditions (SOSCs) are satisfied because the Hessian matrix, H, is negative definite (Gabriel et al. 2013): We solve (2)-(4) analytically to yield interior solutions, cf. Proposition P1: Intuitively, the socially optimal solution is to ensure that the marginal benefit of consumption equals marginal cost, whether from conventional generation (2) or DER output (3). Note that the latter condition implies that the opportunity cost of forgone consumption by the prosumer, B − (z − y) , equals the market-clearing price, A − (x + y) . This way, the marginal cost of DER generation equals its marginal cost of investment (4). Thus, the electricity price is set by the marginal cost of DER investment (9). It is also possible to prove that the optimal DER investment is monotonically increasing in the marginal cost of conventional generation, C, cf. Proposition P2: Proposition P2 Under CP, optimal DER investment increases monotonically in the marginal cost of conventional generation.

Deregulated industry
In this section, we address Research Question RQ1 by positing that the prosumer behaves strategically in adopting DER capacity in a deregulated electricity industry. In contrast to the single-agent framework corresponding to CP in Sect. 3, we use the bilevel model indicated in Fig. 1 to understand how a profit-maximising prosumer's incentives are affected by market settings. Thus, we allow for PC and MO settings in Sects. 4.1 and 4.2, respectively.

Perfectly competitive operations
Under PC, both conventional generation and the prosumer act as price takers at the lower level when making their electricity sales. At the upper level, the prosumer acts as a Stackelberg leader when deciding upon its DER investment. We solve for the subgame-perfect Nash equilibrium at the lower level first before obtaining the optimal DER investment at the upper level.

PC: lower level
Both conventional generation and the prosumer take the electricity price and DER investment as given when maximising their operating profits: Again, since each lower-level problem is convex, it may be replaced by its KKT conditions: 8 In contrast to CP, in a deregulated industry, the lower-level equilibrium depends upon a DER capacity that has been set to maximise the prosumer's profit and not social welfare.

PC: upper level
The prosumer's bilevel profit-maximisation problem is constrained by the lowerlevel problems: 9 Replacing the lower-level problems by their KKT conditions, we obtain a mathematical program with equilibrium constraints (MPEC) (Gabriel et al. 2013): By further inserting the interior solutions from the lower level, i.e., (14)-(16), we obtain the following single-level unconstrained QP: We assume here that the prosumer can anticipate the reaction of the rest of the market based on the prosumer's investment decision. This includes anticipating its own reaction as within the framework of closed-loop capacity equilibrium as described by Wogrin et al. (2013). Since the price and prosumer sales are functions of z, they cannot be ignored when taking the KKT condition: Note that (19) equates the marginal revenue from DER capacity expansion to its marginal cost. The SOSC may be verified because the partial derivative of (19) with s.t. (12) − (13).
respect to z is less than zero. We can readily solve (19) to obtain the optimal DER investment by a prosumer under PC, which is an interior solution as shown in Proposition P3: Similar to Proposition P2, we investigate in Proposition P4 whether optimal DER investment by a profit-maximising prosumer also increases monotonically with respect to C. In contrast to the CP setting, the result here is actually ambiguous. This is because a higher marginal cost of conventional generation has a twofold effect: it tends to increase the market-clearing price and, thus, to reduce quantity demanded. Intuitively, optimal DER investment increases with respect to the marginal cost of conventional generation as long as C is not "too high," i.e., it is in a range where the prosumer is able to exploit the market share vacated by conventional generation without lowering the market-clearing price. This critical threshold, C PC > 0 , exists and is unique as along as 4I − A < 0 . For C ≥ C PC , the prosumer is actually better off decreasing its DER capacity adoption with respect to the marginal cost of conventional generation, i.e., z PC C < 0 . Otherwise, if 4I − A ≥ 0 , then optimal DER investment monotonically increases with respect to C, i.e., z PC C > 0 . In the latter case, DER adoption is relatively limited due to its high investment cost and further expansion does not adversely affect the market-clearing price.
Proposition P4 Under PC, optimal DER investment by the prosumer increases monotonically in the marginal cost of conventional generation as long as 4I − A ≥ 0 . However, if 4I − A < 0 , then there exists a unique threshold, C PC > 0 , below (above) which optimal DER investment by the prosumer increases (decreases) in the marginal cost of conventional generation.
We next compare optimal DER investment under PC with that under CP. Intuitively, a profit-maximising prosumer should invest in less DER capacity than a welfare maximiser. However, this ordering may not hold if the marginal cost of conventional generation is "too low." In such a circumstance, the market-clearing price will be relatively low regardless of the prosumer's capacity withholding at the upper level. Hence, as formalised in Proposition P5, a profit-maximising prosumer may adopt more DER capacity to capture market share from conventional generation.
Proposition P5 Optimal DER investment under CP is higher than that by a profitmaximising prosumer under PC as long as C is higher than a unique threshold,

Market power in operations
Under MO, conventional generation exerts market power in operations at the lower level, while the prosumer is still a price taker in electricity-market operations. Note that the lower level is a simultaneous-move game (von der Fehr 2010), which leads to a Nash equilibrium. At the upper level, the prosumer again acts as a Stackelberg leader when deciding upon its DER investment.

MO: lower level
The prosumer's problem is still expressed by (11) with the corresponding KKT condition (13). However, conventional generation's problem becomes:

Consequently, its KKT condition is
In contrast to PC, conventional generation under MO operates where marginal revenue (and not the price) equals marginal cost.
Assuming interior solutions, we solve (22) and (13) analytically to yield the Nash equilibrium:

MO: upper level
The prosumer's bilevel profit-maximisation problem under MO is similar to that under PC. Thus, we proceed directly to the QP rendering of the problem as in (18): This yields the following KKT condition: Note that (27) equates the marginal revenue from DER capacity expansion to its marginal cost. The SOSC may also be verified because the partial derivative of (27) A(C + 1)(C + 2) + B(C + 1)(3C + 5) − I(2C + 3) 2 − (C + 1)(3C + 5)z = 0.
with respect to z is less than zero. We can again solve (27) to obtain the optimal DER investment by a prosumer under MO and verify that the solutions are interior in Proposition P6: Analogous to Propositions P2 and P4, we explore how DER investment under MO responds to the marginal cost of conventional generation. Again, the result is ambiguous due to the twofold effect of the marginal cost of conventional generation: if 4I − A ≥ 0 , then optimal DER investment monotonically increases with respect to C, but it may not be the case otherwise if C is "too high" or A is high relative to I. As outlined in Proposition P7, z MO C > 0 always ( z MO C < 0 always) as long as the DER investment cost is high (low) relative to maximum consumption. Intuitively, a relatively high (low) DER investment cost means that DER capacity adoption is so low (high) that capturing market share (maintaining a high market-clearing price) is advantageous in face of receding conventional generation. By contrast, for a moderately high DER investment cost, i.e., 4I < A ≤ 12I , there is a unique turning point, C MO ≥ 0 , that causes the prosumer to change its DER-investment strategy from a volumetric one to a margin one.
Proposition P7 Under MO, optimal DER investment by the prosumer increases monotonically in the marginal cost of conventional generation as long as 4I − A ≥ 0 . However, if 4I < A ≤ 12I , then there exists a unique threshold, C MO ≥ 0 , below (above) which optimal DER investment by the prosumer increases (decreases) in the marginal cost of conventional generation. Finally, if A − 12I > 0 , then optimal DER investment by the prosumer decreases monotonically in the marginal cost of conventional generation.
Similar to Proposition P5, we compare optimal DER investment under MO with that under PC. Intuitively, a prosumer under MO should invest in more DER capacity than under PC to take advantage of a high market-clearing price. In effect, if an imperfectly competitive electricity market becomes more competitive, then the impetus for DER capacity investment erodes from the perspective of the prosumer. However, as shown in Proposition P8, this ordering may not hold if A − 4I is positive and the marginal cost of conventional generation is "too high." In the latter circumstance, the prosumer under PC may actually adopt more DER capacity than under MO as the high marginal cost of conventional generation ensures that the market-clearing price does not diminish significantly with the introduction of competition. Moreover, the chokehold on consumption under MO is relieved due to competition, which further incentivises the prosumer to expand DER capacity to capture market share.
Proposition P8 If A − 4I ≤ 0 , then optimal DER investment under MO is always higher than that under PC. Otherwise, optimal DER investment under MO is higher than that under PC as long as C is lower than a unique threshold, C * > 0.

Welfare-enhancing regulation
The results in Sects. 4.1 and 4.2 exhibit prosumer investment that is not aligned with the welfare-maximising results under central planning, cf. Sect. 3. To increase welfare in decentralised industries, regulators may propose incentive-alignment mechanisms to entice prosumers to modify their capacity adoption. One such measure could be a simple subsidy, S [in $/MW], on the investment cost of DER, which makes the effective cost of DER investment (I − S)z for a prosumer. Note that it may be possible for S to be high enough that it makes the effective cost of DER investment negative.
In this section, we tackle Research Question RQ2 by determining subsidies under PC and MO settings that would engender the same DER investment as if the upperlevel capacity were decided by a welfare-maximising agent. These counterfactual capacity levels are obtained by solving the representative bilevel problems and are labelled as ẑ PC and ẑ MO . Next, we force the actual capacity levels from PC and MO in (20) and (28) to equal ẑ PC and ẑ MO , respectively. The subsidies that lead to these results are labelled S PC and S MO , respectively. Finally, social welfare is calculated as a result of deploying the subsidy in each decentralised setting.

Counterfactual bilevel problem: perfectly competitive operations
If the upper-level decision-maker is a welfare maximiser, then the bilevel problem under PC becomes the following: Replacing the lower-level problems by their KKT conditions, we obtain an MPEC: By further inserting the interior solutions from the lower level, i.e., (14)-(16), we obtain the following single-level unconstrained QP:  1 3

Ambiguities and nonmonotonicities under prosumer power
The KKT condition to the QP in (30) is: Note that (31) is identical to the capacity investment under CP, i.e., z CP , from (8). This result is intuitive because the upper-and lower-level objective functions are fully aligned, i.e., they both aim to maximise social welfare. Therefore, S PC may be obtained by subtracting the subsidy from the investment cost in the PC investment level, z PC , from (20) and forcing it to equal ẑ PC : Social welfare under this mechanism may be calculated using the definitions of CS and GS but modifying the definition of PS to reflect the subsidy and accounting for regulator surplus (RS). Since social welfare is the metric that ranks outcomes in terms of their economic desirability, maximising it inclusive of RS leads to the social optimum. We let x PC and ŷ PC correspond to the optimal generation and prosumer consumption under PC with a subsidy of S PC , i.e., which results from solving (18) in which Iz is replaced by I − S PC z . This leads to the same solution as in the counterfactual problem (30). 10 Hence, welfare components are calculated as follows:

Counterfactual bilevel problem: market power in operations
If the upper-level decision-maker is a welfare maximiser, then the bilevel problem under MO becomes the following: Again, by replacing the lower-level problems with their KKT conditions, we obtain an MPEC: Next, insertion of the interior solutions from the lower level, i.e., (23)-(25), yields the following single-level unconstrained QP: The KKT condition to the QP in (34) is Note that (35) is different from both the capacity investment under CP, i.e., z CP , in (8) and that under PC, z PC , in (20). This result is intuitive because the upper-and lower-level objective functions are misaligned. Nevertheless, S MO may be obtained by subtracting the subsidy from the investment cost in the MO investment level, z MO , from (28) and forcing it to equal ẑ MO : (A + B) C + 2(C + 1) 2 − I(2C + 3) 2 − C + 2(C + 1) 2 z = 0 Again, social welfare under this mechanism may be calculated using the definitions of CS and GS but modifying the definition of PS to reflect the subsidy and accounting for RS. We let x MO and ŷ MO correspond to the optimal generation and prosumer consumption under MO with a subsidy of S MO , i.e., which results from solving (26) in which Iz is replaced by I − S MO z . This leads to the same solution as in the counterfactual problem (34). 11

Numerical examples
In this section, we focus on the numerical results that exemplify our main theoretical findings. For illustrative purposes, we use the following parameter values: A = 100 , B = 80 , I = 10 , and C ∈ [0.5, 1.5] , which also satisfy our Assumptions A1, A2, A3, A4, and A5. The full numerical results are available in Appendix B for the same parameter values that we use here.

Prosumer investment under PC and MO with low and high marginal costs
In Proposition P8, we proved that optimal DER investment under MO is higher than that under PC as long as C is lower than a unique threshold, C * . Here, we numerically denote that threshold in Fig. 2 via a solid black dot, i.e., C * = 0.9129 . For relatively low marginal costs, a prosumer under MO invests in more DER capacity than under PC to take advantage of a high market-clearing price, as intuition stemming from Proposition P8 conveyed. Thus, as an imperfectly competitive electricity market moves towards perfect competition, the prosumer has less incentive to invest in DER capacity. However, as proven in Proposition P8 and illustrated in Fig. 2, this result may not hold if the marginal cost of conventional generation is high enough. As shown in Fig. 2 for C > C * = 0.9129 , the prosumer under PC adopts more DER capacity than under MO. Note that, as shown in Proposition P7, there is a unique threshold of C MO = 0.2638 below which the optimal DER investment under MO increases in the marginal cost of conventional generation. Since Fig. 2 is displayed for C ≥ 0.5 , we observe only a decreasing z MO in C. Also, as proven in Proposition P4, we highlight the other main (36) . 11 Specifically, this may be shown to be equivalent to a trilevel problem with (i) a lower level comprising industry operations (11)  result, i.e., that capacity investment under PC is nonmonotonic. In particular, z PC is increasing for C < C PC = 1.2638 and decreasing for C ≥ C PC = 1.2638 , where C PC is denoted by the black cross. Meanwhile, Ĉ = 0.1111 , which is the threshold above which DER investment under PC becomes less than that under CP, cf. Proposition P5, is not visible in Fig. 2 because it is sketched for C ≥ 0.5 . For reference, optimal DER investment under CP and MO with the welfare-enhancing subsidy is plotted in Fig. 12 in Appendix B. Extending the horizontal axis to smaller values of C does not add much information to the graph and only makes it difficult to notice the main results concerning PC and MO.
To gain additional insight about this result, we scrutinise the lower-level equilibria under low marginal costs (e.g., C = 0.5 ) and compare them to those under high marginal costs (e.g., C = 1.5 ) for PC and MO. The equilibria for a relatively low marginal cost of C = 0.5 exhibit gentle slopes for the conventional inverse-supply functions, Cx (Fig. 3a, b). Consequently, since conventional generation under PC equates its marginal cost with the residual inverse-demand function, P RG (q) , i.e., the residual marginal utility, prices are significantly lower than those under MO, where conventional generation equates its marginal cost with the residual marginal revenue, MR RG (q) . This results in a lower value of prosumer sales to the grid, i.e., y PC is significantly lower than y MO , and higher values of conventional generation i.e., x PC is significantly higher than x MO . Thus, under relatively low marginal costs, the market-clearing price diminishes significantly under PC and reduces the prosumer's incentive to invest in DER capacity.
By contrast, Fig. 4a, b illustrate the equilibria for a relatively high marginal cost of C = 1.5 . These figures indicate that under higher marginal costs, i.e., steeper Cx functions, prices are still lower under PC than those under MO, but the discrepancy between them is less significant than that under lower marginal costs. This results in more prosumer sales to the grid and less conventional generation than those under lower marginal costs. Thus, under higher marginal costs, the market-clearing price does not diminish significantly under PC and allows more of an incentive for the prosumer to invest in DER capacity. Moreover, the chokehold on consumption under MO is relieved due to competition, which further incentivises the prosumer to expand DER capacity to capture market share. As a benchmark, the optimal solutions under CP exhibit no change in the marketclearing price in spite of an increase in the marginal cost of generation (Fig. 5a, b). As indicated in Proposition P1, the socially optimal solution is where the marginal utility of consumption equals the marginal cost of DER investment. Moreover, in line with Proposition P2, the optimal DER investment under CP is monotonically increasing in C, cf. Fig. 12 in Appendix B. Note that the threshold C * is directly visible only when displaying prosumer capacity investment as in Fig. 2. Prosumer sales, generation output, prosumer consumption, and the market-clearing price all stay consistent either side of the C * = 0.9129 threshold when comparing PC to MO as shown in Figs. 13, 14, 15, and 16 of Appendix B.

Welfare-enhancing subsidy
The numerical results in Sect. 6.1 for PC and MO indicate prosumer DER investment in a deregulated industry that is not aligned with the welfare-maximising results under central planning, cf. Sect. 3. Here, we now calculate a simple subsidy, S [in $/MW], on the investment cost of DER, which makes the effective cost of DER investment (I − S)z for a prosumer as defined in Sect. 5. Figure 6 plots subsidies under PC and MO settings, cf. (32) and (36), respectively, that would engender the same DER investment as if the upper-level capacity were decided by a welfare-maximising agent. The subsidies that lead to these results are labelled S PC and S MO , respectively. For our numerical example, subsidies under MO are higher than those under PC, as prosumers require more incentive under  Fig. 6 Welfare-enhancing DER subsidy with respect to C MO than PC to obtain the same social welfare as in CP regardless of which one has more DER investment. Likewise, consumer surplus, generator surplus, prosumer surplus, regulator surplus, and social welfare all stay consistent either side of the C * = 0.9129 threshold when comparing PC to MO as shown in Figs. 17, 18, 19, and 20 of Appendix B and Fig. 7. Although the subsidy S PC leads to a perfect alignment between private and social incentives, i.e., the first-best outcome is attained, such an outcome is not possible under MO with S MO . This is because the latter setting has two distortions, viz., the market power by the prosumer at the investment stage and by conventional generation at the operational stage. The use of a simple subsidy to mitigate both imperfections necessitates a higher subsidy under MO vis-à-vis PC, which boosts CS and PS to the detriment of GS and RS (see Fig. 7). Hence, although SW increases to Ŝ W MO from SW MO , it is not possible to reach the first-best level, SW CP .

Conclusions
In this paper, we devise a bilevel model to examine DER capacity sizing by an aggregator-enabled prosumer as a Stackelberg leader in an electricity industry where conventional generation may exert market power in operations. Our objective is to tackle Research Questions RQ1 and RQ2 to gain insights about prosumer behaviour and policy responses in a future electricity industry. We demonstrate that exertion of market power in operations by conventional generation and the marginal cost of conventional generation affect DER investment by the prosumer in a nonmonotonic and ambiguous manner. We show the intuitive result that a prosumer, in an industry where conventional generation exerts market power in operations similar to a monopoly, invests in more DER capacity than under perfectly competitive operations to take advantage of a high market-clearing price.
Somewhat surprisingly, we also find that if the marginal cost of conventional generation is high enough, then this intuitive result is reversed as the prosumer adopts more DER capacity under perfect competition than in an industry where conventional generation exerts market power in operations. Through underpinning analytical proofs and illustrative numerical examples, we specify that this result arises because the high marginal cost of conventional generation prevents the market-clearing price from decreasing, thereby allowing for higher prosumer revenues. Furthermore, competition relieves the chokehold on consumption when conventional generation exerts market power in operations similar to a monopoly, which further incentivises the prosumer to expand DER capacity to capture market share. We prove the existence of a critical threshold for the marginal cost of conventional generation that leads to this counterintuitive result. Finally, we propose a countervailing regulatory mechanism modelled as a counterfactual bilevel problem that yields a welfare-enhancing subsidy for DER investment in deregulated electricity industries.
Our results are applicable to market structures where aggregator-enabled prosumers aim to invest in DER capacity and face different levels of market power by conventional generation in market operations. Moreover, we show how a welfare-enhancing subsidy to the prosumer can lead to the same result for social welfare as if the market were organised under a central planner. These results demonstrate that policies designed to enhance DER investments by prosumers need to take into account not only the market structure but also the marginal cost of conventional generation. In particular, higher marginal costs of conventional generation could result in higher DER investment by prosumers under perfectly competitive markets than under markets where conventional generation exerts market power.
Future work in this area could expand this setup into different market structures and scenarios. For example, our framework assumes a closed-loop capacity equilibrium, where the upper-level investment decision anticipates the prosumer's own reaction as well as that of the rest of the market. Such an assumption might not always be applicable in markets, especially those without aggregator-enabled prosumers. Our work does not highlight the nonmonotonicities and ambiguities that might be present in such markets, and models that build upon ours could explore general results under alternative market structures. In Appendix C, we examine the robustness of our results in the presence of two competing symmetric prosumers in an EPEC, and it could be extended to several prosumers.
Intermittency and spatio-temporal aspects could also be tackled analytically if it were possible to specify lower-level solutions disjunctively. For example, Siddiqui et al. (2019a) handle storage by considering charging and discharging time periods, whereas Siddiqui et al. (2019b) allow for transmission constraints in a two-node network by carving up the lower-level solutions on the basis of which way power flows and which generators are dispatched. Such an approach could yield analytical solutions, but the resulting expressions may be too cumbersome to bend to comparative statics. A large-scale Nash-Cournot problem instance with prosumer operations ) allows for transmission congestion and backup generation for the prosumer. The latter could serve as a proxy for storage capacity when combined with the prosumer's flexible demand. However,  do not focus on the impact of congestion; rather, they investigate how the prosumer's exogenous renewable-energy capacity affects its incentive to be either a net buyer or a net seller and to manipulate prices as a Cournot player. On the former point, they note that relatively low renewable output benefits consumers as the prosumer (acting as a net buyer) reduces its electricity purchases. Moreover, at relatively high levels of renewable output, the prosumer becomes a net seller and exerts market power to increase the price. In terms of manipulating prices,  note that the prosumer has no incentive to do so if all other agents (consumers and producers) are price takers. Hence, a large-scale numerical case study of either Nash-Cournot operations or Stackelberg capacity investment would be warranted in future research to study the impact of storage and transmission on results from our paper and the extant literature.
Our solution to a counterfactual bilevel problem provides a computational method for essentially solving a trilevel problem, where we determine an optimal subsidy on top of a bilevel model representing a market where an aggregator-enabled prosumer acts as a Stackelberg leader when investing in DER capacity. This solution technique helps us to avoid grappling with more computationally intensive problems and provides an alternative to trilevel optimisation formulations. However, our work assumes interior solutions, and the optimal subsidy is calculated based on welfare that could be obtained under central planning. Future work would build on our computational results by expanding to situations where we could also allow for corner solutions and use numerical techniques to calculate optimal subsidies. This would generalise our results to electricity markets with more realistic features, such as capacity constraints, network effects, and spatiotemporal variation in DER output.
The contribution of the paper points directly towards studying prosumer power under different assumptions about market operations as well as optimal DER investment in a deregulated electricity industry. The results are applicable in a wide variety of electricity market settings and provide a novel framework for assessing welfare-enhancing subsidies.
Moreover, it is convex (concave) if 4I − A is positive (negative), which leads to two cases: 12 1. If 4I − A is positive, then Q PC (C) is an upward-facing parabola with at most two negative roots. Thus, it is positive for all nonnegative C, i.e., z PC C > 0. 2. If 4I − A is negative, then Q PC (C) is a downward-facing parabola with one negative and one positive root. Thus, it is positive for all 0 ≤ C < C PC , i.e., z PC C > 0 as long as 0 ≤ C < C PC , where ◻ Proof of Proposition P5 Comparing z CP and z PC in (8) and (20), respectively, z CP > z PC ⇔ 2(A − I)C 2 + (A − 3I)C − I > 0 . Denoting this quadratic function of C as Q (C) (see Fig. 9), we observe that it is an upward-facing parabola (since A − I > 0 ) that passes through the point (0, −I) . Q (C) has a positive (negative) gradient at the point (0, −I) if A − 3I > 0 (if A − 3I < 0 ), which means that it has exactly one positive and one negative root. 13 Disregarding the negative root, the positive root, Ĉ , above which z CP > z PC is: 12 There is also a "degenerate" case with 4I − A = 0 , which implies that z PC C > 0 because Q PC (C) > 0. 13 If A − 3I = 0 , then Q (C) has a zero gradient at the point (0, −I) , which again implies one positive and one negative root.

Proof of Proposition P6
which is always the case.
, which follows from Assumption A5. 1. If 4I − A is positive, then Q MO (C) is an upward-facing parabola with at most two negative roots. Thus, it is positive for all nonnegative C, i.e., z MO C > 0. 2. If 4I − A is negative, then Q MO (C) is a downward-facing parabola. If 12I − A is negative, then 7I − A is also negative, which means that there are at most two negative roots. Thus, z MO C < 0 always. 3. If 4I − A and 7I − A are negative but 12I − A is nonnegative, then Q MO (C) is a downward-facing parabola with one nonnegative and one negative root. Thus, it is nonnegative for all 0 ≤ C ≤ C MO , i.e., z MO C ≥ 0 as long as 0 ≤ C ≤ C MO , where 4. If 4I − A is negative but 7I − A and 12I − A are nonnegative, then Q MO (C) is again a downward-facing parabola with one positive and one negative root. Thus, it is positive for all 0 ≤ C < C MO , i.e., z MO C > 0 as long as 0 ≤ C < C MO .

Proof of Proposition P8
Comparing z MO and z PC in (28) and (20), respectively, z MO > z PC ⇔ (A − 4I)C 2 + (A − 10I)C − 5I < 0 . Denoting this quadratic function of C as Q * (C) (see Fig. 11), we observe that it is an upward-facing parabola if A − 4I > 0 and a downward-facing parabola otherwise. Either way, Q * (C) passes through the point (0, −5I) . There are, thus, three possible cases: 15 1. If A − 4I is negative, then Q * (C) is a downward-facing parabola with a negative gradient at the point (0, −5I) . Consequently, it has at most two negative roots. Thus, it is negative for all nonnegative C, i.e., z MO > z PC always. 2. If A − 4I is positive and A − 10I is nonnegative, then Q * (C) is an upward-facing parabola with a nonnegative gradient at the point (0, −5I) . Consequently, it has one positive and one negative root. Thus, it is negative for all 0 ≤ C < C * , i.e., z MO > z PC only for 0 ≤ C < C * , where 3. If A − 4I is positive and A − 10I is negative, then Q * (C) is an upward-facing parabola with a negative gradient at the point (0, −5I) . Consequently, it has one positive and one negative root. Thus, it is negative for all 0 ≤ C < C * , i.e., z MO > z PC only for 0 ≤ C < C * .

C Equilibrium problem with equilibrium constraints: multiple strategic prosumers
We revisit the setting of Sect. 4 to allow for multiple strategic prosumers. Instead of just a single prosumer, we now assume that there are two identical prosumers, i = 1, 2 , each of which behaves as a price taker at the lower level when deciding its sales to the grid, y i , but is a Stackelberg leader at the upper level when investing in DER capacity, z i . Thus, each prosumer effectively solves an MPEC, which means that the collection of MPECs constitutes an equilibrium problem with equilibrium constraints (EPEC) (Wogrin et al. 2013). The purpose of this extension is to explore the robustness of the key qualitative results with a single prosumer, viz., Propositions P4, P7, and P8 regarding the nonmonotonic and ambiguous results under PC and MO. Correspondingly, we retain the same assumptions from Sect. 2 with the exception that the gross benefit from consumption of prosumer i is B(z i − y i ) − z i − y i 2 instead of B(z − y) − 1 2 (z − y) 2 for a single prosumer. This change in the coefficient on the quadratic term ensures that the inverse net supply function for each prosumer that has twice the slope of the inverse net supply function in Sect. 2. Thus, once the two prosumers' net supply functions are added, the aggregate net supply function of prosumers has the same slope regardless of the number of prosumers, thereby yielding the same basis for comparison across different levels of market power (Siddiqui et al. 2019a). Although we are able to obtain analytical solutions for the prosumers' investment decisions in the EPEC, the resulting expressions are more cumbersome than those in the main text. Therefore, we resort to numerical examples to investigate whether the main qualitative results hold in the presence of multiple strategic prosumers. An EPEC to examine capacity expansion by conventional generation could be similarly solved, although climate policy in the EU and the U.S. prioritises rapid expansion of DER capacity instead.

C.1 EPEC perfectly competitive operations
We use the same solution approach as in Sect. 4.1, i.e., backward induction. We start at the lower level assuming that conventional generation and both prosumers act as price takers while DER capacities are fixed. At the upper level, each prosumer i behaves as a Stackelberg leader when selecting z i while anticipating the impact of its decision on the lower-level decisions but taking the DER capacity of the other prosumer, z −i , as fixed.

C.1.1 EPEC PC: lower level
Given z i , the profit-maximisation problems of conventional generation and prosumer i are 1 3 The SOSC is verified because the partial derivative of (50) with respect to z i is negative. We can solve for z i in terms of z −i to obtain the reaction function, z PC i z −i : Via symmetry and the analogous reaction function for prosumer −i , z PC −i z i , we can solve for z PC i :

C.2 EPEC market power in operations
The approach here is similar to that of Appendix C.1 with the exception that conventional generation exerts market power in operations as in Sect. 4.2.

C.2.1 EPEC MO: lower level
Each prosumer i still determines y i by solving (42) with the corresponding KKT condition (44). By contrast, conventional generation solves:

3
C, and z PC > z MO for a high enough C, cf. Fig. 2. In other words, the nonmonotonic and ambiguous results observed under an MPEC as part of Propositions P4, P7, and P8 may hold even under an EPEC.