## 4 Bayesian Game among Community Operators
### Bayesian Game Formulation
Therefore, based on the payoff formulaes (11) and (13), the expected payoff of community operator \(n\) with type \(j_{n}\) can be calculated as  
\[EP_{n}\left(x_{n}\left(j_{n}\right),x_{-n}\left(j_{-n}\right)\right)=\sum \limits_{j_{-n}\in J_{-n}}P_{n}\left(x_{n}\left(j_{n}\right),x_{-n}\left(j_{- n}\right)\right)\Pr\left(j_{-n}|j_{n}\right) \tag{14}\]  
where \(x_{n}\left(j_{n}\right)\) denotes the bidding strategy of community operator \(n\) with type \(j_{n}\); \(x_{-n}\left(j_{-n}\right)\) denotes the bidding strategy of other community operators with type combination \(j_{-n}\). Similarly, Bayesian Nash equilibrium can be defined as follows  
\[EP_{n}\left(x_{n}^{*}\left(j_{n}\right),x_{-n}^{*}\left(j_{-n}\right)\right) \geq P_{n}\left(x_{n}\left(j_{n}\right),x_{-n}^{*}\left(j_{-n}\right)\right) \tag{15}\]  
where \(\left(x_{n}^{*}\left(j_{n}\right),x_{-n}^{*}\left(j_{-n}\right)\right)\) is Bayesian Nash equilibrium. Once the equilibrium is reached, the payoff for community operator \(n\) with type \(j_{n}\) will be reduced by changing from equilibrium \(x_{n}^{*}\left(j_{n}\right)\). Based on the formula (14), our target is to search the Bayesian Nash equilibrium to maximize the expected payoff of community operator in the bidding market. That is to solve the following optimization problem  
\[\max\limits_{x_{n}\left(j_{n}\right)}EP_{n}\left(x_{n}\left(j_{n}\right),x_{-n }\left(j_{-n}\right)\right) \tag{16}\]  
Therefore, for community operator \(n\), under the bidding strategy \(x_{-n}\left(j_{-n}\right)\) of other operators, operator \(n\) will schedule its own bidding strategy \(x_{n}\left(j_{n}\right)\) to search the maximal expected daily profit. Additionally, in the process of optimization, following constraints must be obeyed in order to guarantee the validity of the solution. 1. DR resource's grade constraint Community operators employ gas boiler and energy storage to promote the grade of DR resource. In which, gas boiler can reduce breach amount by substituting electrical heating appliance; while energy storage can compensate breach amount via providing electricity for users. Whencommunity operator equips gas boiler or energy storage, its expected breach amount can be expressed as \[E\hat{\delta}_{n}^{t}=\int_{0}^{\Delta e}0d\delta+\int_{\Delta e}^{x_{n}^{t}}\left( \delta-\Delta e\right)f\left(u,\sigma^{2},\delta_{\text{l}},\delta_{\text{u}} \right)d\delta\] (17) where \(\Delta e\) is the compensation amount by gas boiler and energy storage, which is equal to \[\Delta e=K_{n}^{\text{GB}}h_{n}^{t}/\eta_{\text{e}}^{\text{h}}+K_{n}^{\text{ ES}}c_{n}^{\text{dis},t}\] (18) where \(\eta_{\text{e}}^{\text{h}}\) is the energy efficiency ratio of electrical heating appliance. Based on formulaes (17) and (18), the breach amount will be reduced to \(E\hat{\delta}_{n}^{t}\) from the perspective of DR purchaser. Therefore, the breach percentage changes to \(\hat{\gamma}_{n}=E\hat{\delta}_{n}^{t}/x_{n}^{t}\). When community operator \(n\) wants to participate in the bidding of \(i\)th grade of DR resource, then breach percentage \(\hat{\gamma}_{n}\) must satisfy the upper limit \(\gamma_{i}^{\text{max}}\) \[\left\{ \begin{array}{l}\hat{\gamma}_{n}=E\hat{\delta}_{n}^{t}/x_{n}^{t}\\ \gamma_{i}^{\text{min}}\leq\hat{\gamma}_{n}\leq\gamma_{i}^{\text{max}}\end{array} \right.\] (19)
2. Device output constraint Energy output of gas boiler and energy storage have to be less than the maximal energy output of device \[\left\{ \begin{array}{l}0\leq e_{n}^{\text{dis},t}\leq e_{n}^{\text{dis}, \text{max}}\\ 0\leq h_{n}^{t}\leq h_{n}^{\text{max}}\end{array} \right.\] (20) where \(e_{n}^{\text{dis},\text{max}}\) and \(h_{n}^{\text{max}}\) are the maximal energy output of energy storage and gas boiler. Additionally, the state of energy storage has to satisfy \[\left(1-DOD\right)S_{n}^{\text{ES}}\leq Soc_{n}^{t}\leq S_{n}^{\text{ES}}\] (21) where \(DOD\) is the maximal discharge depth of energy storage. 3. Bidding amount constraint Each community operator makes bidding strategy according to the DR resource level in its native users.