Equilibrium Storage in a Markov Economy

We model an economy that alternates randomly between abundance and scarcity episodes. We develop an original method to characterize in detail the structure of the Markovian competitive equilibrium. Accumulation and drainage of stocks are the main focuses. Economically appealing comparative statics results are proved. We also characterize stationary distribution of states. We extend the model to discuss price stabilization policies, injection and release costs, and limited storage capacity. Overall, the analysis delineates the notion of "flexible economy."


Introduction
Storage models are hard to tackle. Even the simplest specification of the production and storage technologies leads to intractable equations. Most results involve proving existence and uniqueness of the equilibrium, together with some qualitative properties (prices are monotonic in stock and in storage cost, stockouts happen with positive probability and stocks have an upper limit). As far as simulation based econometrics (GMM estimators as in Laroque, 1992, 1996) or the illustration of a theoretical possibility are concerned (convenience yield, 1 analysis of the Samuelson effect, 2 backwardation 3 as in Routledge et al, 2000), this is a suitable approach. Our aim is not to extend the existing models but rather to propose a simple case set in continuous time to facilitate the parameterization of shock persistence, and to characterize finely the behavior of the economy.
Our approach is innovative as it does not rely on fixed point methods, but directly constructs the equilibrium, assuming that agents observe the random occurrence of one of two states, the so-called abundance and scarcity periods. We focus on a Markov competitive equilibrium in which prices only depend on the current state. The relationship between the state of the economy (the endogenous stocks and the exogenous random variable) and the price is informative about behavior of the economy. We fully describe the dynamics of accumulation and drainage. Stocks are smoothly piled up in an abundance state and smoothly drained in a crisis state. We can see that the upper bound of the stocks is never reached in finite time and we can also evaluate the speed at which stocks are drained out. Besides such qualitative results, we provide comparative statics on the upper bound of the stocks and equilibrium price schedules with respect to all the parameters of the model.
Price, as functions of the state, give a logically complete picture of the equilibrium. Nevertheless, the characterization of the stationary distribution of states has an intuitive appeal as it directly informs as to where the economy is likely to be. The frequency of stockouts as well as the propensity of the economy to adjust stocks can thus be assessed. The stationary distribution is described by differential equations, which opens up the way to qualitative analysis and comparative statics. The dependency of the shape of the state density to the parameters is addressed.
Our model is motivated by two economic issues placed high on the European policy agenda. Storage as determined in response to persistent shocks is instructive for the energy policy debate about the role of gas or petroleum strategic reserves to manage supply disruptions, especially when dependency on foreign resources raises serious concerns. The existing theoretical literature on energy supply security, mostly inspired by the theory of 1 The notion of convenience yield was introduced by the economists Kaldor and Working who studied the theory of storage. In the context of commodities, the convenience yield captures the benefit from owning a commodity minus the cost of storing it. The flow of benefits from storage (the reduction in production costs) drives a wedge between the price of a commodity today and its value in the future. 2 The Samuelson effect arises when, for a given commodity, forward price volatility declines with the contract horizon. 3 Backwardation occurs when the price of a commodity for the actual period exceeds the price for future periods. exhaustible resources, considers either the extraction rate of one country when foreign import, though needed to complement national production, can suddenly default, 4 or strategic behavior of consuming countries confronting oligopolistic or cartelized supply. 5 However useful these analyses may be for the long run, they ignore the question of how to reach any desired stock level and how to deal with uncertainty about the duration of supply disruption.
We also shed some light on the banking of CO 2 pollution permits, a financial mechanism whose application is being discussed in the context of the European Trading Scheme, i.e. a market-based approach to environmental control. A number of research works have already analyzed the role of uncertainty in emission permit markets, studying in particular the SO 2 banking mechanism allowed by the American Clean Air Act. Most results concern optimum individual strategy and not the equilibrium. This limitation notwithstanding, several aspects of risk-averse utilities' are studied. 6 Our analysis is not focused on financial phenomena, though the model could serve that purpose; this said, we can illustrate the precautionary motive for banking emission rights, when the output market alternates between booms and busts (namely, when electricity demand is influenced by unexpected climate constraints) or there is a sudden but temporary increase in input costs.
The economic relevance of our model and its practicality are illustrated by three extensions.
First, we study the impact of a constant price policy. This apparently extreme choice is instructive for both gas and pollution permit markets because a regulatory authority could be tempted to stabilize gas or permit prices around a particular target (or path) of prices. Understanding the mechanisms of equilibrium and comparison with more interventionist policy could serve as a modest guide (or a development thereof) for market design and regulation. In contrast to the previous abundant literature on storage and price stabilization, 7 results are clear-cut: perfect price stabilization can be reached only if the economy is prepared to let stocks go to infinity. This simple prediction gives a partial answer to doubts as to price stabilization models raised by Williams and Wright (1991), who affirm: "[...] the possible permutations of demand curvature, disturbance structure, initial conditions, supply elasticity and so forth seem nearly infinite. [...] That is the main point: few, if any, general propositions are possible." In a second extension of the model, we consider the impact of non-negligible injection and release costs. This better characterizes natural gas or oil storage. Starting from the observation that the commodity is different depending on whether it lies outside or inside the reservoir, we show that the results of our analysis are unaffected by this generalization.
Limited storage capacity is also a crucial issue. For instance, gas is often stored in specific natural facilities (such as salt caverns) that are scarce. Also, market rules for emission programmes could impose the use of banking CO 2 permits up to a given threshold only. Consistently with the idea of scarcity rent, we show that in the accumulation phase, the price for storage service suddenly jumps above marginal cost when the capacity saturates. Interestingly, we find that, in contrast with the unconstrained case, the maximal stock is attained in finite time if the state of abundance is sustained.
The paper is organized as follows. Section 2 sets up the model and section 3 describes the methodology we follow to solve it. Section 4 characterizes the solution qualitatively and quantitatively and proposes comparative statics. Section 5 exposes the statistical properties of the model. Section 6 is devoted to applications and extensions of the model, while Section 7 concludes on the notion of economic flexibility. Proofs are relegated to the Appendix.

Assumptions and parameters
The economy can be in two states, abundance (A) or scarcity (C, for crisis). A generic state is denoted σ. Time is continuous and the state changes following Bernoulli processes: the passage from A to C occurs with probability rate λ C , and the passage from C to A with probability rate λ A . For example, the probability that the economy switches from A to C in a time interval dt is λ A dt, where λ A is the publicly known parameter of this survival process. This simple Markov structure captures the fact that regimes have uncertain nature and duration that can be quantified statistically. The stationary probabilities of states A and C are, respectively, The ratio λ A /λ C represents the relative frequencies of the two states.
Consumers and producers observe the current price and the state σ(= A, C). Their aggregate behavior is summarized by the "excess supply functions" ∆ σ [·] defined over R * + , where ∆ σ [p] is the difference in state σ and for price p between current primary producwith i.i.d disturbances (Williams and Wright, 1991). tion and current final consumption. 8 For example, ∆ C [·] incorporates a supply shock and adaptation of demand to the crisis.
Excess supply function ∆ σ [·] is increasing and has a unique finite positive zero in R * + , denoted by p * σ ; this is the price at which the spot market would be balanced without recourse to storage. Naturally, we assume that the abundance static equilibrium price p * A is strictly smaller than the crisis static equilibrium price p * C . ∆ σ [·] is a flow in the sense that if price p is sustained for the interval dt, then the quantity that is stored or released is ∆ σ [p]dt. Thus, if we denote the total inventories in the economy by S ≥ 0, conservation of matter imposes the following conditions Therefore, if the current price p is above p * σ , then the economy stores (∆ σ [p] > 0); if p is below p * σ , then the economy draws on inventories (∆ σ [p] < 0). Storers are assumed to be risk-neutral price-takers with rational expectations, so that the price dynamics will be driven by arbitrage. Storage exhibits constant returns to scale. Carrying costs consist of the opportunity cost of capital (r being the interest rate) and a cost c (per unit of commodity and per unit of time). 9,10 In equilibrium, the current price at date t equals the expected price at t + dt net of the carrying costs.

Fundamental equations
We focus on Markovian equilibria where the commodity price only depend on the state variables. We characterize differentiable functions p C [S] and p A [S] such that (1) is verified as well as the arbitrage conditions: for all S > 0 and a time increment dt, the no-arbitrage equations This is a first-order approximation. We let dt converge to 0 and neglect second-order terms, thus using (1), (2) and (3) become We search for the price functions that fully characterize the equilibrium. More precisely, we search for p A [·] and p C [·] defined over an interval [0, S * ] where S * , which is to be found, is the maximum stock. Besides the differential equations above, we know that p C [0] = p * C (when stocks are empty in a crisis, consumers just consume what is produced at the same time), and p A [S * ] = p * A (when inventories are maximum, nobody stores more). Mathematically, we have a boundary value problem. In a standard problem, two differential equations with two initial conditions are easily solved qualitatively and numerically, if not in closed form.
However, here both initial conditions are on singular points: ] = 0 meaning, if we look at equation (4), that dp C [0] dS is infinite; • at S * , both factors in the LHS of (5) are null; moreover S * is only implicitly defined, its value being determined as the point where accumulation stops

Summary of the notation
t : time; σ : generic exogenous state; C : Scarcity/Crisis; A : Abundance; λ C : probability rate that state passes from A to C ; λ A : probability rate that state passes from C to A ; ∆ σ [p] : excess supply for price p in state σ (per unit of time); p * σ : zero of ∆ σ ; S : stocks at a given date; c : marginal storage cost (per unit of time); r : riskfree interest rate.

The equilibrium
This section establishes that in a Markovian equilibrium, stocks are smoothly piled up in state A and smoothly drained in state C. Moreover, stocks vary between 0 and the upper bound S * to be determined, whereas the price is bounded below by p * A and above by p * C . We analyze the system of equations in a phase diagram (p C , p A ) in which S is the underlying parameter. This representation facilitates the demonstration of existence and uniqueness of the equilibrium. Most importantly for economic intuition, it enables qualitative results and comparative statics.
Readers most interested in the economic implications can skip this section.

Phase diagram
Let us define x σ , a function of S, by differential equation x σ = ∆ σ [p σ ] · p σ , with x C [0] = 0 and x A [S * ] = 0. Using this notation in equations (4) and (5), we obtain We have an autonomous (S is not in the equations) system of separated variables. We draw the two-dimensional phase diagram with p C ≤ p * C on the horizontal axis and p A ≥ p * A on the vertical one. This quadrant is partitioned into three regions, separated by the isoclines where x C = 0 and x A = 0 are null, i.e.
(CC ) is never empty since by assumption p * C > p * A . (CC ) is above (AA ) in the considered quadrant (see Appendix A.1).
The phase diagram in Figure 1 indicates the shape and relative positions of the trajectories satisfying the motion equations (6) and (7). We define the lowest region, I, as the triangle having (AA ) as a side and (p * C , p * A ) as a vertex; the intermediate region, II, lies between the two lines, and the highest region III is above (CC ). In I, p C < 0 and p A < 0; in II, p C > 0 and p A > 0; in III, p C > 0 and p A > 0. 11 The intersection between (AA ) and horizontal straight line p A = p * A is especially remarkable. We denote it as

Characterization
Proposition 1 1. In equilibrium, the support of S is an interval [0, S * ].
2. Stocks are drained during scarcity episodes and accumulated during abundance epis-

The equilibrium trajectory
4. There is storage in equilibrium (i.e. S * > 0) if and only if 5. The equilibrium is unique.
The overall behavior of the prices in equilibrium can be summarized as follows: the unique equilibrium trajectory is necessarily in I, S varies in the interval [0, S * ) and p A [S] > p * A and p C [S] < p * C for S > 0 and S < S * , and p A [S] and p C [S] decrease with respect to the level of the stock. Figure 1 shows the shape of the equilibrium trajectory. The condition for positive storage (r+λ C )p * A +c < λ C p * C has a precise economic meaning: crises have to be sufficiently likely and/or sufficiently marked to justify storage. If this condition were not satisfied, there would be no stocks in equilibrium: the price would alternate back and forth between p * A in state A and p * C in state C. To avoid this uninteresting case, we assume that the condition for positive storage is satisfied.

Computations
Numerically, the argument used in the proof of Proposition 1 (point 5) has an extremely useful implication: any starting point close to Ω is on a trajectory that is closer to the equilibrium as we go to the right (i.e. as S decreases) in the phase diagram. In other terms, we can control the maximum error on prices at the starting point (close to Ω) given that the system of equations is self-correcting as S decreases. Moreover, the system of equations (6, 7) is autonomous, so leaving aside boundary conditions, we know that if where θ is an arbitrary real.
We can now suggest the following algorithm.

Algorithm 1 (Trajectory)
1. Fix arbitrarily the upper bound at some arbitrary value S.
2. Choose ε > 0 as small as needed. Consider the trajectory through 3. Solve the differential equations numerically and find the stock S < S such that p C [S] = p * C . 4. Shift the calculated functions p C and p A to the left by an amount S; S * ε = S − S approximates the upper bound S * .
The error is controlled by ε (a uniform bound on the error). Remark that along a trajectory, dS dp (trajectory is bounded away from (CC )). Thus we can calculate S * as accurately as desired by computing: 4 Behavior of the economy

Comparative statics
In the absence of an explicit expression of price functions and S * , the comparative statics relies on exploitation of the phase diagram.

Proposition 2 (Comparative statics)
For all S in the support, and for all states and consequently The interpretations are straightforward. An increase in the unit storage costs discourages accumulation, thus at any level of the stocks, the value of the commodity is smaller. Storers will tend to pile up stocks more slowly in abundance, and to run them down faster during crisis. Also, rarer crises diminish the expected yield from storing, to the same effect. This logic has direct consequences on the comparative statics of the limit stock: the value S * , defined as the solution to equation p * Linear case. The effects of varying excess supply functions are intricate if we do not restrict the analysis to a specific parametric family. For example, in the noteworthy case of linear excess supply functions, precise results can be found.
1. For all S in the support and all states σ = C, A and consequently The sign of ∂S * ∂p * A is ambiguous.
2. As a function of β C and β A , p * σ [S] and consequently S * are homogeneous of degree 1.
It is plain that a bigger p * C should increase the value of storage, hence the effect on prices and maximum stocks. In contrast, a bigger p * A has two effects: on the one hand, it increases the price at which stocks are built and thus prices in crisis have to increase altogether to motivate positive holding; on the other hand, the range of prices tightens, meaning that potential gains from the occurrence of a crisis could vanish at smaller values of S. This explains the ambiguity of the impact of p * A on S * . A higher parameter β C means that a given release has a less depressing effect on the price. In other terms, the profitability of storing in view of releasing at high price when state C arises is better warranted. This gives incentives to store more. A higher parameter β A implies that building stocks is easier, since piling up has a lesser inflationary effect on the price, hence the negative effect on the equilibrium price. The second point of the proposition illustrates that the first effect dominates when β C and β A are increased in the same proportion.

Approximate price functions
To better describe the behavior of the economy, we clarify the properties of the equilibrium when stocks are almost empty or close to their maximum. We see in particular how stocks are drained down and why the maximum stocks are not attained in finite time.
Draining out the stock. At S = 0, x C is finite and different from 0 (see equation 6); more precisely, p C is vertically tangent at 0 ( Figure 2). As a consequence, if the economy stays in crisis, the complete drainage of the stocks happens in finite time. To show this, it suffices to integrate in a neighborhood of 0 the differential equation where the RHS can be replaced by its approximation. As long as the economy stays in crisis, starting-without loss of generality-with S 0 at date 0, the integration of equation (16) yields Drainage exhibits smooth landing: the limit of the rate of withdrawal is zero; but drainage time is finite. It is approximately This implies that the economy is protected only twice as long when stocks are quadrupled. The comparative statics on K C is based on (10) in Proposition 2. We have ∂K C ∂λ C < 0, meaning quite naturally, that a larger propensity to return to the scarcity state slows down drainage (precaution). Also, ∂K C ∂c > 0 and ∂K C ∂r > 0, meaning that higher storage costs accelerate drainage for given stocks.
∂λ A > 0 : a higher propensity to return to abundance also accelerates drainage (preservation value is diminished).
Replenishing. The upper bound S * corresponds, as we noticed in subsection 3.2, to a singular point. The calculation of an approximate solution requires several steps. We show in the Appendix A.5 that where K A is a non-negative real number. This implies that p A has a negative finite non-null derivative at S * ( Figure  2): Even if the economy stays in a state of abundance, the upper bound S * is never reached in finite time. The reasoning reminds us of Zeno's classical paradox, Achilles and the Tortoise. As p A covers half its difference with the limit p * A , the variation rate of the stock per unit of time, namely ∆ A , is approximately halved (linear approximation of excess demand at p * A ), meaning that the convergence speed dS/dt is approximately halved. This implies that, whatever the proximity of the target, the duration to cover half the distance to the target is approximately constant, thus the target is never attained.
Example. Using the algorithm of subsection 3.3, we solve numerically the system with the parameters in Table 1. The time unit could be the year. We find approximately S * 9.5. See Figure 2. Table 1: Parameter values Financial and physical costs r = .1 c = .1 Linear excess supply

Stock statistics
A state is described by the stock S and the conjuncture (C or A). All states S ∈ [0, S ] with S < S * are crossed in finite time with probability 1: starting from an arbitrary state, it is easy to find a history (or a set of histories) that leads to another arbitrary state in finite time, this history being associated with positive probability (it suffices to have a long enough accumulation followed by a long enough drainage, or the other way around). Since the equilibrium is Markovian, this property guarantees that there is a unique stationary distribution. This section is essentially devoted to the analysis of this stationary distribution.

Dynamics
The statistical evolution of the system over time when we observe perfectly the state at a given date is covered in Appendix A.6.
A feature of the model is that in the long run initial information loses relevance. Interior states (i.e. values of S different from 0 and S * ) are just crossed as accumulation or drainage goes on; boundary states, if reached, remain in force until a downward or upward jump occurs. Thus, in the long run, S = 0 and S = S * are associated with probabilities whereas values in between are associated with densities.
Densities. Assume that, for interior values of the stock S ∈ (0, S * ), a density f σ [S, t] (with σ = C, A) represents the information we have on the system. Take σ = C to fix ideas. Choose S 1 and S 2 (0 < S 1 < S 2 < S * ) two levels of the stocks. By definition This gives where the first two terms represent the endogenous evolution of the stocks if the economy remains in crisis, and the third and fourth terms represent the exogenous jumps in and out of the segment due to state changes. Figure 3 illustrates this probability balance.
To find the dynamics of the density, we make S 2 converge toward S 1 to get Similarly Probabilities. States S = 0 or S * are associated with probabilities. We have 12 Mass going out Mass coming in Figure 3: Probability balance between t and t + dt.

Jumps Jumps in and out
where the first-term represents jumps out (jumps in are negligible since Pr[A, 0, t] = 0 : due to accumulation, this state is left as soon as attained), and the second term represents the depletion of the last remaining stock. Similarly,

Stationary distribution
The study of stationary distribution can use directly the preceding analysis. We denote the stationary densities by f * ] (density flows). Dropping the time-dependency factor, and replacing the rates of variation of the stocks by their equilibrium values, equations (22,23) become the system of ordinary differential equations We also have from (24,25) Remark that This first order ordinary differential equation is well defined for S ∈ ]0, S * [ and can be solved numerically. The Cauchy-Lipschitz theorem is applicable.
3. Solve numerically the differential equation (31)  7. Normalize f * A and f * C so that the total probability mass equals 1.
Step 3 must be analyzed in detail. Indeed, A ] = 0, meaning that φ might diverge in such a way that normalization is impossible (integrals at step 5 could diverge). In fact, we check in Appendix A.7, that Remark also that the integrals in step 5 can be calculated as accurately as needed, implying that the residual for Pr[0] in step 6 can be computed with the same accuracy. 13 The numerical analysis gives instructive results on the overall behavior of the economy. How frequent are stockouts, i.e. how much is Pr[S = 0] compared to Pr[C](= λ C λ C +λ A )? Is the economy often close to having maximum stocks or is S * a practically unapproachable limit? The last question can be addressed theoretically by characterizing the shape of the density of the stationary equilibrium around S * . Here we can identify which are the critical parameters that determine the regime of the economy. Figure 4 shows the stationary densities for the parameters in Table 1. We find Pr[0] = .1, Pr[S * ] = 0. In fact lim S→0 f C = +∞, but f C is approximately proportional at 0 to 1/ √ S, meaning that the probability of C remains finite (see equation 28). This high density around 0 comes from the fact that the rate of consumption of the stocks decreases steeply as S approaches zero. The high density on the left of S * is explained by the fact that accumulation slows down as the stock approaches S * (see equations (17,18) about drainage speed and time).
In contrast to 0, S * is never attained, as we mentioned in Subsection 4.2. Nevertheless, as Proposition 4 shows, the probability mass can be quite concentrated, under precise circumstances, in the neighborhood of the maximum.

Proposition 4 Let
At S * , f C is of the order of (S * − S) K S * and f A is of the order of (S * − S) K S * −1 .
Consequently, 1. If K S * < 1 : f A increases and diverges as S → S * . Though the maximum is never attained, any neighborhood of S * has a positive probability.
2. If 1 < K S * < 2 : f A converges to 0 at S * with vertical negative slope. The system is close to the maximum with a positive probability.
3. If K S * > 2 : f A converges to 0 at S * with a null slope. The economy is almost surely far from the upper bound.
Given the discontinuous nature of the comparative statics, singular cases with either K S * = 1 or K S * = 2 would require higher order approximations than the one used in Appendix A.8 to be described.
The understanding of the conditions above is relatively complex since all the fundamental parameters play a role. In particular, no simple comparative statics with respect to r or λ C emerge. In contrast, the effects of c, λ A are obvious In the linear case, where in particular The comparative statics on K S * , together with the ones on S * exposed in the comments of Proposition 2, outline a notion of flexibility: the higher K S * , the less flexible the economy is. Excess supply functions measure the response of prices to given variations in stocks. Small maximum stocks correspond to flexible economies for which large storage would be useless, and accordingly the economy has, statistically, enough time to approach this modest target during abundance period. On the contrary, large maximum stocks mean that the economy with seize (almost) any opportunity to accumulate, which happens in economies where building stocks is a costly process. Accordingly, it is very likely that the random alternation between abundance and scarcity episodes will keep the economy far from the bliss point.

Applications and extensions
In this Section, we extend the model by assessing the impact of three kinds of constraints: politically imposed bounds on prices, non-negligible injection and release costs and limited storage capacity.
Analyzing the impact of a constant price on the dynamic system allows a comparison of the results with those proposed by the abundant literature on stabilization. Following on from this, we show that non-negligible injection and release fees can be modelled as parallel shifts in the functions p A [S] and p C [S]. The main results of our analysis are unaffected by this generalization. Finally, assuming that storage capacity is exogenously constrained, we show that in the accumulation phase, the maximal stock is attained in finite time. Moreover, the price for storage service suddenly jumps above marginal cost when capacity saturates.

Stabilization, storage and persistent crises
Assume that a central authority imposes a constant price p * . A price below p * A would not be sustainable in the long run (stock will be drained out shortly). A price above p * C would cause never ending accumulation, which would be uneconomical. So, the relevant policies consider p * A < p * < p * C . Remark that if we preclude rationing, the policy is not strictly applicable since the price must turn to p * C when stocks are empty in state C. With rationing, the price may remain formally at p * , but the marginal shadow value of the commodity would be p * C anyway. To summarize the effect of the policy, the simplest approach is to search for stationary distribution. We can solve (31), i.e.
If p * < p * , then λ A ∆ C + λ C ∆ A > 0 ⇔ λ A ∆ A + λ C ∆ C < 0 : on average, the economy draws on the stocks. This implies that φ A is decreasing and the density is a decreasing exponential: lower stocks are more likely. The distribution has an unbounded support, empty stocks in crisis is an event of positive probability during which the price is p * C . If p * > p * , then λ A ∆ C + λ C ∆ A < 0 ⇔ λ A ∆ A + λ C ∆ C > 0 : on average, the economy piles up stocks. This implies that φ A is increasing unboundedly with respect to S. Higher stocks being increasingly likely, normalization is impossible; in other words there is no well defined stationary distribution. Stocks diverge to infinity with probability one and stabilization, in this sense, succeeds.
The case p * = p * is intriguing. The economy has no tendency to pile up nor to drain out stocks. All positive levels of the stocks are equally likely (the stationary density is flat), meaning that the behavior of the system in the long run is unpredictable.
Stabilization should not be understood in the narrow sense of averaging the price that would be observed in the absence of storage capabilities. Remark indeed that p * , which is the critical threshold, could be higher or lower than the average no-storage price This depends on the sensitivity of excess supply functions to price variations. The conclusion is straightforward: perfect price stabilization can be reached only if the economy is prepared to let stocks go to infinity. The analysis above is easily extended to the case of limited storage capacity. Any upper bound on stocks leaves positive probability on empty stocks. In that case, the probabilities of full storages and stockouts depends on the policy p * chosen.

Injection and release costs
Denote unit injection cost by i and unit release cost by s. Assume that in each state σ = A, C, and for any stocks level S, there are markets for the gas outside and inside the reservoir, the prices being respectively p σ [S] and p I σ [S]. The (competitive) market equilibrium between outside and inside gases implies that, whenever S > 0, The structure of the system of equations is preserved, with p I σ replacing p σ . No arbitrage conditions read Remark that the excess supply functions are shifted, thus boundary conditions are The range of p I σ is narrower than that of p σ : the minimum is higher, the maximum is lower. As a result, the condition ensuring that there is storage in equilibrium is more restrictive than the one in Proposition 1 (Point 4), i.e. in the linear case The phase diagram enables us to show that S * is decreasing with respect to the cost parameters s and i. The rest of the comparative statics is identical.

Limited storage capacity
If the total storage capacity S exceeds S * , then the unconstrained trajectory remains sustainable; else, rational storers anticipate that boundary conditions are modified. As long as some capacity is vacant, then storage price per unit of gas (per unit of time) remains equal to marginal cost c; the system of equations is exactly the same as the one without any constraint, so the equilibrium is described by a trajectory in region I of the phase diagram. Trajectories below the unconstrained equilibrium start on the vertical axis at a given price for S = 0 and stop on the horizontal axis on the right of Ω for a maximum stock which is smaller than S * . There is a unique trajectory such that this maximum stock equals exactly S. It describes the unique equilibrium with limited storage capacity. See for example the dashed trajectory below the bold one in Figure 1.
In the accumulation phase, the price for storage service suddenly jumps above marginal cost when capacity is saturated. We denote it by π A . 14 Given that p A [S] = p * A , the noarbitrage argument in state (A, S = S) can be expressed The LHS measures the potential profit from holding stocks and the RHS the cost. Given that p C [S] > r+λ C λ C p * A + c λ C (the terminal point is on the right of Ω in Figure 1), we have π A > c.
In contrast to the unconstrained case, the maximal stock is attained in finite time if abundance lasts long enough. This explains that the jump in the price of storage services (a discontinuity) is consistent with a continuous price function p A [S] (continuity is necessary for no-arbitrage): before the capacity is full, the price p A [S] decrease steadily; storers incur non-negligible capital losses if the state does not change; this depreciation term does not converge to zero as the maximal stocks are reached; this term is relayed by cost π A > 0 when the constraint becomes binding.

Conclusion
Our model has fully described the behavior of a Markov economy in which storage dynamics are determined by random occurrence of crises. Overall, we have proposed the quite appealing notion of "flexible economy". We have proved that in equilibrium, a more flexible economy (i.e. better able to absorb shocks via production and consumption changes), is less keen to build up large stocks and is much more likely (in terms of probability) to hold maximum stocks. If the reluctance to build large stocks is intuitive, since overall, the value of stocks (or the convenience yield) decreases when an economy can promptly react to a shock, release dynamics are less intuitive. We show that flexible economies go fast towards maximum stocks and just stay there until a shock leads to fast drainage, while inflexible economies incur permanent movement of their stocks, and over a wider interval. This relationship between flexibility and maximum stocks is a result of interest. On this ground, it could be argued that security of supply policies for energy or banking rules for emission rights, which are never neutral with respect to the market equilibrium, should not be set equally across European states, inasmuch as their capabilities to respond to shocks is heterogeneous.

A.1 Phase diagram
Compared to (AA ), (CC ) cuts the horizontal axis with a smaller value of p C . It suffices to inject p A = p * A in both equations and to check that This is obvious.
To show that (CC ) cuts the vertical axis with a larger value of p A than (AA ), we inject p C = p * C into both equations and check that the following equation remains true (obvious) If over some interval, , accumulation during crises is motivated only by the fact that the price is expected to rise if the economy stays in crisis (an episode of abundance causes a negative shock on the price). This means that dp * C [S]/dS > 0. In consequence, the price in state C is unbounded as well as the support of S, since any length for an episode of scarcity has positive probability to be exceeded. Such a bubble is unreasonable since it would imply unbounded storage capacity (a transversality condition would translate this common sense remark into mathematical language). These arguments show that . Remark now that if the lower bound of the support were strictly positive, this would mean that a certain quantity of the commodity would be permanently frozen. Denote this level by S min . Necessarily, p C [S min ] = p * C , meaning that if the economy stays in crisis for a long time (a possible event), storers have to pay storage costs without compensation in potential price movements. Consequently, support is bounded below by 0 (S min = 0).
3. If p C [0] < p * C , final demand would exceed production for S = 0, which is impossible with empty storages. This proves that the trajectory starts on the vertical axis (p C [0] = p * C ). Assume that there is an ε > 0 such that p A stays larger than p * A + ε as S increases. Given the phase diagram, p A reaches its minimum on the straight line (AA ), if the trajectory starts in I. In any case, as S increases, the trajectory enters in II, then in III, implying that p A overshoots r+λ A λ A p * C + c λ A (intersection between (CC ) and vertical axis). In other terms, for any large enough S, p A overshoots p * C while p C remains below p * C . Thus, as S continues to grow, x A /x C remains finite whether or not p A tends towards infinity. We conclude that any trajectory in III reaches the vertical axis p C = p * C for a finite value of the stock. At this point, drainage stops in state C, but accumulation continues in state A (x A > 0)), meaning that the stock is never going to be used in the future, which is uneconomical (see point 1 in this proof).
We conclude from the contradiction that accumulation must stop in state A for some stocks S * ; thus necessarily p A [S * ] = p * A . Remark that this can only happen in I on the horizontal axis at point Ω.
This corresponds to Ω = ( r+λ C λ C p * A + c λ C , p * A ). For this intersection to exist, i.e. for I not to be empty, a sufficient and necessary condition is 5. We show that there is a unique trajectory passing through Ω. The Cauchy-Lipschitz Theorem cannot be applied since the system is singular at Ω. We use the following argument: choose any starting point in the interior of I, denoted by (p 0 C , p 0 A ); it is necessarily nonsingular. The trajectory passing through this point is unique (Cauchy-Lipschitz). Consider the point (p 0 C , p 0 A + ε) where ε is some small real. Straightforward calculations show that the slope of the trajectory passing through (p 0 C , p 0 A + ε), which is positive, decreases as ε increases. One can directly reason on This means that trajectories move apart as S increases, i.e. as they approach Ω. The consequence is that there cannot be multiple trajectories through Ω. This proves existence and uniqueness.

A.3 Proof of Proposition 2
We first determine how trajectories move in the phase diagram as parameters change. Rewrite the system of ODE in compact for as p A = P A (p C , p A , c, r, λ A , λ C ) or simply P A ( < 0 in region I).
Note that ∂P C ∂c = 1/∆ C [p C ] < 0 and ∂P A ∂c = 1/∆ A [p A ] > 0, thus p A /p C = P A /P C decreases as c increases (all trajectories in I are flatter). Similar observations prove that all trajectories in I are also flatter when r increases, when λ A increases and when λ C decreases.
We can now position equilibrium trajectories as parameters change. Increasing c or r, or decreasing λ C , move Ω to the right; increasing λ A has not effect on Ω. In all cases, the equilibrium trajectory moves below the former one: to each p C is associated a smaller p A .
Remark that dS dp C = 1/P C < 0, thus dp C P C (summation along the equilibrium trajectory).
Since Ω goes to the right as c increases, the range of p C becomes smaller; it remains to be verified that 1/P C , as a function of p C , is also smaller. For example, along the equilibrium trajectories, for a fixed p C (P C grows in absolute value and thus 1/P C decreases in absolute value.) This proves that as c increases, a given price is associated with a smaller S. Similar reasonings can be applied to the other parameters to prove the claims.

A.4 Proof of Proposition 3
We have Clearly, trajectories in I are steeper with a higher β C or a smaller β A . Remark that the frontier of I (Ω in particular) is unchanged in this comparative statics. Remark also (this concerns point 2) that a proportional increase of β C and β A does not change the trajectories (but a given point corresponds to a different S). The type of reasoning used in the proof of Proposition 2 can now be applied to show the claims.
The comparative statics with respect to p * C and p * A require further precautions. In the former, remark that trajectories are steeper with a higher p * C (p C < p * C ) and that I is extended to the right (trajectories are simply going further to the right). These two effects concur to increase the price for given stocks. In the latter, trajectories are flatter with a (say) smaller p * A but Ω moves along down (AA ). The first effect decreases prices, hence point 1, but the second could lead to a higher S * (a smaller function is integrated over a longer interval, since the range of p C increases, see equation 53).

A.5 Equivalent expressions for prices
On the right of 0. We have thus, writing first-order approximation on both sides we get which yields On the left of S * . Given that, according to (6), Given that we can calculate that We plug these two equivalent expressions into (7), which yields Consider now the ODE The unique solution to (63) is We show now that this exact solution of approximate ODE (63) (62). For all ε > 0, there is a left neighborhood of S * , denoted V ε , in which the absolute value of the residual is smaller than ε × (S * − S) and ε × (x The solution to this equation is smaller than x A on V ε : indeed, both x A and y are negative, but if y > x A for some S in V ε , it remains so for any larger stock because y > x A . This is in contradiction with the fact that y[S * ] = x A [S * ]. In other terms, A similar reasoning shows that These two inequalities give the approximation of x A at S * .

A.6 Statistical evolution from a known state
To fix ideas, denote the observed state at, say, date t = 0, by conjuncture A and stocks S 0 . Conditionally on staying in state A, the probability mass (initially 1) is attached to a unique level of the stocks; but this mass itself is eroded by potential jumps. Other states (except 0 and S * ) are associated with a density, as we shall develop now. The mass point S max [t] (where the index max recalls that the support of the distribution is bounded above by this time dependent value) evolves following whereas the lower bound of the distribution follows Both values move deterministically. Clearly, which is the probability that no crisis has ever happened since date 0.
States inside the interval [S min [t], S max [t]] are associated with a positive density; outside the interval, density is null. States (C, 0, t) and (A, S max [t], t) are mass points (the former only after some time has elapsed, so that S min has reached 0).
To fully characterize the statistical evolution from a known state, we prove the following preliminary lemma that explains how a pointwise probability becomes a density.
Proof. Consider states {(C, S)|S ∈ [S max [t] − dS, S max [t]]} with dS small. To calculate the probability of this event at date t, we have to trace back histories that lead to these states.
Denote dt and dS A the unique time interval and stock variation such that a jump from (A, S max [t] − dS A ) to (C, S max [t] − dS A ) at date t − dt followed by drainage between date t − dt and t has led to state (C, S max [t] − dS).
Clearly, all the jumps happening from the current mass point between dates t − dt and t (and only these), give states in [S max [t] − dS, S max [t]] at date t. 15 So a first-order approximation of the probability we seek is the probability that a jump from {(A, S)|S ∈ [S max [t] − dS A , S max [t]]} to C has taken place between date t − dt and t. This probability is λ C e −λ C t dt, thus We have to calculate the relationship between dS C , dS A , and dt. From the stock dynamics we have .
The middle term is the time needed, given drainage speed, to pass from stocks S max [t] − dS A to stocks S max [t]−dS. The RHS is the time needed, given accumulation speed, to pass from S max [t]−dS A to S max [t].
After straightforward substitutions, we let dS go to 0 and prove the result.
We are now equipped with a complete set of equations to describe the dynamics. Indeed, (71) and (22,23) can be used to describe statistically the system over time. The exercise is numerically demanding.

A.7 Proof of convergence of Algorithm 2
Remark that the ODE commanding φ A can be written On the right of S = 0, ∆ C → 0 so the RHS of (74) is equivalent to − λ A ∆ C , i.e., using (15), to K0 √ S where K 0 is a nonnegative real Thus lim S→0 φ A is finite and strictly positive. Indeed, for all ε > 0, there exists η such that for all S ≤ η, Take S 1 and S 2 both smaller than η with S 1 ≤ S 2 and integrate the inequality above between these two reals. We find This proves that φ A is bounded away from 0 (fix S 2 and let S 1 converge to 0). Given that φ A is also monotonic (increasing) in a neighborhood of 0, the limit that we denote by φ A [0] exists and is nonnegative. So, at 0, f A is finite and nonnegative whereas f C ∼ 0 S where K f C is some nonnegative real. This implies that, though the density f C diverges at 0, its integral is well defined.

A.8 Proof of Proposition 4
On the left of S * , ∆ A → 0 so the RHS of (74) is equivalent to − λ C ∆ A , i.e. K S * S−S * where K S * is a nonnegative real with For all ε > 0, there exists η such that for all S ≥ S * − η, Take S 1 and S 2 both larger than S * − η with S 1 ≤ S 2 and integrate the inequality between these two real numbers. We find i.e. S * − S 2 S * − S 1 This implies that lim S→S * φ A = 0, from which we can conclude that Pr[S * ] = 0.
We can now derive a tight condition on the shape of the density function f A around the upper bound S * . Indeed, given that φ Equation (82) together with φ C = −φ A proves Proposition 4.