Quickest Detection of Ecological Regimes for Natural Resource Management

We study the stochastic dynamics of natural resources under the threat of ecological regime shifts. We establish a Pareto optimal framework of regime shift detection under uncertainty that minimizes the delay with which economic agents become aware of the shift. We integrate ecosystem surveillance in the formation of optimal resource extraction policies. We fully solve the case of a profit-maximizing monopolist, study its response to regime shift detection and show the generality of our framework by extending our results to other decision makers and functional forms.We apply our framework to the case of the Cantareira water reservoir in S\~ao Paulo, Brazil, and study the events that led to its depletion and the consequent water supply crisis.


Introduction
The dynamic management of natural resources requires making decisions under ecological uncertainty, defined by Pindyck (2002) as uncertainty over the evolution of the relevant ecosystem.Stochastic bio-economic models traditionally capture this uncertainty by describing environmental fluctuations as idiosyncratic shocks affecting the stock of natural resources.Another way ecological uncertainty can manifest itself, particularly for renewable resources, is by means of regime shifts, broadly identifiable as abrupt changes in the structure of the resource ecosystem such as the underlying population dynamics or the resource's ability to regenerate (Biggs et al., 2009).Regime shifts can cause substantial changes in the provision of ecosystem services, and can have significant impacts on both economic systems and the well-being of populations (Stern, 2006).Their occurrence has been extensively documented as a consequence of both natural and anthropogenic factors such as climate change and environmental overexploitation.Recent examples can be found in the logged tropical rainforests in parts of Asia, South America and Africa which have become more fire-prone leading to a regime shift towards exotic fire-promoting grasslands (Lindenmayer et al., 2011), or in the human-induced regime change in the Baltic Sea from cod to sprat and herring as dominant species in the fish population (Österblom et al., 2007).
There is an extensive literature studying the impact of stochasticity on renewable resource extraction and harvesting activities, dating from Pindyck (1984 and1987) and Reed (1988) up to Saphores (2003), Alvarez and Koskela (2007) and Springborn and Sanchirico (2013).An emerging literature focuses on resource management under potential regime shifts, intended as structural changes in ecosystem dynamics: Polasky et al. (2011) shows how the threat of a regime shift can yield a precautionary extraction policy.Ren and Polasky (2014), Baggio and Fackler (2016), de Zeeuw and He (2017), Costello et al. (2019), Arvaniti et al. (2019), Crépin and Naevdal (2020), Kvamsdal (2022), Patto and Rosa (2022) and Nkuiya and Diekert (2023) extend the analysis to endogeneity, reversibility and observability of the regime shift.Sakamoto (2014) and Diekert (2017) explicitly consider a strategic environment and show how the potential occurrence of a catastrophic regime shift can facilitate cooperation between competing economic agents.
The main challenge in responding optimally to a regime shift is precisely the dual nature of the ecological uncertainty that economic agents face: the exact moment at which the shift occurs is unknown ex ante, and it is often not an easy feat to immediately disentangle structural changes in the ecosystem from idiosyncratic environmental fluctuations.This problem is further amplified by the fact that ecosystems are in constant evolution, and multiple large-scale changes to their structure are often caused or accelerated by economic activity.Barrett (2013) shows how uncertainty over tipping points' thresholds, rather than uncertainty over consequences, can cause coordination between economic agents to collapse.Crépin et al. (2012) highlight the importance of adaptive resource management in understanding the likelihood of regime shifts and their consequent impacts on human well-being.
The primary contribution of the paper is the integration of environmental surveillance and regime shift detection in a model of natural resource extraction.Environmental monitoring is a common practice in real-world resource management: for example, the Norwegian company Aker BioMarine, a global krill monopoly, uses drones to collect, process and transmit density and distribution on the krill biomass.1 Additionally, water utilities such as Aguas Andinas in Chile (a private water monopoly), Anglian Water in the UK and American Water in the USA are increasingly reliant on remote sensing techniques for monitoring, prediction and control of algae blooms in real time.2These techniques, combined with in situ measurements, constitute some of the most effective ways for efficient management and controlled exploitation of natural resources.In ecology, using real-time remote sensing data is increasingly common, especially with indicators of approaching thresholds or impending collapse in ecosystems (Batt et al., 2013;Carpenter et al., 2014).Our framework is therefore particularly relevant as it sheds light on how firms operate within modern-day resource markets, in which monitoring resource stocks takes an increasingly central role as drastic ecosystem changes become more frequent.
The surveillance and detection of regime shifts can substantially alter constraints and incentives faced by economic agents who extract natural resources.In this paper we first characterize the losses stemming from the ecological uncertainty of regime shifts, which manifest in the delay with which the agents become aware of their occurrence.Minimizing this delay requires the agents to be able to detect the presence of a regime shift in the quickest time possible.The problem involves the search for a way to deduce the occurrence of a general change in the drift of the controlled stochastic process that drives the natural resource evolution, and is formulated as an optimal stopping problem.This class of problems are known as quickest detection problems. 3Originated in the Brownian disorder literature pioneered by Shiryaev (1963Shiryaev ( , 1996)), detection methods have found multiple applications throughout the statistical and econometric literature, from Krämer et al. (1988) and Ploberger and Krämer (1992) to Horváth and Trapani (2022).Building on Moustakides (2004)'s work on drift changes in martingales, we present a framework with general controlled Itô diffusions that minimizes the efficiency loss caused by incomplete observability of the environmental conditions in which agents operate.To our knowledge, ours is the first paper to integrate these results in a continuous-time optimization problem in economics, and particularly in the regime shifts and renewable resources literature.More importantly, we show Pareto optimality of our framework for any resource-extracting economic agent.
In order to understand the impact of anticipating regime shift on the agents' incentives, and especially within our framework of quickest detection, it is of importance to include in the analysis the criteria used by decision makers for their resource use.We therefore integrate the surveillance procedure in the optimization problem of a resource-extracting monopolist, such that the firm maximizes its profits with respect to the resource dynamics over different periods determined by the detection time.
We solve the monopolist's problem under regime shift detection by characterizing its value function as a viscosity solution of the Hamilton-Jacobi-Bellman partial differential equation associated with the optimization problem over the periods defined by the detection time.Whilst we focus on solving the case of a monopolist, our solution technique is entirely general, and can be used to model any decision maker maximizing a general criterion satisfying a broad set of requirements.We extend our framework to include the detection of multiple regime shifts, under both full and partial information on the magnitude of such shifts.We show that a monopolist facing an isoelastic demand when anticipating an adverse (positive) regime shift will increase (decrease) its extraction and post-detection will reach a new higher (lower) extraction rate.Whether the immediate change in extraction is gradual or abrupt, as well as the slope of the extraction policy, is determined by the magnitude of the regime shift and how quickly the new regime is detected by the firm.
We then introduce a set of extensions to our framework.We first examine the case of a government seeking to maximize social welfare.While the anticipation of an adverse regime shift may lead the monopolist to adopt an aggressive policy, the government can pursue a precautionary extraction path instead, if societal risk aversion is high.As another benchmark, we solve the case of perfect competition, showing how the competitive extraction policy in prospect of an adverse regime shift always exceeds the monopolist.We further show numerical evidence of how a monopolist facing a linear demand structure under resource dynamics subject to arithmetic fluctuations and a periodic drift can yield both precautionary and aggressive extraction strategies as a consequence of an adverse regime shift.
Overall, our results shed an important light on the responses of different economic agents to ecological uncertainty.
We then apply our framework to the case of the Cantareira water reservoir, a large-scale system of interconnected reservoirs which serves the Metropolitan Area of of São Paulo in Brazil.The reservoir is managed by Companhia de Saneamento Básico do Estado de São Paulo (SABESP), a water and waste management company acting as a semi-public natural monopoly.In early 2013, the reservoir's stored water volume began decreasing sharply and by July 2014 its operational capacity was depleted, leaving a densely populated area inhabited by more than 25 million people in a devastating water crisis.Using daily data on reservoir volume, water pumping, rainfall and river inflows, we show how the depletion was caused by a catastrophic regime shift in the reservoir dynamics, and estimate the structural parameters pre-and post-shift via particle filtering.We find that the implementation of our detection procedure could have allowed the water monopolist to detect its occurrence more than six months ahead of the delayed time at which it changed its pumping policy.We further show counterfactual evidence of how adjusting the policy at the detection time could have substantially delayed depletion, if not avoided it altogether, and therefore could have drastically dampened the severe impact of the water supply crisis on the population.
The remainder of the paper is structured as follows.Section 2.1 formalizes the resource dynamics, sets up the detection procedure and shows its Pareto optimality.Section 2.2 solves the monopolist's optimization problem within different scenarios.Section 2.3 explores the characteristics of the solution to the firm's problem, shows the different policy responses to regime shifts, and section 2.4 presents a set of extensions.Section 3 presents the application of our framework to the case of the Cantareira water reservoir, and section 4 concludes.

Resource dynamics, regime shifts and quickest detection
We start by modeling the stochastic dynamics of a renewable resource extracted by an economic agent.Let X t be the resource stock available at time t, which behaves according to the stochastic differential equation (SDE) where q t ∈ R + is the extraction policy, σ t = σ(X t , t) is the intensity of noise in the evolution of the resource stock, µ t = µ(X t , t) is the process that drives the resource growth and X t ≥ 0. Finally, W t is the standard Brownian motion in the filtered probability space (R, F t , P ).The processes µ t , q t , σ t are adapted to the same filtration F t , and satisfy the standard requirements for existence and uniqueness of a weak solution for (1).4 In order to capture the regime shift that the resource dynamics can undergo, we describe two alternative scenarios faced by the agent: one in which the resource evolves according to equation (1), and an alternate one in which the stock's ability to regenerate (the drift) changes.This is consistent with Polasky et al. (2011), who define regime shift as a change in the system dynamics such as the intrinsic growth rate or the carrying capacity of the resource.The evolution for the resource stock then becomes where λ t := λ(X t , t) ∈ R is the change in resource growth, also adapted to F t .If λ t < 0 ∀t, the growth rate of the resource is reduced and it undergoes a negative (adverse) regime shift, and vice versa.The regime shift can be made dependent on antecedent factors and we can write λ t := λ(X t , t, Θ), where Θ is the information set the agent has when it starts monitoring the resource stock.By antecedent factors we imply any process adapted to the filtration F 0 , which does not vary during the surveillance period and contributes to the knowledge the agent has at t = 0 on the magnitude of the regime shift λ t .The set Θ can be constructed to include any early warning signals available at t = 0 which can signal the likelihood and magnitude of regime shift, such as "critical slowing-down" (Scheffer et al., 2009) and self-organized spatial patterns (Rietkerk et al., 2004).Such indicators are key features of coupled human-environment systems (Boettiger and Hastings, 2012;Bauch et al., 2016).Furthermore, Θ can include information on the agent's extraction policy adopted before the initial observation time, allowing us to study a framework in which past extraction activity can determine future changes in resource growth.
We therefore want to study the scenario in which at a given change point in time θ, which is happening with certainty but at time unknown, the SDE driving the resource stock will switch between drifts: (3) Note that since the occurrence of θ is certain, the question faced by the agent is not if a regime shift will occur but rather when.The agent now faces two sources of uncertainty when choosing the extraction policy that maximizes its profits.The first source is given by the Brownian motion W t calibrated by the diffusion coefficient σ t , which represents the fluctuations inherent to the natural randomness of environmental conditions.The second source is the uncertainty over the timing θ of the shift, at which the resource's drift changes from µ t to µ t + λ t .Whilst being unknown to the agent ex ante, the change point would be immediately inferable in absence of fluctuations.In presence of fluctuations, however, the agent needs to be able to distinguish the structural change in the drift from idiosyncratic noise.
We now need to establish from a decision maker's perspective the importance of adjusting to a regime shift in the ecosystem as quickly as possible.Why should an economic agent undertake any supplementary analysis in order to infer whether the regime shift has actually occurred?Let us formalize this point.The extraction policy q is chosen by the agent according to a specific criterion J(q) := J(q, x).From Section 2.2 onwards, we will assume the agent to be a monopolist firm that follows a profit-maximizing criterion but this framework can be applied to any optimizing economic decision maker.5For a government, this criterion would be expressed in terms of social welfare, for a risk-averse individual it would be in terms of utility drawn from resource consumption.The pre-regime shift extraction policy q µ := q µ (x, t) is optimal, in the sense that it is chosen by the agent such that it maximizes their expected discounted criterion J(q) within a given time horizon τ i.e.
where Q := Q(x, t) is the non-empty set of Markovian admissible controls in feedback form such that E τ t |e −ρs J(q)| ds < ∞ for all t < τ , q ∈ Q and ρ > 0 is the discount rate.For now, we only posit the policy exists and is progressively measurable with respect to F t .
Let us now assume that the regime shift occurs in the dynamics of X t as shown in (3) but the agent only realizes the occurrence of the shift at τ > θ, thus with a delay τ − θ.This implies that there exists an extraction policy q λ := q λ (x, t) in the time interval [θ, τ ] that achieves the supremum of the discounted criterion function, i.e.
Because of this delay, the agent will continue to extract according to the policy q µ that achieves the supremum of the optimization problem constrained by the pre-regime shift resource dynamics dX t = (µ t − q µ )dt + σ t dW t .The agent, therefore, will incur a loss expressed in the same unit as the criterion (utility/welfare/profits) which is increasing in the detection delay.
The rationale is intuitive: the losses are generated by the fact that the agent chooses its extraction policy by maximizing a criterion which hinges upon the continuous observation of the evolution of the resource X t as given by (3).If the changepoint θ was observable, the agent would immediately adjust extraction in order to adapt to the post-shift resource growth µ t + λ t .On the contrary, if the agent realizes the occurrence of the regime shift with a delay at τ > θ and only then adjusts extraction, within the time interval [θ, τ ] the agent is de facto extracting a "wrong" quantity that is optimal for the pre-shift problem but sub-optimal for the post-shift one.Figure 1 presents a schematic representation of this phenomenon.In Appendix A.1 we prove that this loss is increasing in the length of the delay and characterize explicitly the stochastic dynamics of the loss function in terms of the gradients of the Hamilton-Jacobi-Bellman equations associated to the respective optimization problems.
The problem now involves the minimization of the delay τ − θ, which implies finding a strategy to detect the change in drift of X t in the quickest time possible via sequential observations, as seen in (3).
In order to solve this problem the agent searches for a "rule" (an optimal stopping time) τ adapted to the filtration F t , at which one can conclude the change point θ has been reached and the regime shift has occurred.As delays are costly, this search requires the optimization of the tradeoff between two measures, one being the delay between the time a change occurs and it is detected i.e. (τ − θ) + , and the other being a measure of the frequency of false alarms for events of the type (τ < θ).The agent minimizes the worst possible detection delay over all possible realizations of paths of X t before the change and over all possible change points θ.This problem is formalized as This class of problems is usually comprised of three elements: a controlled stochastic process under observation (the evolution of the renewable resource), an unknown change point at which the properties of the process change (a regime shift), and a decision maker observing the process.In this search there has to be an expected "time to first false alarm", which represents the minimum time that the agent is willing to wait before reassessing its decisions when no shift is yet detected.This is to include in the process the fact that the signal (the change in the drift due to a regime shift) can be drowned in a noisy environment that does not allow for its detection within a "reasonable" time frame.This constraint has been formalized by Shiryaev (1963) and Lorden (1971) in the following way: for when the regime shift is a constant λ ∈ R, and a divergence-type criterion by Moustakides (2004) for a general time-varying regime shift.
The procedure to determine τ is given by adapting the results of Moustakides (2004) to our framework (3) first via a transformation of the diffusion coefficient and then a change of probability measure, both shown in detail in Appendix A.2.The stopping time that solves (4) is given by: where u t is given by where in which any primitive of the function σ(t, x) −1 may be used.The process u t is the logarithm of the Radon-Nikodym derivative between the probability measure post-regime shift and the measure pre-regime shift of the process Xt , and Q is the probability measure under which Xt<θ is a martingale.
The false alarm constraint faced by the agent is given by and the threshold ν ∈ R + is set such that it solves e ν − ν − 1 = T, is unique for each choice of T , and the constraint ( 8) is binding with equality.Shiryaev (1963) studied the simplified scenario of the so-called "Brownian disorder" for a Brownian motion with constant diffusion coefficient σ ∈ R and at t = θ the drift changes to λ ∈ R. Note how (8) essentially reduces to (5) for constant λ and σ.Adapting this case to our framework, which will be of relevance in our subsequent applications, the optimal stopping time under the constraint (5) is given by ( 6) where now one has under the martingale measure Q for the pre-regime shift resource stock X t .The threshold ν is the solution of the equation 2σ 2 λ 2 (e ν − ν − 1) = T .Furthermore, the expected delay of detection is given by The detection procedure involves observing the process given by the resource stock's log-likelihood ratio (the Radon-Nikodym derivative) of the resource dynamics under the two regimes, and comparing it to its minimum. 6If the two regimes are very similar (for example, if |λ| is very small in the constant diffusion coefficient case), then the Radon-Nikodym derivative between the two measures will often be close to unity.In this case the process u t − inf 0≤s≤t u s , u t ≥ 0, which is known as a cumulative sum (CUSUM) process, will remain close to zero.This implies that unless the diffusion coefficient is very small, it will take longer on average to detect the presence of such a small drift change.On the other hand, if the two regimes are substantially different, then one should be able to detect the change faster.At the stopping time τ the agent will detect the change in drift, which is the change from a Q-martingale to a Q-sub/supermartingale.
Constraints ( 5) and ( 8) may not appear intuitive but can be understood in the context of costly false alarms i.e. if a negligible regime shift is expected the agent would be willing to tolerate for longer the uncertainty on θ.For a small λ t , the difference between the pre-and post-shift problems is negligible and therefore so is the loss incurred within the delay.In either case, T := T (Θ) is decided ex ante by the agent and it can be interpreted as a measure of tolerance to ecological uncertainty.Additionally, T can also be a measure of the "quality" of the detection system as it bounds the expected delay in the detection under a false alarm, i.e. the minimum waiting time the agent faces when θ = ∞ (the change point never occurs) before reassessing extraction decisions.This quantity depends on the ex ante information the agent has on the magnitude of the regime shift, as well as early warning signals on the proximity of structural changes.The effective time period in which the agent optimizes is therefore between t = 0 and the final time given by a combination of T and τ (λ t , ν) i.e. the expected time to first reassessment plus the delay of detection.The "tolerance" T is chosen by the agent, however, τ (λ t , ν) is a random variable.Since the agent knows the average delay time of detection it can assume as time horizon the sum of the expectations of both change-point and delay, which is equivalent to taking an ex ante time interval In the baseline detection case the agent has a uniform/uninformative prior on the time of the regime shift θ.7 Monitoring continuously the resource stock X t can be a costly procedure.However, obtaining a constant stream of data on X t is already required in order for the agent to calculate its optimal extraction policy in (3).This cost can be included straightforwardly in the criterion J and once included, the added costs of undertaking the detection procedure are negligible.On the other hand, the loss the agent incurs in not implementing the procedure is non-zero and increasing in the delay.
Implementing a detection procedure that minimizes the delay, and therefore our framework, is Pareto optimal.

The resource extraction problem
The detection strategy presented in the previous section applies to a very general framework.The strategy takes the optimal extraction policy q as given, as well as known to the agent (i.e. is F tadapted).In this section we study what is the optimal extraction policy of an agent that wants to implement the detection procedure in its decision-making process.We want to further remark that the solution procedure presented in this section can be applied equivalently to a general decision maker maximizing any criterion J that allows for an admissible solution, under the requirements discussed in Section 2.1.In order to obtain a tractable form for the optimal q we assume the dynamics of the resource stock X t to follow a controlled geometric Brownian motion, which is Eq.(3) with µ t = µX t as resource growth, λ t = λX t as regime shift and σ t = σX t as diffusion coefficient, where µ, λ ∈ R, σ ∈ R + .
The detection problem is now a detection of a regime shift yielding a change in the growth rate of the (uncontrolled) resource stock from µX t to (µ + λ)X t .The first question that we need to address is how can the detection procedure be integrated in this framework, and what are its implications for the firm's extraction decisions.
We now assume a risk-neutral monopolist which faces an isoelastic inverse demand function of the form q(p) = bp −γ and with a marginal cost function defined as c(x The extraction rate is chosen by the firm in order to maximize the expected value of the sum of discounted profits under the resource dynamics (3), and the profit function takes the form We assume a profit function depending on both the stock level X and the extracted quantity q which implies a marginal cost function linear in extraction, rather than the stock level, and no fixed operating costs.This assumption can be relaxed at the expense of an optimal extraction function only available in entirely numerical form.
The simplest way of modeling a regime shift is to assume that the shift occurs only once and there are only two periods, pre-shift and post-shift.The firm's problem therefore reads: and (6), and the extraction policy exists among the class of admissible Markov controls Q.A natural boundary condition of this problem is q * (0, t) = 0.Here the firm faces a constant λ for the second period.The solution to this problem is presented in the following Proposition: Proposition 1.The extraction policy that solves the monopolist's problem (12) is given by: where ϕ(t) : R + → R for t ∈ [0, τ ] is the solution to the ordinary differential equation 2 > 0 and equipped with the boundary condition ϕ(τ ) = ϕ s µ+λ , where ϕ s µ+λ 8 Cost functions of this form also allow us to flexibly model a natural monopoly, as the technical definition of a natural monopoly is that the cost function is subadditive.That is, c(x, q1 + q2) ≤ c(x, q1) + c(x, q2).Hence it is always cheaper to produce q1 + q2 units of output using a single firm than using two or more firms.Lastly, the specific choice of −1/γ for the marginal cost exponent is necessary to obtain a quasi-explicit solution.For a discussion of this cost function in a resource extraction setting we refer to Pindyck (1987).
is a positive constant that solves the equation and ϕ(t) = ϕ s µ+λ for t ≥ τ .The resource rent for the monopolist is given by which is the value of a marginal unit of in situ stock.
Proof: See Appendix A.3, where we show how the monopolist's value function V can be characterized as a viscosity solution of the Hamilton-Jacobi-Bellman equation associated with the optimization problem (12). 9Note that is the optimal extraction rate q * /X t for a stationary problem (i.e. when τ → ∞) when there is no detection procedure put into place, and the firm never realizes the occurrence of a regime shift, and ϕ s µ+λ identifies B s µ+λ , the extraction rate of the stationary problem post-shift.Lastly, we remark once more that one can use the same boundary conditions and viscosity argument in order to solve the problem of a general decision maker facing a general resource constraint such as (1), as long as the problem dynamics satisfy the same conditions discussed in Section 2.1 that allow for the existence of a feasible extraction policy within each period, which is progressively measurable with respect to F t .Sakamoto (2014) highlights that ecological shifts are better modeled as open-ended processes in which several regime shifts can occur.For example, Hare and Mantua (2000) show that the aquatic ecosystem in the North Pacific Ocean has experienced multiple regime shifts for the past forty years.
Within an open-ended, multi-regime setting, the firm detects subsequent regime changes λ 1 , λ 2 , . . .throughout successive periods.It is however unlikely that the firm knows the magnitude of the regime shifts beyond the one it is currently detecting.This issue is especially present if the regime shift magnitude depends on the amount extracted or the state of the resource.The way the firm's problem is therefore set up is that in each period [τ i , τ i+1 ) the firm will undergo the detection procedure for the regime shift λ i+1 .Once the regime shift is detected the firm will update the set Θ using all available information at τ i+1 such as the stock level X τ i+1 or the total extraction up to τ i+1 and form expectations on the magnitude of the next regime shift λ i+2 thus restarting the detection process.The stochastic control problem of the firm will therefore read: 9 The optimal extraction policy is therefore a weak solution of (12).
where i ∈ N are the different periods, Here λ 0 = 0, since in the first period [0, τ ] the growth rate of the resource stock is µ, and τ i , λ i are the subsequent periods and relative changes in resource growth.Here we formalize the structure of the firm's extraction decisions in a sequential manner.Once solved, this problem will yield a piecewise continuous control.The key issue in this sequential formulation is that the firm does not know at t = 0 the entire sequence of regime shifts {λ i }, but rather only the one that it is trying to detect.After each detection τ i the firm updates its set Θ and constructs expectations on the magnitude of the next regime shift λ i+1 and the next detection time τ i+1 .The firm's optimal extraction policy is presented in the following Proposition.
Proposition 2. The extraction policy that solves the monopolist's problem (17) is a sequence {q * i (X t , t)}, i ∈ N + of the optimal policies for each time period i : t ∈ [τ i , τ i+1 ].The optimal policy for each period i is given by: where ϕ i (t) is the solution to the ordinary differential equation equipped with the boundary condition ϕ i (τ i+1 ) = ϕ s i+1 , where ϕ s i+1 is a constant that solves the equation Proof: See Appendix A.3.
It could now be of relevance to model a "full information" scenario in which there is a finite number N of subsequent regime shifts {λ 1 , . . ., λ N }, and the firm knows their magnitude at t = 0.This problem now reads as follows: where we note that now the expectation in the criterion is evaluated at time t = 0.The solution of this problem is presented in the following Proposition: Proposition 3: The optimal policy for the monopolist facing the sequential problem (21) under full information of the sequence {0, λ 1 , . . ., λ N } has the same form as (18) and ( 19), but the time-varying policies B i (t) are determined by boundary conditions obtained by backward induction: Proof: See Appendix A.3.
It can be easily seen that the two-period, one regime shift problem ( 12) is equivalent to the full information problem (21) over two periods, by simply noting that in this case at τ (now the only change point) the boundary condition is ϕ 1 (τ ) = ϕ s 1 , which is precisely the boundary condition of Proposition 1.
Since in every scenario the optimal extraction policy is linear in X t and the regime shift λ i enters log-linearly at each θ, the optimally controlled resource stock process expressed in growth rates is equivalent to a Brownian disorder problem.It is therefore clear that one can implement detection procedure with constant parameters described in Section 2.1 by applying it to the process in each period i : [τ i , τ i+1 ], under a change of measure such that the pre-shift process log(X t ) is a martingale.
The choice of T , mean time to the first false alarm, is left for the firm to choose based on its information set Θ, and is therefore arbitrary.It is however a relevant parameter in our framework as it regulates the threshold at which the process (7) triggers the detection, and consequently sets the time horizon in which the firm operates.It is therefore important to understand the effect of varying T on both resource and extraction dynamics, and establish a set of criteria for its choice.Figure 2 shows how the choice of T has a concave effect on the detection time.The solid lines in Figure 2 presents Monte Carlo estimates of the average detection time, as well as its 95% confidence band, with two different choices of σ.The variance of the log-normal fluctuations is a key parameter for detection as it is inversely proportional to the expectation of the detection time τ , and thus directly affects the firm horizon.These estimates are obtained via varying T on a grid between 20 and 100, and for each point running 200 simulations of the optimally controlled X with relative extraction q * , as given by ( 13) evaluated with its respective T -dependent time horizon and boundary conditions.The regime shift occurs at θ = T /2 for each value of T on the grid, which is equivalent to assuming uniform priors on θ.One can see that whilst τ is increasing in T , its sensitivity is limited and drops drastically for large T for all levels of σ.This result is robust to varying parametric choices.
Since the time θ at which the regime changes is unknown, the firm will therefore use the expected detection time (10) and the expected false alarm as a "maximal delay" estimate, in order to evaluate the boundary conditions and simultaneously undertake the detection procedure.If the threshold ν is reached before the expected detection time τ i+1 , then the firm switches to the subsequent period with the modified drift since the regime shift has been detected.It is also possible to introduce the stopping time itself as the final time, τ i+1 = τ (λ(q i ), ν), thus directly joining real-time detection and firm optimization.This choice would leave the properties of the model unchanged, as it can be shown with standard arguments that the value function W of the real-time problem can be rewritten as an infinite-time version of the value function V of the problem (12) with a stochastic discount factor v: in the augmented state space (x, v) ∈ R 2 , where v is the solution of The problem is more involved but the form of the extraction policy remains unchanged and at each detection time τ (λ i , ν) the firm will switch to the next period.As our specification is equivalent to uniform priors on the unobservable change point θ and this distribution is unaffected by within-period firm choices, the problem only involves the well-known distributional properties of running minima.
We leave a more comprehensive exploration of this aspect, especially for when the occurrence of θ or the firms' priors are influenced by the actions of economic agents, for future research.

Response to regime shifts
We can now study the effects of detection of a regime shift on the monopolist's extraction decisions.
We choose to focus principally on the two-period, one shift case shown in Proposition 1 since this scenario is a good fit for our empirical application, and all that follows holds when there are multiple subsequent regime shifts.
One can show with a simple geometric argument that the solution of (15) increases in µ, i.e.
∂ϕ s µ+λ /∂µ > 0. This implies that a negative (positive) regime shift unequivocally increases (decreases) the post-detection stationary extraction rate B s µ+λ .In order to show this mechanism more explicitly, we assume the scenario of no extraction costs c = 0 which yields Since γ > 1, this quantity clearly increases in λ10 , implying that if λ < 0 then ϕ s µ+λ decreases.This mechanism is illustrated in Figure 3, where B s µ is the counterfactual stationary rate if the detection procedure was not put in place and/or if the firm was unaware of the regime shift.The environmental parameters dictating the dynamics of the resource are µ = 0.025 and σ = 0.25.Figure 3a

Extensions
As mentioned in Section 2.2, our framework is general and allows for the modeling of different decision makers.As a first extension, we now discuss the case of a government that wants to maximize an isoelastic/CRRA social welfare function.This is a convenient choice, as the problem is similar to the monopolist's problem when b = 1, c = 0, but allows us to show how precautionary extraction policies can emerge when societal risk aversion is high.This scenario allows us to study how a government would respond to the prospect of a regime shift detection.The government maximizes expected   discounted welfare, i.e. uses as criterion the following: for all admissible policies q t := q(X t , t) ∈ Q. Costs can be easily introduced as well, similarly as in the monopolist's problem, but we prefer to discuss this instance as it allows for a fully explicit solution.
Following the same steps as shown in Appendix A.2, one can show that the government's optimal extraction policy is given by where and ϕ g is given by which is the post-regime shift stationary extraction rate.What can now be studied is the case of 0 < γ < 1, which was not allowed in the monopolist's case, since such values cannot identify feasible demand functions.In this scenario of no extraction costs, the parameter γ identifies the elasticity of intertemporal substitution, as well as the inverse of constant relative risk aversion.It can be easily seen that in this framework precautionary extraction policies emerge as a response to an adverse regime shift, when societal risk aversion is high.Furthermore, since the elasticity of intertemporal substitution is low, the government has a strong preference for smooth extraction paths, and therefore any anticipated reduced growth rate yields a lower extraction path both pre-and post-detection.this mechanism by simulating jointly optimization and quickest detection, and presents an instance of how our framework can be implemented in practice.Before the unobservable regime shift occurrence at t = θ, the government observes the detection process defined in Eq.( 7), searching for the stopping time τ (λ) as given by ( 6).Within the time interval [θ, τ (λ)] the government still applies the "wrong" extraction policy B µ (t)X t .Once the process u t − inf u t (the orange trajectory) has reached the threshold ν, the new regime shift is detected and upon detection at τ (λ) switches to B µ+λ (t)X t .The lighter-colored trajectory illustrates the counterfactual dynamics of the resource stock in absence of the detection procedure where an inappropriately high extraction rate ends up yielding a substantially lower resource stock level.As another benchmark, let us discuss the case of a perfectly competitive extraction path and compare it to the monopolist's optimal policy.We assume every agent has the same information set Θ in the formation of τ , so that all agents "compete" perfectly on detection as well.The criterion used by in the competitive case is given by: J(X t , q t ) = qt p(r)dr − c(X t )q t for all admissible policies q t ∈ Q.Following again the same steps as before, we have that the competitive solution is where ϕ c (t) solves the ODE What can be immediately seen is that since γ > 1, the competitive extraction facing adverse regime shifts always exceeds the monopolist's.Figure 8 shows how for an adverse regime shift the competitive extraction path dominates the monopolistic one, even for a scenario in which the two counterfactual extraction rates in absence of detection (or, equivalently, in absence of regime shifts) are essentially identical.
Lastly, in Appendix A.4 we present an extension of our framework in which we discuss the monopolist's problem under linear demand and resource dynamics driven by a Brownian motion with constant diffusion parameter and a periodic drift to represent seasonality.Whilst there is no analytical solution to this problem, we solve numerically the HJB partial differential equation associated to this problem and recover its gradient.We find that the scenario presented, similar to the one we study in our empirical application, yields both precautionary and aggressive extraction policies as responses to adverse regime shifts.In particular, in this scenario precautionary extraction strategies (with respect to the no-detection counterfactual) can emerge when resource stock levels are low.This result sheds light on how the response of a monopoly to regime shifts can depend crucially on the form of the demand function.
3 Empirical application: catastrophic regime shift in the Cantareira

water reservoir
The main piece of evidence motivating our paper is that ecological regime shifts are indeed often observed in the dynamics of renewable resources.A scenario in particular that captures well the essence of our framework is the case of one of the world's largest water reservoirs, the Cantareira system.The Cantareira reservoir is an ensemble of six reservoirs connected by channels and pipelines serving the Metropolitan Area of São Paulo (MASP) in Brazil, which is one of the largest metropolitan areas in the world.The Cantareira system is managed by Companhia de Saneamento Básico do Estado de São Paulo (SABESP), a water and waste management company acting as a semi-public natural monopoly.
In early 2013, the volume experienced a sharp decrease and the operational capacity of the reservoir was subsequently depleted.This depletion occurred despite the preceding rainy season being one of the heaviest recorded in recent times.At one point, the city's main Cantareira reservoir was down to 5%, which barely covered a month's supply of the population's requirements.SABESP realized the critical state of the reservoir only in January 2014 and began to reduce withdrawals, but by July 2014 the operational capacity of the reservoir was depleted.Since then water withdrawal has been done by pumping of the so-called "strategic reserve" or "dead volume", as well as starting to drill underground to extract groundwater.Dead volume pumping involves extracting the water that remains at the bottom of the reservoir, an often-criticized practice as it is considered dangerous due to the increasingly stagnant nature of the water as well as the presence of harmful elements.This shortage led to an unprecedented crisis of water supply faced by MASP in 2014, which left the 20 million inhabitants of the area at risk of catastrophic drought whose long-terms impact are still felt to this day (Sousa et al. (2022)).Coutinho et al. (2015) study the close-to-depletion reservoir dynamics via a tipping-point transition approach.The reasons behind this catastrophic outcome have clear roots in environmental changes.
The expansion of deforestation activities into the Amazon basin has increased pollution, severely reduced the upstream water sources and reduced rainfall.Some of the causes, however, can also be found in the economic decisions behind the crisis such as SABESP's poor water management with fragile pipes and ageing infrastructures.Furthermore, during the water crisis of 2014, SABESP failed to warn their citizens about the rationing of water resources, and awarded major bonuses to its directors despite the gravity of the situation. 11 This scenario is therefore an ideal test for our framework.The first question is whether a regime shift consistent with (3) actually happened.The second question is whether the regime shift could have detected by applying our framework before early 2014, which is when SABESP started reacting to the rapidly depleting reservoir.If this is the case, the last question we want to ask ourselves is whether the reservoir depletion could have been avoided, or at least delayed, if SABESP would have reacted to the regime shift by adjusting its outflow policy at the detection time.We leave open the interpretation of what was the criterion used by SABESP in order for it to determine its optimal outflow policy.
Given the evidence we find of the necessity of a precautionary policy, as well as for consistency with our theoretical framework, we deem this decision maker to be compatible with the incentives of either a private monopoly facing the linear demand and costs typically associated with water pricing (Tsur, 2020;Chakravorty et al., 2022), or a public/regulated monopoly maximizing social welfare (Seim and Waldfogel, 2013).
Figure 9 illustrates the reservoir dynamics.Observe that despite the inter-annual trend, a clear seasonal fluctuation is present in the rainfall (darker grey shaded region) which is reflected in the volume of stored water or the percentage of operational volume, as shown by the black line.In early 2010 and 2011 outflow (the blue line, equivalent to q t in our framework) had to be suddenly increased as a consequence of high river inflow, in order to allow the reservoir volume to stay within its maximum 11 https://theconversation.com/sao-paulo-water-crisis-shows-the-failure-of-public-private-partnerships-39483 an increase in the reservoir volume, which stabilized at a level well below the necessary operational capacity and remained persistent.This new reservoir level generated enough scarcity to plunge the region into the aforementioned water crisis.For inflow we use daily data from the rivers Jaguari, Cachoeira, Atibainha and Piva, as well as the upstream Àguas Claras reservoir, obtained from the public bulletins on SABESP's website.SABESP's "extraction" q * t is the outflow from the reservoir allowed daily, which equals to river outflow plus the amount of water pumped to be sold for regional consumption.Rainfall is obtained as the daily precipitation levels (mm).We input inflow, rainfall and extraction and estimate the following model: where dt is assumed as one day to match the daily data and θ is assumed to happen at the beginning of March 2013, when the reservoir volume deviated significantly from the pre-existing trends.Varying this change point in an interval of ± 2 months yields equivalent estimates.There is no evidence of the variance of the fluctuations being dependent on X, and the drift is clearly time-dependent due to seasonalities, and therefore we estimate the model ( 23) with a time-dependent drift.We then estimate β, γ, λ and σ by means of joint particle filtering for both state and parameters.All details on the simulation, filtering procedure and parameter estimation is reported in Appendix A.5.  1: Parameter estimates and their standard errors for the pre-and post-shift models for the reservoir dynamics (23) using the observed river inflow, rainfall and outflow (chosen by the firm) as given inputs.There is no evidence of β and γ changing before and after the detection time whilst there is a strong evidence of a subsequent negative regime shift λ that dominates the pre-existing drift.σXdW t as noise source) yields a p-value of 2.2 × 10 −2 , which validates specification (23).
Estimation of both pre-and post-shift models show that the rainfall coefficients as well as the variance of fluctuations do not change significantly between the pre-and post-shift periods: rainfall parameters are essentially unaffected, and σ is the parameter that varies the most (from ca. 2 × 10 6 cubic meters to 1.7 × 10 6 ), and even though the difference is not statistically significant this change shows how the dynamics of the reservoir after the regime shift become increasingly driven by the deterministic part.This is shown in Figure 10   the first time at which both river inflow and rainfall deviated significantly (i.e. more than twice the long-term standard deviation) from both their long-term trends for more than two weeks.12The firm's detection problem involves observing the running minimum/cumulative sum process over the reservoir volume X t under the appropriate change of measure, and detecting the presence of a regime shift once this process hits the threshold ν.Note that the change of measure is effectively the way to account for all observable effects of inflow and rainfall on reservoir volume, and estimate whether a new force (λ) has emerged that transformed the "residual" fluctuations in a supermartingale.
This threshold, however, depends on the firm's tolerance/distance to the first false alarm T .In order to account for this, we undertake the detection process for the substantially different values of T = [30, 100, 500, 5000, 10000], which imply "tolerances" (first times to false alarm) ranging between 30 days and 27 years, representing most values SABESP could reasonably assume.Given our Monte Carlo simulations shown in Figure 2, we expect a concave effect of T on the detection time τ : this is indeed the case.Table 2 presents the different thresholds for the detection process with varying T , and the corresponding detection dates and times it would have taken for SABESP to detect the shift.
The detection dates range between June 6 th and 29 th in 2013, more than six months before the point at which SABESP started adjusting its outflow policy.
We can now address the question of whether the reservoir depletion could have been avoided, or at least delayed, if SABESP would have reacted to the regime shift by adjusting its outflow policy at the detection time.For the Cantareira reservoir, SABESP started decreasing outflow in mid-January 2014, then decreased the usable capacity limit by 18.5% on June 15 th and by 10.7% on October 23 rd .
We therefore apply the equivalent outflow strategy at the average detection time (June 22 nd , 2013), and obtain Monte Carlo trajectories of the model simulating 5000 trajectories keeping every other input and parameter unchanged with confidence bands obtained as before.Figure 11 shows how the simulated volume (dashed red line) remains above 25% of the maximum reservoir capacity even at times when SABESP started pumping from its strategic reserves.
It is certainly too ambitious a claim to say that the adoption of our detection framework could have avoided the water crisis.There is, however, clear evidence of how the reservoir depletion should have at least been delayed, as the regime shift that happened in 2013 could have been detected by SABESP and its outflow strategy could have been adjusted earlier.Furthermore, pumping from the dead volume could have been avoided, improving the quality of the water supplied to the population as well as saving substantial amounts of public funding poured in the company in order to tap the deepest levels of the reservoir.In a situation where every day involved rationing water for millions of people, to the point that some citizens took to drilling through their basements to reach groundwater, the adoption of our framework can help decision-makers to better understand and manage the ecosystem in which they operate.

Concluding Remarks
In this paper we study the stochastic dynamics of a renewable resource subject to ecological regime shifts.The occurrence of such shifts can substantially alter the constraints faced by economic agents who extract natural resources.We establish a framework of ecosystem surveillance that minimizes the efficiency loss caused by incomplete observability of the environmental conditions in which agents operate, and show Pareto optimality of our framework for any resource-extracting economic agent.We integrate the detection procedure in the maximization problem of a resource-extracting monopolist facing isoelastic demand, such that the firm optimizes with respect to the resource dynamics over a time horizon determined by the detection time, and extend the framework to subsequent regime shifts under both full and partial information.We study the monopolist's response to regime shift detection, and show how the optimal policy is shaped by both the magnitude of the shift and how quickly the new regime is detected.We extend our framework to a government maximizing social welfare, perfect competition, and a monopolist facing linear demand and a periodic drift in the resource dynamics.
Finally, we study the case of the Cantareira water reservoir, a large-scale system of interconnected reservoirs which serves the Metropolitan Area of of São Paulo in Brazil, and show how applying our framework could have helped mitigate the water crisis that emerged as a consequence of a catastrophic regime shift.
Our framework is of constantly increasing real-world relevance.Several natural resource firms and government organisations are adopting automated systems for high frequency monitoring of resource dynamics thus providing the potential to enhance data-driven decision making by offering larger volumes of data in near real time.However, it is important to highlight that environmental surveillance also comes with its own set of limitations and can introduce new technical, financial, and labour dynamic constraint.Define the bounded set J * (q, τ ) as the supremum of the maximization problem (i.e. the total volume of maximized criterion units: profits, welfare or utils) achieved with policy q µ over a finite period [0, τ ], which is a nonempty set of real numbers bounded above and below.However, the overall "real" supremum of the maximization problem, which corresponds to an observable θ at which the agent switches policy, is achieved by using the additive property of the supremum over bounded nonempty sets: e −ρt J(q)P (t, dX λ )dt = J * (q µ , θ) + e −ρθ J * (q λ , τ − θ) where J * (q µ , θ) is the supremum set of the problem (i.e. the maximized profits) up to θ under the constraint with drift µ − q generated by the optimal policy q µ , J * (q λ , τ − θ) is the supremum set of the problem between θ and τ generated by the policy q λ under the constraint with drift µ t + λ t − q λ and P (t, x) is the transition density of a diffusion x.Using the dominated convergence and Fubini theorems, both suprema terms are bounded and positive for all t ∈ [0, τ ].However, between θ and τ any admissible policy q ∈ Q, q ̸ = q λ will not achieve the supremum, and J(q, τ − θ) < J * (q λ , τ − θ).
Since this is valid for any q, it follows that J(q µ , τ − θ) − J * (q λ , τ − θ) < 0 for any τ ≥ θ.We can then write where L(X t , t) is a continuous function of X t and t due to the feedback form of the Markovian policies q λ := q λ (X t , t) and q µ := q µ (X t , t).The detection delay (τ − θ) thus induces a loss L t := L(X t , t) for the agent, expressed in the same units as J, which is increasing in the length of the delay itself.One can repeat the same proof as before for τ < θ using q µ as optimal and the proof is complete.
We further note that the instantaneous loss function L t is a function of both stock X t and time t.Omitting arguments for clarity, its behavior in the interval t ∈ [0, τ ] is defined by the stochastic differential equation under the filtration F t , obtained using standard Itô calculus and the optimality condition in the respective Hamilton-Jacobi-Bellman equations associated to the value function V of the respective optimization problems, which read q i = J −1 q (V i x ), where i = {µ, λ}, the subscripts in the drift and diffusion coefficients indicate partial derivatives, and the operator A λ is the "true" infinitesimal generator of the controlled resource stock given by All the extraction policy terms q have the λ exponent in order to represent whether the policy is evaluated at the post-shift drift µ t + λ t or not.Lastly, the terms V λ , V µ are the solutions of the Hamilton-Jacobi-Bellman partial differential equation for the post-shift and pre-shift problems, respectively.The terms V λ x , V µ x , therefore, indicate the resource rents evaluated at the respective optimal extraction policies q λ , q.The SDE starts at L(X θ , θ) > 0 since (24) applies for all times.By optimality of q λ , V λ is a martingale while V µ is a supermartingale.From (25) one can see that the diffusion term is proportional to J(q i ), which is 0 when X t = 0, and is always positive.It then follows that L(X t , t) > 0 in t ∈ [θ, τ ] almost surely.Equation ( 25) has an intuitive interpretation: the deterministic part of the instantaneous loss evolves according to two differential terms.The first is the difference between the instantaneous expected change in extraction A λ q λ = E[dq λ ] of the "theoretical" extraction policy q λ with the suboptimal policy q generated by the detection delay τ , expressed in units of resource rent V i x .Intuitively, this represents why the extraction policy the agent applies in the interval [θ, τ ] is wrong: the chosen policy q is optimal for a resource stock that grows deterministically as µ t , and is applied to a resource stock that however grows at the post-shift rate µ t + λ t .

A.2 Quickest detection of a regime shift
In the period before θ, the dynamics of the resource X t are determined by the SDE dX t = µ t − q t dt + σ t dW t . (26) under the triple (R + , F, P ).Define now the trasformation, sometimes called the Lamperti transform, given by Under the standard conditions of existence of a solution for (26), g(.) maps one-to-one with the state space of X for all t and primitives of σ and thus this integral exists.One can then transform the original stock process in one with an unit diffusion.First, a straightforward application of Itô's lemma to g x (t, x) = 1/σ(t, x) yields Now notice that g xx (t, x) = −σ xx (t, x)/σ(t, x) 2 and that X t = g −1 (t, Xt ).We can then rewrite the previous expression as Now, Girsanov theory tells us that the process is a P -martingale.Therefore, the process is a Q-Brownian motion, where one obtains the new probability measure by Q = E P (M t ).The process Xt therefore admits the representation and is therefore a Brownian motion under the measure Q.Using the same procedure as before to the post-shift resource process, the firm's detection problem now becomes This problem was solved by Moustakides (2004), shows that the stopping rule that solves the optimization problem (4) for a general F-adapted process as regime shift, with a modified divergencetype/entropic criterion to account for a general process λt is given precisely by Eq.( 6) For the case of the drifted Brownian motion, notice that the Lamperti transform is simply given by 1/σ and the regime shift is given by λ/σ.Due to the prior information Θ, the agent knows the magnitude of λ and the detection problem reverts exactly to the Brownian disorder problem studied by Shiryaev (1963 and1996) and in the case of multiple drifts by Hadjiliadis and Moustakides (2006).
The Brownian disorder is the detection of the change between a martingale and a sub/supermartingale, depending on the sign of λ.We apply these results directly, and refer to these papers for all details regarding the derivation of the formulas.

A.3 Proof of Proposition 1, 2 and 3
Let us prove Proposition 1 first, where the instantaneous drift is given by µ and the firm optimizes in t ∈ [0, τ ] where τ = E θ=∞ [τ ] + E[τ (λ 0 , ν)].At time t = 0 the firm believes that the resource is driven by a diffusion process with the natural growth rate µ.At a random and unobservable time θ, there is an initial exogenous change, λ, in the resource dynamics.
Within this time interval [0, τ ], the value of the firm is given by e −ρs Π(X t , q)ds s.t.dX t = (µX t − q)dt + σX t dW t , where the control set is given by Q = {q : R + → R + , q ≥ 0, bounded and F t -adapted}.What we want to achieve is to show that the value function V for ( 27) across different periods with changing drifts is a weak solution of the optimization problem ( 12).In all that follows we will use as a reference Fleming and Soner (2006).We first write the Hamilton-Jacobi-Bellman equation for this problem in terms of Following the fundamental work by Crandall and Lions (1981) Let v ∈ C 2 ([0, τ ] × R), let V − v be maximized at the point ( t, x) ∈ ([0, τ ] × R) and let us fix an optimal control (extraction rate) q ∈ Q.Let X(.) = X(.; t, q) be the controlled stochastic process that drives the resource stock.For every time τ > t for which X τ > 0, we have, using Itô's lemma and Bellman's principle of optimality, This implies 0 ≤ v t ( t, x) + Π(x, q) + v x (µx − q) + σ 2 2 x 2 v xx for all q ∈ Q: we can then write 0 ≤ v t ( t, x) + sup q∈Q Π(x, q) + v x (µx − q) + σ 2 2 x 2 v xx 0 ≤ v t − H( t, x, Dv( t, x), D 2 v( t, x)).
Proceeding equivalently as before, one shows that V is a viscosity supersolution of ( 27).We can conclude that V is a viscosity solution of ( 27).Note that for every time τ e ∈ [0, τ ] for which X τ > 0, since for optimality we have Π q (., q * ) − V x = 0 and Π is continuous and twice differentiable in q, it can be easily shown that the inequalities of the definition of sub-and supersolution are satisfied with which implies the optimal extraction policy is given by q * s.t.p(q) + p ′ (q)q = V x + c q (q, x).
In order to obtain an analytically tractable solution, we choose an isoelastic demand function q(p) = bp −γ and marginal extraction c(X t ) = cX −1/γ , where b, c ∈ R + and γ > 1.The optimal policy thus reads Guessing a separable form for the value function such that V (x, t) = ϕ(t)x (γ−1)/γ , it can be shown after lengthy but straightforward computations that choosing ϕ as the solution to the nonlinear ordinary differential equation since it be shown straightforwardly that the is the solution of (A.3) when V t = 0 is V µ+λ (x) = ϕ s µ+λ x (γ−1)/γ .The optimal extraction policy in feedback form is then given by q * (X t , t) = b γ γ − 1 c + ϕ(t) −γ X t = B(t)X t .
The natural boundary condition q(0, t) = 0 is immediately seen to be satisfied.We have therefore proven the form of the solution in Proposition 1.
The last step we need is a verification theorem for the time-dependent section of the policy, obtained by "stopping" the HJB at an arbitrary time τ < τ .Define v(t, x) our candidate function that solves the HJB equation.Using Itô's lemma on the discounted value function we obtain e −ρτ v(τ , X τ ) = v(0, X 0 ) + where A is the HJB generator.Taking expectations and adding the objective e −ρt Π(X t , q t ): v(0, X 0 ) = E τ 0 e −ρs Π(X s , q s )ds + e −ρτ Ev(τ , X τ ) − −E τ 0 e −ρs [A[v](s, X s ) + Π(X s , q s )] ds.
Proposition 2 is proven using similar arguments for a general period [τ i , τ i+1 ], focusing on changes of drift from µ + i j=0 λ j to µ + i+1 j=0 λ j .Given that the objective is only calculated two periods at a time, since λ i+2 is not (yet) known, the boundary condition ϕ(τ i+1 ) needs to match the value function with the one of the subsequent period assuming no further changes in drift, i.e. matching with the problem's stationary solution with a drift µ + i+1 j=0 .Using the same procedure as before and defining V i := V µ+ i j=0 λ j , the viscosity solution for the problem ( 17) is thus given by and the value function across all periods can be characterized as an envelope solution of a super-and a subsolution of (17), using Theorem 2.14 in Bardi et al. (1997).Updating notation to represent each period so that each policy B i (t) is identified by ϕ i (t), we obtain the expressions in Proposition 2.
Proposition 3 is proven similarly as Proposition 1 for each change point, and the backward-inducted boundary conditions are obtained straightforwardly by focusing first on τ N .After this point in time, the firm assumes a stationary problem that follows the resource dynamics associated to the drift µ + N j=0 λ j , and thus its problem has as value function V (X t ) = ϕ N +1 X t , and it's identical to the problem of Proposition 1, as the last boundary condition therefore identifies the time-varying policy for the time interval [τ N −1 , τ N ], and is given by ϕ N (τ N ) = ϕ N +1 .Once this policy function is identified, the boundary condition for the previous period [τ N −2 , τ N −1 ] can be written as ϕ N −1 (τ N −1 ) = ϕ N (τ N −1 ).
Proceeding iteratively, the Proposition follows.on this guess in order to reduce the dimensions of the parameter space, with a wide enough interval (between 10 4 and 10 6 for β, between 0.5 and 1 for γ since simulations show that γ > 1 always generates an explosive behavior, between 10 6 and −10 6 for λ and between 10 4 and 10 7 for σ).The main results are then obtained by using log-normal priors for β, γ, σ each with mean and variance the (log) mean and variance of the previous run's posteriors, and equivalently Gaussian priors for λ as we do not want to restrict it to be either positive or negative.Reconstructed posterior densities are shown in Figure 14.The results of pre-and post-regime shift estimations are reported in the main body of the paper.An immediate set of checks for quality of the estimation is examining effective number of particles used and conditional log-likelihood at every step: Figure 13 shows how particle decay and likelihood only drop where the filter cannot track the data as well as in the other times (around late 2010 -early 2011), whilst still remaining solidly within an acceptable confidence zone.Lastly, we note that other techniques could equivalently be used, in particular approximate likelihood methods such as simulated maximum likelihood, but in particular for the pre-shift model given the long time series for the Cantareira reservoir that we use for our analysis (daily observations, 2007 to 2013) we prefer the particle filter approach as it's much lighter computationally.

Figure 1 :
Figure 1: Illustration of the loss stemming from the detection delay τ − θ (in red).

Figure 2 :
Figure 2: Sensitivity of the detection process to changing the mean false alarm constraint T := T (Θ).The red and black solid lines show the Monte Carlo mean detection time obtained by letting T vary on a unit grid between 20 and 100, for each simulating 200 optimally controlled trajectories for the resource stock and undertaking the detection procedure, for two different values of σ.The curve for the average stopping time estimates and their 95% confidence bands are interpolated.The regime shift is assumed to occur at θ = T /2 for each value of T .Parameter values: µ = 0.1, λ = −0.09,σ = 0.05, b = 0.5, γ = 1.5, c = 0.5.
depicts a negative regime shift of λ = −0.035which is detected at τ = 100.Observe how the expectation of a negative regime shift leads the monopolist to gradually increase its extraction of the resource up until the new post detection stationary extraction rate B sµ+λ .The intuition behind this is straightforward, as the expectation of a decline in the resource's growth rate leads the firm to intensify its its extraction as the in situ value of the resource declines.Figure3bdepicts a positive regime shift of the same magnitude λ = +0.035which results in the monopolist slowing down its extraction as the resource rent increases.

Figure 4
Figure 4 highlights the role of the magnitude and detection of the regime shift on extraction policies.Each curve represents an adverse shift of varying magnitudes and relative detection times.Consistent with section 2.1, we note that the larger is the magnitude of the shift and the quicker is the detection.Comparing the solid extraction path (which depicts the smallest magnitude of change λ = −0.04) to the other two paths, one can observe that not only do larger shifts lead to a higher post-detection stationary extraction rate, but also the curvature of the pre-detection extraction path varies across the three cases.A longer detection period of τ = 60 sees a gradual increase from B s µ to the new stationary extraction rate since the firm has a longer time horizon to adjust.However, for shorter detection times there is an immediate jump from B s µ and a steeper extraction path to reach B s µ+λ , further highlighting how detection can influence firm extraction behaviour.Figure 5 illustrates the extraction path of a monopolist facing multiple regime shifts under full information, both negative and positive.

Figure 4 :Figure 5 :
Figure 4: Extraction policies for negative regime shifts of varying magnitudes and detection times: λ =

Figure 6
illustrates such an occurrence, where two adverse regime shifts of different magnitude are detected at different times within the same scenario (which implies the same counterfactual "no detection" extraction rate B s µ ).The figure shows how larger adverse regime shifts |λ 1 | > |λ 2 |, λ i < 0, which in turn imply quicker detection times τ 1 < τ 2 , yield substantially more precautionary extraction policies, which jump immediately at t = 0 to a lower extraction level.Figure 7 further illustrates (a) λ1 = −0.20,τ1 = 30 (b) λ2 = −0.075,τ2 = 60

Figure 7 :
Figure 7: Simulation of an adverse regime shift detection for a government and subsequent precautionary extraction adjustment at τ (λ), with counterfactual over-extraction due to the detection delay.Numerical simulation done with a Shoji-Ozaki discretization for the time-dependent drift and a Milstein scheme for the diffusion term.The regime shift happens at θ = 26.6.Parameter values: T = 70, µ = 0.1, λ = −0.09,σ = 0.05, γ = 0.8.

Figure 10 :
figure shows how the model estimated in (23), shown by the dashed red line, tracks well the data (solid black line) whilst remaining firmly within a 95% confidence band obtained by sampling 1000 coefficient sets from their reconstructed distributions, and running 1000 simulations for each set.The slight decay in fit in early 2011 for the pre-shift model, seen in the top panel of Figure 10, leaves open the possibility of the presence of multiple regime shifts.The bottom panel of Figure 10 shows how the post-regime model in (23) fits very well the data, as well as how the regime shift manifests by the emergence of a dominant deterministic force that drives the reservoir volume to the point where the operational capacity is exhausted.

Figure 11 :
Figure11: Counterfactual reservoir volume with outflow adjustment due to detection.We obtain Monte Carlo estimates (N = 5000) of the likely trajectory of reservoir volume using the estimated post-shift coefficients and adjusted its post-2014 policy at the detection time (June 6 th , 2013, assuming T = 100), with 95% confidence bands obtained as in Figure10.

v
xx (X s )dW s

Figure 12 :Figure 13 :
Figure 12: Numerical illustration of the optimal policy associated with (35), showing both aggressive and precautionary policies associated with an adverse regime shift λ = −3 (orange surface) and in absence of detection (blue surface).

Figure 14 :
Figure 14: Filtered posterior densities for the model parameters.

Table
Table 2 reports the coefficient estimates and their standard errors of each filtered parameter distribution.Additionally, a likelihood ratio test between the model (23) and a specification with geometric fluctuations (i.e. with

Table 2 :
Regime shift detection times with increasing firm tolerances T , if the detection process had been activated on t 0 = January 28 th , 2013.
OutflowOutflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow OutflowOutflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Outflow Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume Volume H( t, x, Dv( t, x), D 2 v( t, x)) ≥ 0.for every point ( t, x) ∈ D which is a local minimum of V − v.The function V (t, x) is a viscosity solution of the equation (29) if it is both a viscosity subsolution and a viscosity supersolution.This implies that the function V (t, x) is a weak solution of the optimization problem (27).Let us now show that V is a viscosity solution of our problem (27).