Optimal switching between cash-flow streams

We consider the problem of finding the optimal time to switch between two measurable cash-flow streams. A complete characterization of the set of solutions is obtained in terms of adjoint variables which measure the available gain from deviations. An iterative procedure for the computation of the adjoint variables is provided. The results are generalized to multiple switching times, multiple cash-flow streams, switching costs, as well as switch-triggered cash-flow streams that arise in equipment-replacement problems.


Introduction
Conceptually, the question of optimally switching between several (deterministic) cash-flow streams-considered in this paper-can be viewed as a scheduling problem for substitutable machines (processors) with time-varying yield that can be allocated to B Thomas A. Weber thomas.weber@epfl.ch 1 Chair of Operations, Economics and Strategy, École Polytechnique Fédérale de Lausanne, Station 5, 1015 Lausanne, Switzerland the task of creating time-discounted value in a single job. We characterize the solutions to the simple switching problem and generalize the approach to include switching costs, switch-triggered obligations, as well as any finite number of allowable switches and available cash-flow streams.

Literature
From a scheduling viewpoint, the cash-flow switching problem fits within the deterministic production-planning and scheduling framework laid out by Salveson (1952). Subsequent contributions to the theory of scheduling, beginning with Johnson (1954), focus on minimizing the time needed to complete heterogeneous jobs on a discrete number of machines. Because of their combinatorial nature these types of problems are often NP-hard and require an algorithmic approach (Veinott and Wagner 1962;Gawienjnowicz 2008). For the cash-flow switching problem with a single switching time, we pursue a semi-analytical approach. For multiple switching times, the simple solution can be used repeatedly, effectively amounting to a solution via dynamic programming (Bellman 1957).
In a stochastic setting, when the yield of the processors is random (but usually stationary), the cash-flow switching problem is also known as the multi-armed bandit problem (Gittins et al. 2011). 1 For uncorrelated processors, the optimal switching policy is obtained by comparing processor-specific "Gittins indices," corresponding to an expected retirement reward for a given machine, and then always choosing the machine with the highest available reward (Gittins and Jones 1974). Our problem amounts to a "time-varying deterministic multi-armed bandit problem," thus focusing on pure exploitation without experimental exploration of the various processors. It is optimal to switch to another cash-flow stream as soon as the benefit of delaying the switch, as measured by an appropriate "adjoint variable," drops to zero. Switching costs, which in our problem tend to delay actions, have also been studied for the stochastic multi-armed bandit problem; see Jun (2004) for a survey.
Finally, our approach to the cash-flow switching problem is related to global optimization, as the optimal switching time needs to globally maximize a differentiable function on the interval of consideration. Early semi-heuristic methods included golden-section search (Kiefer 1953(Kiefer , 1957 among others; see, e.g., Wilde (1964) for a textbook survey. Derivative-free approaches based on a Lipschitz constant have been advanced by Shubert (1972), Breiman and Cutler (1993), Sergeyev (1995), and more recently by Lera and Sergeyev (2013). For an overview of random sampling methods see, e.g., Törn and Žilinskas (1989, Ch. 4). Another interesting approach, at least from a computational viewpoint, is the (approximate) global maximization of polynomials formulated in terms of semi-definite programming, pioneered by Nesterov (2000), Lasserre (2001), and Parrilo (2003); see also Li et al. (2012). To solve the cash-flow switching problem we use the semi-analytic approach recently proposed by Weber (2017) which requires the knowledge of a derivative that is naturally available in our problem as the difference between the two available cash-flow streams. The latter is assumed merely essentially bounded (as an element of L ∞ ) instead of the absolute integrability (as an element of L 1 ) stipulated originally. 2 Cash-flow switching in its various forms relates to many well-known problems in capital budgeting: equipment replacement (Alchian 1958) as well as the evaluation of project returns, for example. Regarding the latter Arrow and Levhari (1969), as well as Wright (1959), earlier, andFlemming andWright (1971), later, with more generality, considered the uniqueness of the internal rate of return subject to optimal stopping of a cash-flow stream, thus assuming a "free disposal of investment projects" (Arrow 1985, p. 373). In other words, given a solution to (a special case of) the cash-flow switching problem (switching to a zero cash-flow stream), these authors show that the resulting maximized present value is nonincreasing in the constant interest rate, so that the internal rate of return should be unique. 3

Outline
The remainder of this paper is organized as follows. In Sect. 2, we introduce the basic cash-flow switching problem and formulate it as a global optimization problem, the solutions to which can be characterized by means of a suitable adjoint variable. Section 3 considers the effects of switching cost, while Sect. 4 allows for a generalization of the basic problem to multiple switches and multiple cash-flow streams, respectively. Section 5 concludes.

Simple switching 2.1 Preliminaries
Let T > 0 be a fixed time horizon. An investment project consists of a deterministic (measurable) cash-flow stream x(t), defined for all t ∈ [0, T ]. Given the (measurable) schedule r : [0, T ] → R, which for any t ∈ [0, T ] specifies an external rate r (t), representing a cost of capital or a hurdle rate, 4 let  Quah and Strulovici (2009). For an unrelated approach that yields a unique internal rate of return for any cash-flow stream (without the need of truncation), see Weber (2014). 4 Poterba and Summers (1995) note that, to evaluate their investment projects, firms often use hurdle rates which differ significantly from their actual costs of capital.
where β(t) exp[−R(t)] > 0 denotes the discount factor, i.e., the present value of a concentrated unit payment that is set to arrive at time t ∈ [0, T ].
Example 1 For a constant discount rate r (t) ≡r ∈ R, it is R(t) =rt for all t ∈ [0, T ], and the present value of the cash-flow stream x becomes PV( No assumption is made about the sign of the interest rate. Time-varying interest rates characterize the term structure of financial instruments (e.g., in the form of yield curves) and help describe macroeconomic performance (e.g., relative to the real interest rate); see, e.g., Gürkaynak and Wright (2012) for an overview. They also describe the (deterministic) dynamics of the capital cost for any given firm or individual decisionmaker, who are the subjects of our study.

Problem formulation
Consider the following basic switching problem: Given two cash-flow streams, x 1 ("project 1") and x 2 ("project 2"), both defined on the interval [0, T ], at what time τ * is it optimal to switch from project 1 to project 2? To formulate this question as an optimization problem, note first that when switching at time τ ∈ [0, T ], the decision-maker obtains the switched cash-flow stream 5 The original cash-flow streams obtain as special cases for τ ∈ {0, T }: x 0 = x 2 and x T = x 1 . The decision-maker's payoff from the switched cash-flow stream corresponds to its present value, The objective function V , which represents the present value of the switched cash-flow stream, is differentiable, with derivativė The term in square brackets serves to establish a homotopic mapping from x 2 to x 1 as τ varies from 0 to 1; see, e.g., Zangwill and Garcia (1984). It can be omitted without changing any of the following results, provided one of the two strict inequalities on the right-hand side is replaced by its weak equivalent. More generally, the value of all the cash-flow streams can be changed on a set of (Lebesgue-)measure zero without affecting any of the present values.
The decision-maker's cash-flow switching problem amounts to maximizing the objective function, By virtue of the Weierstrass theorem (see, e.g., Bertsekas 1995, p. 540) a solution τ * to (P) exists. Let P ⊆ [0, T ] denote the set of all solutions to the switching problem.
For an interior τ * ∈ (0, T ), Fermat's lemma implies thatV (τ * ) = 0, leading to the necessary optimality condition provided thatV is continuous in a neighborhood of τ * . We note that Eq. (4) need not be satisfied at any point of discontinuity of x 1 or x 2 . It also does not need to hold at the boundary of the interval [0, T ]. Moreover, the condition is at most necessary, i.e., there may be many points τ ∈ [0, T ] for which x 1 (τ ) = x 2 (τ ) but which do not solve (P), including local minima and maxima, as well as saddle points and points of discontinuity. The usual approach to obtain a better characterization of the optimum, namely to use a second-order necessary optimality condition, requires that the cashflow streams are differentiable. Even if satisfied and valid, such an additional condition leads neither to a truly necessary nor a sufficient optimality condition. Our approach is different in that we construct a necessary and sufficient optimality condition for any solution to (P), without any further regularity assumptions, thus arriving at a simple characterization and representation of the solution set P.
Remark 1 We note two important special cases of the switching problem. For x 2 = 0, one obtains the problem of optimally stopping project 1, and for x 1 = 0 the problem of optimally starting project 2.
Remark 2 In the basic version (P) of the switching problem, the implicit assumption is that both cash-flow streams are synchronized, in the sense that both start at t = 0. By switching at time τ , the decision-maker changes his exposure from one stream of obligations (characterized by the net cash inflow x 1 on [0, τ ]) to another stream of obligations (characterized by the net cash inflow x 2 on [τ, T ]). As shown in Sect. 3.3, the solution of this problem can be extended to the situation where the switch from one cash-flow stream triggers the start of another cash-flow stream, such as for equipmentreplacement decisions.
Remark 3 If the decision-maker's (indirect) utility u(x(t)) for a net cash inflow x(t) at time t is evaluated by a (measurable) utility function u : R → R, then it is enough to replace x(t) byx(t) u(x(t)), for all t ∈ [0, T ]. That is, any cash-flow stream can also be interpreted as a stream of utility, as experienced-for example-by a representative consumer in a model of (finite-horizon) economic growth.  describes an oscillation frequency of the default option before the switch (e.g., due to seasonalities). As in Example 1, let the discount rate be constant, so r (t) ≡r ∈ R. While in the very long run, i.e., for t → ∞, both cash-flow streams behave like a unit perpetuity, in the short run they may differ significantly. In terms of their present values, over a sufficiently long time horizon T , it is PV(x 2 ) > PV(x 1 ) if (and only if) b > a + ω 2 /(a +r ). 6 Figure 1 shows the cash-flow streams x 1 and x 2 for the parameter values (a, b, c) = (1, 2, 5) and ω = 2π . For the horizon T = 3 and the constant interest rater = 20%, Fig. 2 depicts the corresponding objective function V .

Adjoint variable
The solution of the switching problem (P) is achieved by means of an adjoint variable, the cumulative (right-sided) gain,  where the (right-sided) gain inflow f , Starting at an initial value of zero at s = 0, the adjoint variable would measure any nonnegative gain available by continuing from τ = T − s until the interval horizon T . By reversing the time-scale, the right-hand side of Eq. (5) becomes A solution y to this integral equation is necessarily differentiable and such that y(0) = 0, corresponding to the logic that the right-sided cash-flow gain must vanish at the right interval boundary. As a result, the right-sided adjoint variable y satisfies the following initial-value problem: The gain inflow f is a discontinuous function, and in particular does not satisfy the Carathéodory conditions (Filippov 1988, p. 3), so that the existence of a solution to Eq. (8) deserves special attention. The latter conditions allow for a measurable dependence on time, so that it is not the possible discontinuities of x 1 − x 2 , but rather the structural properties of the gain inflow itself which require care in the construction of a solution. 7 Before turning our attention to the question of existence and uniqueness, it is useful to establish a lower bound for an adjoint variable y, provided it exists.

Lemma 1 The (right-sided) adjoint variable y, as solution to the initial-value problem
The adjoint variable captures the value of the option to delay switching. It is therefore necessarily nonnegative and cannot be smaller than the value of waiting until the end of the interval horizon. Its interpretation as the cumulative right-sided gain is the key to finding the smallest solution to the switching problem (P), as detailed in Sect. 2.4 below.
As in the standard approach (see, e.g., Coddington and Levinson 1955), the idea of proving the existence of a solution y to Eq. (8) is to construct an approximating sequence (y k ) ∞ k=0 by means of a successive Picard-Lindelöf iteration. However, while usually the convergence of this sequence and the uniqueness of its limit are established jointly using the Banach fixed-point theorem, in our setting this strategy proves unsuccessful because of the lack of a suitable Lipschitz constant for the gain inflow. We consider any "admissible" solution of Eq. (8) in the Sobolev space W 1,∞ ([0, T ]) of differentiable functions with measurable and essentially bounded derivatives (in L ∞ ([0, T ])). For this sufficiently large class of functions, it is possible to construct a Cauchy sequence which converges in the · 1,∞ -norm, the latter being defined as for any y ∈ W 1,∞ ([0, T ]). To determine the solution set of Eq. (8) (as a subset of W 1,∞ ([0, T ])), our approach is to introduce an outcome-equivalent transformation of the gain inflow and use it to define a successive-approximation procedure that converges to the unique solution of the initial-value problem. For this, note that by Lemma 1 a solution y to Eq. (8), if it exists, is necessarily nonnegative-valued. Introducing the modified gain inflow, we obtain a measure that counts a net cash flowx (at a given time) if it is positive or if the cumulative gainŷ is positive. Specifically, provided the cumulative gain is nonnegative, the modified gain inflow equals the (regular) gain inflow, i.e., for any If we further introduce the time-reversed cash-flow difference ϕ(s) that is, it has the same set of solutions as Eq. (8). The space W 1,∞ ([0, T ]) is a Banach space, i.e., a complete normed vector space, which means that any Cauchy sequence with elements in the vector space converges (in the · 1,∞ -norm) to an element of the vector space. Based on the equivalent integral representation (7) of the initial-value problem (8), we introduce the operator P : mapping any admissible function y to a function Py, which (as can be verified) is also an element of W 1,∞ ([0, T ]). The solution set of the initial-value problem (8 ) is therefore the set of fixed points of P. The following result provides existence and uniqueness of a solution to the initial-value problems (8) and its equivalent representation (8 ).
Proposition 1 There exists a unique solution to the initial-value problem (8).
As shown in the proof of Proposition 1, a repeated application of the operator P to the initial seed φ, with 8 converges to the unique solution of Eq. (8). That is, when considering the sequence σ (y k ) ∞ k=0 , with the initial function y 0 = φ and the Picard-Lindelöf iteration y k+1 = Py k for k ≥ 0, then y k → y as k → ∞, and y solves Eq. (8). In practice, the convergence of the sequence σ to the adjoint variable y = lim k→∞ P k φ is usually very efficient and takes place within a few iterations, as illustrated by the following example.

Optimal switching
For any solution τ of the cash-flow switching problem (P), the right-sided adjoint variable y(s) in the inverted time scale s = T − τ must vanish, i.e., necessarily y(T − τ ) = 0. This guarantees that no improvement is possible on the interval [τ, T ] relative to the present value V (τ ) obtained by switching at time τ . Conversely, when viewed from the left, the smallest point τ * ∈ [0, T ] which satisfies y(T − τ * ) = 0 is the first for which all right-sided improvements vanish. It must therefore be globally optimal. The smallest solution of (P) is the earliest switching time τ * for which no improvement of the objective can be obtained. By a symmetric consideration, one can determine the largest solution τ * * of (P) by measuring left-sided gains on the interval [0, τ ]. For this, we introduce a (left-sided) (co-)adjoint variable z as solution to the initial-value problemż where the (left-sided) gain inflow g, for any (t,x,ẑ) ∈ [0, T ] × R × R, is defined as Because Eqs. (8) and (12) have the same structure, Proposition 1 also guarantees the existence and uniqueness of z. By symmetric considerations, we obtain the latest optimal switching time as the largest feasible point where no left-sided improvement is available.

Proposition 3 The largest solution of
As with Eq. (8 ) for Eq. (8), there exists an equivalent formulation for the initialvalue problem (12) for the computation of z, with the modified gain inflow as specified in Eq. (10). To determine the left-sided gain z, we use again a Picard-Lindelöf approximation sequence (z k ) ∞ k=0 , where z 0 φ and z k+1 =Pz k for k ≥ 0, with initial seed The operatorP : similar to the definition of the operator P in Eq. (11). With this, the left-sided adjoint variable z is attained by repeatedly applyingP toˆ : The convergence usually obtains in a finite number of iterations, e.g., when both cash-flow streams are Lipschitz-continuous.

Remark 4 Propositions 2 and 3 together characterize the uniqueness of a solution to the cash-flow switching problem (P). Indeed, the solution is unique if and only if
The solution set is then the upper contour set of V relative to its globally optimal value V * on The adjoint variables y and z describe the right-sided and left-sided gains available at any point in the interval [0, T ] of available switching times. By introducing the combined (or two-sided) adjoint variable one naturally obtains a necessary and sufficient condition for an optimal switching time.

Proposition 4 A pointt ∈ [0, T ] is a solution to (P) if and only if
Accordingly, the solution set is The fact that λ(τ ) can be interpreted as the total gain available on the domain [0, T ] relative to the point τ implies that the present value V (τ ) plus λ(τ ) must always be equal to the optimal value of (P); see Fig. 4.
Knowing the adjoint variable λ is therefore equivalent to knowing the objective function V and its largest value V * . Combining the last result with the initial conditions in Eqs. (8) and (12) yields an expression of the optimal value of (P) as a function of the adjoint variables evaluated at the interval horizon.
The preceding result means that a one-sided adjoint variable (either y or z) is enough to determine the optimal value of the switching problem (P): Each one-sided adjoint variable can also be considered a solution to a complete family of one-sided problems. For example, the right-sided gain y determines the optimal policy of whether to stop at τ or continue searching for a better stopping time on the interval [τ, T ] because for any τ ∈ [0, T ]. Similarly, the left-sided gain z fully describes the optimal policy of whether to stop at τ or earlier, since for any τ ∈ [0, T ]. As will become apparent in Sect. 4, the one-sided adjoint variables are intimately related to a dynamic-programming solution of the switching problem.
Remark 5 Let x 1 and x 2 be defined on the general interval [t,t], where t,t are real numbers such that t <t. Consider the cash-flow switching problem where . While (P ) may appear more general than the basic switching problem discussed thus far, it can be reduced to (P) by maximizing just as in (P). By a translation, any solution τ * of (P) directly corresponds to a solution τ * of (P ):τ * = τ * − t.

Comparative statics
We now examine how changes in the interest-rate schedule affect the solution to the switching problem. To this end, let us consider two different (measurable and real-valued) interest-rate schedules, r andr , defined on [0, T ]. Let τ * andτ * be the corresponding (smallest) solutions to the cash-flow switching problem (P). An ordinal relationship in the interest-rate schedules implies an (inverse) ordinal relationship in the optimal switching times.
This result confirms the intuition that a decrease in patience (i.e., a higher discount rate) at the margin tends to speed up cash-flow switching.

Switching cost
If there is a cost c of performing a switch, payable at the time of the switch, then the optimal solution depends on whether switching is mandatory or optional.

Mandatory switching
If a switch from x 1 to x 2 is required at some point on the time interval [0, T ], then the optimal cash-flow switching problem becomes A positive switching cost introduces a bias towards preserving the status quo, as delaying the transition increases the decision-maker's present value. A negative switching cost c amounts to a subsidy, encouraging the switch. For zero switching cost one obtains V 0 = V , i.e., the same payoff function as in the original problem discussed in Sect. 2. Moreover, by (fictitiously) including the benefit of the implicit rent from not switching in the default cash-flow stream x 1 for all times before the switching time, the problem (P c ) with nonzero switching cost can be reduced to the simple cash-flow switching problem (P). For this, we introduce (P x 1 −x 2 )y Py and (P x 1 −x 2 )z P z for any admissible y and z, just as in Eqs. (11) and (14), with the only difference that the extended notation indicates the difference of the available cash-flow streams.
Proposition 6 Let c ∈ R. A point τ * c ∈ [0, T ] is a solution to the switching problem (P c ) if and only if τ * c ∈ P c = {τ : λ c (τ ) = 0}, where λ c = β max{y c , z c } is the adjoint variable, and y c , z c are the unique solutions of y c = (P x 1 +cr −x 2 )y c and z c = (P x 1 +cr −x 2 )z c . The resulting optimal value is V To incorporate switching costs when switching is mandatory, it is therefore sufficient to consider the default cash-flow streamx 1 c x 1 + cr instead of x 1 . As noted earlier, a positive switching cost introduces inertia in the decision-maker's willingness to move fromx 1 c to the alternative cash-flow stream x 2 . Lemma 2 The (smallest) solution to (P c ) is nondecreasing in the switching cost c.
If switching becomes more expensive, then it is never optimal to switch earlier.

Optional switching
If switching is optional, then the decision-maker can opt to forgo the option of switching away from the default cash-flow stream. The optimal switching problem becomeŝ Because in the case where the decision-maker chooses τ ∈ [0, T ), his payoff is identical to the payoff in the problem (P c ) with mandatory switching cost, any extra payoff related to the additional flexibility in the relaxed problem (P c ) must come from saving the switching cost by holding out until the end of the horizon without switch.
Proposition 7 For c ∈ R, consider the optional switching problem (P c ). Let P c and V * c be as in Proposition 6. If V (T ) > V * c , then it is optimal to never switch. Otherwise, it is optimal to switch at a time τ * c ∈ P c . The resulting optimal value isV * c = max{V * c , V (T )}.
The solution to the problem (P c ) with flexibility reduces to the problem (P c ) without flexibility. As in Sect. 3.1, if the subsidies to switching increase (so c decreases), it is never optimal to increase the switching time (see Lemma 2).

Switch-triggered cash-flow streams
If a switch at time τ ∈ [0, T ] triggers a commitment that is associated with a cashflow stream x 0 (which can be of any duration), then the present value of this cash-flow stream is The switch-triggered cash-flow stream may well extend beyond the consideration interval [0, T ]. When triggered at time τ , only its (differentiable) time-0 value v(τ ) is important. 10 An example of practical interest is the equipment-replacement problem, where at the time of purchasing new equipment a new cash-flow stream starts, associated with the lifecycle of the replacement product. The corresponding cash-flow switching problem becomes As in the simpler problem (P c ) with constant switching cost, the strategy for solving (P v ) is to convert the present value into a cash-flow stream associated with the default option. By not exerting the option to switch at t the decision-maker earns the time-t rentv(t).

Proposition 8 Assume that switching at time τ triggers an obligation with present
The intuition of this result is that a positive switch-triggered present value would generally decrease when delayed, thus producing a negative gradient and therefore also a negative fictitious cash-flow stream to be added to the default cash-flow stream. Thus, delaying the switch amounts to an opportunity cost. Conversely, delaying a negative switch-triggered cash-flow stream produces a positive bias to stick with the default cash-flow stream.

Multi-switching
The results obtained so far can be generalized for settings where multiple switches are possible or multiple cash-flow streams are available. 11

Multiple switches
Let N ≥ 1 be the number of allowable switches between the cash-flow streams x 1 and x 2 on the time interval [0, T ], beginning with the default cash-flow stream x 1 . Let 10 If v(τ ) = −cβ(τ ) for τ ∈ [0, T ], then (P v ) reduces to (P c ) with the constant switching cost c. 11 A combination of both generalizations is beyond the scope of this paper and left for future research. be the decision-maker's value for a vector for switching times τ = (τ 1 , . . . , τ N ) ∈ T N with The "N -multi-switching problem" is the original cash-flow switching problem (P) generalized to N switches: To understand the general argument for a solution to (P N ), consider first the case with two possible switches. If at time t, there is only one switch left, then the present value (at time 0) of the switched cash-flow stream (from 2 to 1) on the interval [t, T ] is the payoff of switching immediately at t, plus the value of the option to switch later, Consider now the fictitious cash-flow streamx 2 such that PV( Then necessarilyx 2 (t) ≡ −Ẇ 21 (t)/β(t), i.e., The only remaining problem is how to optimally switch from x 1 tox 2 , which is equivalent to the simple cash-flow switching problem (P) discussed in Sect. 2.
In the general case with N ≥ 2 switches, odd-numbered switches are from x 1 to x 2 , and even-numbered switches are from x 2 to x 1 . Let ξ k (t) be the (somewhat fictitious) cash-flow stream that when switched to at time t will have the same present value as the cash-flow stream which on the interval [t, T ] includes a maximum of k switches. For this, we set ξ 0 x 1 if N is even, and ξ 0 x 2 if N is odd. Furthermore, we define recursively for all k ∈ {1, . . . , N }, where the (right-sided) adjoint variable for k remaining switches is given by The auxiliary cash-flow stream ξ k with k remaining switches incorporates the improvement of switching from the current cash-flow stream to the auxiliary cash-flow stream ξ k−1 with k − 1 remaining switches. This implies a solution to the N -multi-switching problem. (τ 1 (N ), . . . , τ N (N )) ∈ T N to the cash-flow switching problem (P N ) with N ≥ 1 allowable switches between the cash-flow streams x 1 and x 2 is such that the i-th switching time is
Analogous to our discussion after Corollary 2, at any time t ∈ [0, T ], the right-sided adjoint variable y k (T −t) determines the optimal stopping policy for the k-th switching time on the remaining time interval [t, T ]. Similarly, ξ k (t) defines the (fictitious) cashflow stream with that optimal policy implemented on the interval [t, T ]. The solution in Proposition 9 therefore implements Bellman's principle of optimality via backward induction from the right interval end t = T in the form of dynamic programming (Bellman 1957, Ch. III.3).
Example 4 Given the cash-flow streams x 1 and x 2 described in Example 2, consider the N -multi-switching problem (P N ) for N ∈ {1, . . . , 7}. Table 1 shows the components of the optimal timing vector τ (N ) ∈ T N . The solutions for N ∈ {2, . . . , 7} suggest a monotonicity property in the sense that optimal switches remain optimal when more switches are available. However, a counterexample to this heuristic is easily obtained by comparing the solutions for N = 1 and N = 2, as indeed τ 1 (1) / ∈ {τ 1 (2), τ 2 (2)}; see Fig. 5.
As can be gleaned from Table 1 (with V * 0 PV(x 1 ) ≈ 2.1133), the optimal value V * N of an N -multi-switching problem (P N ) is not necessarily concave in the allowed number of switches N ≥ 1. On the other hand, it is straightforward to see that in general both V * 2n+2 and V * 2n+1 are nondecreasing and concave in n, because each increase of n provides two extra switches, adding a full cycle relative to the current cash-flow stream. The resulting extra cycles must, by optimality, be chosen in the order of nonincreasing payoff increments.
Remark 6 As N becomes large, the optimal value V * N of the N -multi-switching problem (P N ) converges to the upper bound i.e., lim N →∞ V * (N ) = V * ∞ . This follows from the monotone convergence theorem (see, e.g., Rudin 1976, p. 55), for the sequence (V * N ) ∞ N =1 is nondecreasing and tightly bounded by V * ∞ .
Example 5 In the setting of Example 4, one obtains V * ∞ = V * N ≈ 3.2339, for all N ≥ 7.

Multiple cash-flow streams
Consider the switching problem for M ≥ 2 cash-flow streams x 1 , . . . , x M . As before, we assume that x 1 is the initial default option. The decision-maker's problem is to find the best cash-flow stream to switch to at the optimal time, which amounts to solving max j∈{2,...,M} Having the option to switch between multiple cash-flow streams means that the decision-maker can participate in the proceeds of a portfolio of simultaneous projects without being able to alter their timing and without being able to have stakes in more than one project at a time. where P M = {τ ∈ [0, T ] : λ j * (τ ) = 0}, with λ j = β max{y j , z j } and y j , z j uniquely determined by y j = (P x 1 −x j )y j and z j = (P x 1 −x j )z j , for j ∈ {2, . . . , M}, respectively.
The earliest optimal jump should be to the cash-flow stream which promises the highest payoff at a time when no strict improvement from waiting can be achieved.

Conclusion
The problem of switching between cash-flow streams can be reinterpreted as finding the optimal choice between a finite number of intertemporal streams of expected utility by a rational economic agent who can change activities, possibly at a cost. 12 The key insight from the analysis is that the optimal switching times, and in fact the entire switching policy up to the decision horizon, is characterized by an adjoint variable that can be precomputed as the unique solution of an initial-value problem. The adjoint variable measures the one-sided gain that is available in the future. Applying this logic backward leads to a natural dynamic-programming solution of the switching problem. As in Weber (2014), all results can be transposed into a discrete-time setting.
In terms of future research, it will be interesting to study the combinatorial extension of the cash-flow switching problem for finitely many cash-flow streams with a given maximum number of switching times. Moreover, one may consider a robust version of the problem when its primitives, such as the interval horizon, the cash-flow streams, or the interest-rate process, are only imperfectly known. Similarly, an investigation of the comparative statics may reveal that structured perturbations of the problem primitives-valid for a base case-may, under certain conditions, lead to monotone changes of the optimal solutions and resulting values of the objective function.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Appendix: Proofs
Proof of Lemma 1 Since f (t, ν, 0) = max{0, ν} ≥ 0 for all ν ∈ R, the right-hand side of the differential equation in Eq. (8) is nonnegative whenever y = 0. Together with the initial condition y(0) = 0, this implies-using the continuity of y and the intermediate value theorem-that the adjoint variable y(t) ≥ 0 for all t ∈ [0, T ]. In other words, it is not possible that y takes on negative values because when reaching the boundary where y = 0, it can only stay or grow (as in that caseẏ ≥ 0), but not decrease. We now show that y(s) For this, consider the initial-value probleṁ which for any measurable cash-flow streams x 1 and x 2 satisfies the Carathéodory conditions. By the Cauchy formula (see, e.g., Weber 2011, p. 25), the solution to Eq. (19) is of the form Consider the difference y − ν. Then (0) = 0 and, using the fact that y(s) ≥ 0, it is˙ for all s ∈ [0, T ]. Similar to our earlier argument that the adjoint variable y cannot become negative, we observe that˙ (s) ≥ 0. Indeed, at the boundary where (s) = 0, it is˙ (s) = max{0, x 2 (T −s)−x 1 (T −s)} ≥ 0, so that the difference y(s)−ν(s) must be nondecreasing on [0, T ]. More generally, the Cauchy formula yields the solution to the initial-value problem for : which implies that y(s) ≥ ν(s) for all s ∈ [0, T ], thus establishing the claim.
Proof of Proposition 1 Existence and uniqueness of a solution to the initial-value problem (8) are established separately. The result largely parallels but differs from Weber (2017, Thm. 1), as we allow here for solutions in the Sobolev space 13 Consider now the sequence of the largest possible horizons s k such that the consecutive elements of this 13 The iterative solution of an ordinary differential equation in this manner originated with Picard (1893) and Lindelöf (1894). Its convergence is usually established using the Banach fixed-point theorem, which cannot be used here, as the (right-sided) gain inflow f in Eq. (6) is discontinuous and does not satisfy the Carathéodory conditions. sequence coincide, y k (s) = y k−1 (s), for all s ∈ [0, s k ]: with the additional definition s 0 0. We now show the following statement: for all k ≥ 1. For this, we first introduce ϕ − (s) min{0, ϕ(s)} for all s ∈ [0, T ], and then note that y 1 = Py 0 = Pφ, with  (21) yields for all s ∈ [0, T ]. This means that y 1 (s) = y 2 (s) for all s ∈ [0, s 1 +ε 1 ], so necessarily Thus, the statement A (1) is true. The following "alternating nestedness" of the sequence σ is useful in the remainder of the argument.
By Eqs. (21) and (22) it is φ = y 0 ≤ y 2 ≤ y 1 . By virtue of Lemma 3, if y k = y k+1 (i.e., s k+1 = T ), then y k = y k+n (i.e., s k+n = T ) for all n ≥ 1. In our proof of A (k) for k ≥ 1 we therefore consider the nontrivial case where s k < T .
The forward difference between two consecutive elements of σ , starting with an even element y k = y 2 j+2 , is for all s ∈ [0, T ] and any integer j ≥ 0. By the definition of s k in Eq. (20) this yields Since y k (s k ) = y k−1 (s k−1 ), by the continuity of ϕ there exists an ε k ∈ (0, T − s k ] such that y k (s) > y k−1 (s) for all s ∈ (s k , s k + ε k ). But then 1 {y k (ς)≤0<y k−1 (ς)} = 0 on (s k , s k +ε k ), which (by continuity) implies that y k+1 (s) = y k (s) for all s ∈ [s k , s k +ε k ], whence (given that s 1 > 0, as shown earlier): Similarly, the forward difference between two consecutive elements of σ , starting with an odd element y k = y 2 j+1 , is for all s ∈ [0, T ] and any integer j ≥ 0. As a result, using again the definition of s k : The fact that y k (s k ) = y k−1 (s k ) implies (by continuity) that there exists an ε k ∈ (0, T − s k ] such that y k (s) < y k−1 (s) and therefore also 1 {y k−1 (s)≤0<y k (s)} , for all s ∈ (s k , s k + ε k ). Hence, y k+1 (s) = y k (s) on [s k , s k + ε k ], resulting in Combining the monotonicity of s k in (23) and (24), (s k ) ∞ k=0 is an increasing sequence with upper bound T . As such it must converge (Rudin 1976, p. 55), and since T is the smallest upper bound: 14 lim k→∞ s k = T.
14 If there were another boundT < T , then whenever s k =T , by virtue of A (k) one would obtain s k+1 >T , i.e., a contradiction.
Taking into account the · 1,∞ -norm in Eq. (9) yields The first term in inequality (25) tends to zero as k → ∞. The second term is by definition That this term cannot be relevant for k → ∞ may be shown as follows. Consider a small perturbation such that we consider the cash-flow streamsx i j (t) where j > 1 is a large integer. As j → ∞, the measure of the set [0, T /j), wherex i j can differ from x i , goes to zero. For any given j > 1, there is a k( j) such that [0, T − s 2k( j) ] [0, T /j), which implies that for all k ≥ k( j): If we therefore use the cash-flow streamsx i j , and consider the corresponding Picard-Lindelöf iteratesŷ k, j of the adjoint variableŷ j , computed analogous to the original iterates y k for y, then lim Thus, the j-th sequence (ŷ j,k ) ∞ k=0 must be a Cauchy sequence. By completeness of the Banach space W 1,∞ ([0, T ]), there exists an admissible functionŷ j ∈ W 1,∞ ([0, T ]) such that lim k→∞ŷ j,k =ŷ j .
The limit functionŷ j solves the fixed-point problem (written for the perturbed problem): But this means thatŷ j solves the initial-value problem (8 ) for the perturbed problem. Consider now the switched cash-flow streamx τ, j for the perturbed problem, analogous to x τ for the original problem in Sect. 2.2, witĥ LetV j (τ ) PV(x j,τ ). Then the difference in the objectives, 15 By the continuity of V andV j we obtain that the sequence of solution setsP j to the perturbed problem converges to the solution set P of the cash-flow switching problem (P), in the sense that for any converging sequence (τ j ) ∞ j=2 withτ j ∈P j for all j > 1, there exists a τ ∈ P such that lim j→∞τ j → τ , and vice versa, for any τ ∈ P there exists a converging sequence (τ j ) ∞ j=2 with limit τ . This means that the k-th Picard-Lindelöf iterateŷ j,k of the right-sided improvement for the j-th perturbed problem must uniformly converge to the k-th iterate y k of the right-sided improvement of the original problem. Moreover, It is now possible to choose a j (k) > 1 such that each of the terms is less than 1/k for all j ≥ j (k) [the third term converges to zero in j by Eq. (26)]. But this means that by successive approximation of the problem with the j (k)-th perturbed problem, we obtain that lim k→∞ y k+1 − y k 1,∞ = 0.
The claims (i) and (ii) together imply that there exists a unique solution to the initialvalue problem (8 ), which by construction has the same solution set as the initial-value problem (8), thus concluding our proof.
Proof of Proposition 2 Note first that by definition y(0) = 0, and by virtue of Lemma 1 the adjoint variable y(s) is nonnegative for all s ∈ [0, T ]. Thus, the set S {s ∈ [0, T ] : y(s) = 0} is nonempty (as 0 ∈ S). Its supremum, s * sup S, exists and lies in the interval [0, T ]. We distinguish two cases, depending on whether S is a singleton or not.

Proof of Proposition 3
For any s ∈ [0, T ], let W (s) V (T − s). Then any solution to the cash-flow switching problem, is also a solution of (P). Moreover, by Proposition 2 the smallest solution s * of (P ) is equal to T minus the largest solution τ * * of (P). Mirroring the objective function from V to W also mirrors the sign of corresponding net inflow,Ẇ (s) = −V (T − s). Accordingly, instead of discounting from T to t = T − s, it is necessary to compound from 0 to t, so that the left-sided cumulative cash-flow gain z necessarily satisfies the initial-value probleṁ The latter corresponds to the initial-value problem (8) with inverse cash-flow difference and r replaced by −r . By Proposition 2 the smallest solution of (P ) is s * = T −sup{t ∈ [0, T ] : z(t) = 0}, so the largest solution of (P) becomes τ * * = T − s * = sup{t ∈ [0, T ] : z(t) = 0}. Since Eq. (31) is equivalent to the initial-value problem (12), this concludes our proof.
Proof of Proposition 4 Consider the solution set P and the optimal value V * of the cash-flow switching problem (P). We first establish necessity and then sufficiency of the optimality condition (15).
(i) Necessity: If τ ∈ P, then by Remark 4 no improvement is possible on the interval [τ, T ], so y(T − τ ) = 0 necessarily. Similarly, no improvement is possible on the interval [0, τ ] which implies that z(τ ) = 0. Together with the definition of λ, this establishes Eq. (15) as a necessary optimality condition for any element of the set P. (ii) Sufficiency: Consider a switching time τ ∈ [0, T ] which satisfies λ(τ ) = 0. By Lemma 1 the adjoint variable y is nonnegative-valued, which-by symmetry-is also true for z. Hence, y(T − τ ) = z(τ ) = 0, so a positive gain over V (t) is attainable neither to the right (on [τ, T ]) nor to the left (on [0, τ ]), which implies that V (τ ) = V * , and-consequently-it must be τ ∈ P.
Based on (i) and (ii), Eq. (15) characterizes any solution to (P), which implies the claimed representation of the solution set P, concluding the proof.
Proof of Proposition 6 Since by the fundamental theorem of calculus and by the definition of the discount factor β it is the decision-maker's objective function with mandatory switching can be written in the form As a result, the solution to the cash-flow switching problem follows from Proposition 4 with the adjoint variable λ c = β max{y c , z c } instead of λ, where the one-sided adjoint variables y c and z c are uniquely specified as solutions to the fixed-point problems y c = (P x 1 +cr −x 2 )y c and z c = (P x 1 +cr −x 2 )z c , respectively.
Proof of Lemma 2 For any c ∈ R, let S c {s ∈ [0, T ] : y c (s) = 0}, generalizing the definition of S = S 0 in the proof of Proposition 2. Consider now two different switching costs c andĉ such that c <ĉ. Then because of the (weak) monotonicity of gain inflow f (see Eq. (6)) in its second variable (i.e.,x), it is y c ≤ yĉ. This in turn implies that Sĉ ⊆ S c , so necessarily sup Sĉ ≤ sup S c , and consequently also τ * c ≥ τ * c , completing the proof. Proof of Proposition 7 For any solution τ * c ∈ P c of the problem (P c ) with optional switching, we have Hence,V * c = max{V * c , V (T )}, and the stated optimal switching policy follows. Hence, by settingx where ' * ' denotes the convolution product, the switching problem (P v ) is equivalent to which is a simple switching problem of the form (P). By Proposition 4, we therefore obtain that τ * v solves (P v ) if and only if it is an element of P v {τ : λ v (τ ) = 0}, where λ v = β max{y v , z v } and y v , z v are one-sided adjoint variables, uniquely determined as the solutions (in the space W 1,∞ ([0, T ])) of the fixed-point problems y v = (Px0 +x 1 −x 2 )y v and z v = (Px0 +x 1 −x 2 )z v , respectively.

Proof of Proposition 9
For N = 1, an optimal switching time is τ 1 = τ * , as in Proposition 2. Consider now the case where N > 1. Let t ∈ [0, T ], and for k ∈ {2, . . . , N } assume that an optimal solution has been found for the problem with k − 1 switches on the interval [t, T ] resulting in the present value U * k−1 (t). Switching at time τ from an admissible cash-flow stream x (defined on [0, T ]) to the cash-flow stream ξ k−1 at the start of the interval [τ, T ] results in the payoff where the cash-flow stream ξ k−1 is such that As discussed in Sect. 2, the solution to the family of optimization problems, can be obtained-by the principle of optimality-from the (right-sided) adjoint variable y N of the "all-inclusive" problem that is: y k = (P x−ξ k−1 )y k . By Proposition 2, an optimal solution to the cash-flow switching problem (33) isτ k (t) = T −ŝ k (t), wherê Differentiating the maximized objective in Eq. (33) yieldṡ U * k (t) = d dt which, using Eq. (32), implies that If the number of remaining switches k and the total number of available switches N are both even or both odd (or equivalently, k + N is even), then the current switch k is from x 1 to x 2 . Conversely, if k is even (resp., odd) and N is odd (resp., even) (or equivalently, k + N is odd), then the current switch k is from x 2 to x 1 . Hence, we set x = x 1 if k + N is even, and x = x 2 if k + N is odd. As a result: By induction, the preceding arguments apply for all k ∈ {2, . . . , N }. The corresponding switching times τ 1 , . . . , τ N (with τ 1 ≥ · · · ≥ τ N ) obtain recursively, starting with the smallest (τ N ) : whereτ k = T −ŝ k as introduced earlier; see Eq. (34). This completes our proof.

Proof of Proposition 10
Given that x 1 is the current default cash-flow stream, the decision-maker compares the post-switch cash-flow streams for j ∈ {2, . . . , M}, where y j (P x 1 −x j )y j . The present value of ξ j is equal to the optimal value of the simple cash-flow switching problem, from x 1 to x j , so by Corollary 2 and the definition of the present value in Eq. (2) we have PV(ξ j ) = y j (T ) + PV(x 1 ). This implies that from x 1 the best cash-flow stream to switch to is x j * , where j * ∈ arg max The optimal switching time τ * is obtained by Proposition 4, in the sense that τ * must be an element of the solution set P M = {τ ∈ [0, T ] : λ j * (τ ) = 0} with the adjoint variable λ j = β max{y j , z j }. The one-sided adjoint variables y j , z j are uniquely determined as solutions (in the space W 1,∞ ([0, T ]) to the fixed-point problems y j = (P x 1 −x j )y j and z j = (P)z j , for any j ∈ {2, . . . , M}, which completes the proof.