1 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 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.

1.1 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).Footnote 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, 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 \({\mathcal L}^\infty \)) instead of the absolute integrability (as an element of \({\mathcal L}^1\)) stipulated originally.Footnote 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, and Flemming and Wright (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.Footnote 3

1.2 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.

2 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\in [0,T]\). Given the (measurable) schedule \(r:[0,T]\rightarrow {\mathbb R}\), which for any \(t\in [0,T]\) specifies an external rate r(t), representing a cost of capital or a hurdle rate,Footnote 4 let

$$\begin{aligned} R(t) \triangleq \int _0^t r(\theta )\,d\theta , \quad t\in [0,T], \end{aligned}$$
(1)

denote the cumulative interest up to time t. The present value of the cash-flow stream x is

$$\begin{aligned} \text{ PV }(x) \triangleq \int _0^T \exp [-R(t)]\,dX(t) = \int _0^T \beta (t)x(t)\,dt. \end{aligned}$$
(2)

where \(\beta (t)\triangleq \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\in [0,T]\).

Example 1

For a constant discount rate \(r(t)\equiv \hat{r}\in {\mathbb R}\), it is \(R(t) = \hat{r}t\) for all \(t\in [0,T\)], and the present value of the cash-flow stream x becomes \(\text{ PV }(x) = \int _0^T e^{-\hat{r}t} x(t)\,dt\).

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 decision-maker, who are the subjects of our study.

2.2 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 \(\tau ^*\) 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 \(\tau \in [0,T]\), the decision-maker obtains the switched cash-flow streamFootnote 5

$$\begin{aligned} x_\tau (t) \triangleq {\mathbf 1}_{\{t<\tau \}}\,x^1(t) + {\mathbf 1}_{\{t=\tau \}}\,\left[ \tau x^1(\tau )+(1-\tau )x^2(\tau )\right] + {\mathbf 1}_{\{t>\tau \}}\,x^2(t), \quad t\in [0,T]. \end{aligned}$$

The original cash-flow streams obtain as special cases for \(\tau \in \{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,

$$\begin{aligned} V(\tau )\triangleq \text{ PV }(x_\tau ) = \int _0^\tau \beta (t) x^1(t)\,dt + \int _\tau ^T \beta (t) x^2(t)\,dt, \quad \tau \in [0,T]. \end{aligned}$$
(3)

The objective function V, which represents the present value of the switched cash-flow stream, is differentiable, with derivative

$$\begin{aligned} \dot{V}(\tau ) = \beta (\tau )(x^1(\tau ) - x^2(\tau )), \quad \tau \in [0,T]. \end{aligned}$$

The decision-maker’s cash-flow switching problem amounts to maximizing the objective function,

$$\begin{aligned} \max _{\tau \in [0,T]} V(\tau ). \end{aligned}$$
(P)

By virtue of the Weierstrass theorem (see, e.g., Bertsekas 1995, p. 540) a solution \(\tau ^*\) to (P) exists. Let \({\mathcal P}\subseteq [0,T]\) denote the set of all solutions to the switching problem. For an interior \(\tau ^*\in (0,T)\), Fermat’s lemma implies that \(\dot{V}(\tau ^*) = 0\), leading to the necessary optimality condition

$$\begin{aligned} x^1\left( \tau ^*\right) = x^2\left( \tau ^*\right) , \end{aligned}$$
(4)

provided that \(\dot{V}\) is continuous in a neighborhood of \(\tau ^*\). 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 \(\tau \in [0,T]\) for which \(x^1(\tau )=x^2(\tau )\) 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 cash-flow 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 \(\mathcal 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 \(\tau \), the decision-maker changes his exposure from one stream of obligations (characterized by the net cash inflow \(x^1\) on \([0,\tau ]\)) to another stream of obligations (characterized by the net cash inflow \(x^2\) on \([\tau ,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 equipment-replacement decisions.

Fig. 1
figure 1

Available cash-flow streams \(x^1\) and \(x^2\) in Example 2 on [0, T]

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:{\mathbb R}\rightarrow {\mathbb R}\), then it is enough to replace x(t) by \(\hat{x}(t)\triangleq u(x(t))\), for all \(t\in [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.

Example 2

For \(t\ge 0\), consider the cash-flow streams \(x^1(t)\triangleq 1-c\exp (-at)\cos (\omega t)\) and \(x^2(t)\triangleq 1-\exp (-bt)\), where \(a,b>0\) are damping constants and \(\omega \ge 0\) 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)\equiv \hat{r}\in {\mathbb R}\). While in the very long run, i.e., for \(t\rightarrow \infty \), 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 \(\text{ PV }(x^2) > \text{ PV }(x^1)\) if (and only if) \(b>a + \omega ^2/(a+\hat{r})\).Footnote 6 Figure 1 shows the cash-flow streams \(x^1\) and \(x^2\) for the parameter values \((a,b,c) = (1,2,5)\) and \(\omega =2\pi \). For the horizon \(T=3\) and the constant interest rate \(\hat{r}=20\%\), Fig. 2 depicts the corresponding objective function V.

Fig. 2
figure 2

Objective function \(V(\tau )\) in Example 2, for all \(\tau \in [0,T]\)

2.3 Adjoint variable

The solution of the switching problem (P) is achieved by means of an adjoint variable, the cumulative (right-sided) gain,

$$\begin{aligned} y(s) \triangleq \int _{T-s}^T f\left( \theta ,x^1(\theta )-x^2(\theta ),y(T-\theta )\right) \,d\theta , \end{aligned}$$
(5)

where the (right-sided) gain inflow f, for \((t,\hat{x},\hat{y})\in [0,T]\times {\mathbb R}\times {\mathbb R}\), is defined as

$$\begin{aligned} f\left( t,\hat{x},\hat{y}\right) \triangleq \left\{ \begin{array}{ll} \hat{x} - r(t)\,\hat{y}, &{}\quad \text{ if } \hat{y}>0,\\ \max \{0,\hat{x}\}, &{}\quad \text{ if } \hat{y}=0,\\ 0, &{}\quad \text{ otherwise }. \end{array}\right. \end{aligned}$$
(6)

Starting at an initial value of zero at \(s=0\), the adjoint variable would measure any nonnegative gain available by continuing from \(\tau = T-s\) until the interval horizon T. By reversing the time-scale, the right-hand side of Eq. (5) becomes

$$\begin{aligned} y(s) = \int _0^s f\left( T-\theta ,x^1(T-\theta )-x^2(T-\theta ),y(\theta )\right) \,d\theta , \ \ \ s\in [0,T]. \end{aligned}$$
(7)

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:

$$\begin{aligned} \dot{y}(s) = f\left( T-s,x^1(T-s)-x^2(T-s),y(s)\right) , \quad y(0)=0, \quad s\in [0,T]. \end{aligned}$$
(8)

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.Footnote 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 (8), is bounded from below: \(y(s)\ge \max \{0,V(T) - V(T-s)\}/\beta (T-s)\), for all \(s\in [0,T]\).

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}^\infty \) 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 \({\mathcal W}^{1,\infty }([0,T])\) of differentiable functions with measurable and essentially bounded derivatives (in \({\mathcal L}^\infty ([0,T])\)). For this sufficiently large class of functions, it is possible to construct a Cauchy sequence which converges in the \(\Vert \cdot \Vert _{1,\infty }\)-norm, the latter being defined as

$$\begin{aligned} \Vert y\Vert _{1,\infty } \triangleq \int _0^T |y(s)|\,ds + \text{ ess }\sup _{s\in [0,T]} |\dot{y}(s)|, \end{aligned}$$
(9)

for any \(y\in {\mathcal W}^{1,\infty }([0,T])\). To determine the solution set of Eq. (8) (as a subset of \({\mathcal W}^{1,\infty }([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,

$$\begin{aligned} \Phi \big (\hat{\xi },\hat{y}\big ) \triangleq \hat{\xi }- \min \{0,\hat{\xi }\}\,{\mathbf 1}_{\{\hat{y}\le 0\}}, \quad \big (\hat{\xi },\hat{y}\big )\in {\mathbb R}^2, \end{aligned}$$
(10)

we obtain a measure that counts a net cash flow \(\hat{x}\) (at a given time) if it is positive or if the cumulative gain \(\hat{y}\) is positive. Specifically, provided the cumulative gain is nonnegative, the modified gain inflow equals the (regular) gain inflow, i.e., for any \((\hat{t},\hat{x},\hat{y})\in [0,T]\times {\mathbb R}\times {\mathbb R}\):

$$\begin{aligned} \hat{y}\ge 0 \ \ \Rightarrow \ \ f\left( \hat{t},\hat{x},\hat{y}\right) = \left( \hat{x} - r\left( \hat{t}\right) \hat{y}\right) \,{\mathbf 1}_{\{\hat{y}>0\}} + \max \{0,\hat{x}\}\,{\mathbf 1}_{\{\hat{y}=0\}} = \Phi \left( \hat{x}-r\left( \hat{t}\right) \hat{y},\hat{y}\right) . \end{aligned}$$

If we further introduce the time-reversed cash-flow difference \(\varphi (s)\triangleq x^1(T-s) - x^2(T-s)\) and the time-reversed interest rate \(\rho (s)\triangleq r(T-s)\), for \(s\in [0,T]\), then the initial-value problem in Eq. (8) is equivalent to

$$\begin{aligned} \dot{y}(s) = \Phi \left( \varphi (s)-\rho (s)y(s),y(s)\right) , \quad y(0)=0, \quad s\in [0,T]; \end{aligned}$$
(8′)

that is, it has the same set of solutions as Eq. (8). The space \({\mathcal W}^{1,\infty }([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 \(\Vert \cdot \Vert _{1,\infty }\)-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 \({\mathbf P}:{\mathcal W}^{1,\infty }([0,T])\rightarrow {\mathcal W}^{1,\infty }([0,T])\) mapping any admissible function y to a function \({\mathbf P}y\),

$$\begin{aligned} ({\mathbf P} y)(s) \triangleq \int _0^s \Phi (\varphi (\varsigma )-\rho (\varsigma )y(\varsigma ),y(\varsigma ))\,d\varsigma , \quad s\in [0,T], \end{aligned}$$
(11)

which (as can be verified) is also an element of \({\mathcal W}^{1,\infty }([0,T])\). The solution set of the initial-value problem (8′) is therefore the set of fixed points of \(\mathbf 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 \(\mathbf P\) to the initial seed \(\phi \), withFootnote 8

$$\begin{aligned} \phi (s) \triangleq \int _0^s \frac{\beta (T-\varsigma )}{\beta (T-s)}\,\varphi (\varsigma )\,d\varsigma = \frac{V(T)-V(T-s)}{\beta (T-s)}, \quad s\in [0,T], \end{aligned}$$

converges to the unique solution of Eq. (8). That is, when considering the sequence \(\sigma \triangleq (y_k)_{k=0}^\infty \), with the initial function \(y_0 = \phi \) and the Picard–Lindelöf iteration \(y_{k+1} = {\mathbf P}y_k\) for \(k\ge 0\), then \(y_k \rightarrow y\) as \(k\rightarrow \infty \), and y solves Eq. (8). In practice, the convergence of the sequence \(\sigma \) to the adjoint variable \(y = \lim _{k\rightarrow \infty } {\mathbf P}^k\phi \) is usually very efficient and takes place within a few iterations, as illustrated by the following example.

Fig. 3
figure 3

Computation of the adjoint variable y in Example 3 within five iterations

Example 3

In the setting of Example 2, let \(y_0 = \phi \). As illustrated in Fig. 3, the Picard–Lindelöf iterations converge rapidly: \(y = \lim _{k\rightarrow \infty } y_k = y_5 = {\mathbf P}^5\phi \). Note that successive iterates are “alternatingly nested,” in the sense that \(y_0\le y_2\le y_4\le y=y_5 \le y_3\le y_1\).Footnote 9

2.4 Optimal switching

For any solution \(\tau \) of the cash-flow switching problem (P), the right-sided adjoint variable y(s) in the inverted time scale \(s=T-\tau \) must vanish, i.e., necessarily \(y(T-\tau )=0\). This guarantees that no improvement is possible on the interval \([\tau ,T]\) relative to the present value \(V(\tau )\) obtained by switching at time \(\tau \). Conversely, when viewed from the left, the smallest point \(\tau ^*\in [0,T]\) which satisfies \(y(T-\tau ^*) = 0\) is the first for which all right-sided improvements vanish. It must therefore be globally optimal.

Proposition 2

Let \(s^*\triangleq \sup \{s\in [0,T]: y(s)=0\}\). The smallest solution of the cash-flow switching problem (P) is \(\tau ^* = T - s^*\).

The smallest solution of (P) is the earliest switching time \(\tau ^*\) for which no improvement of the objective can be obtained. By a symmetric consideration, one can determine the largest solution \(\tau ^{**}\) of (P) by measuring left-sided gains on the interval \([0,\tau ]\). For this, we introduce a (left-sided) (co-)adjoint variable z as solution to the initial-value problem

$$\begin{aligned} \dot{z}(t) = g\left( t,x^2(t)-x^1(t),z(t)\right) , \quad z(0)=0, \quad t\in [0,T], \end{aligned}$$
(12)

where the (left-sided) gain inflow g, for any \((t,\hat{x},\hat{z})\in [0,T]\times {\mathbb R}\times {\mathbb R}\), is defined as

$$\begin{aligned} g(t,\hat{x},\hat{z})\triangleq \left\{ \begin{array}{ll} \hat{x} + r(t)\,\hat{z}, &{}\quad \text{ if } \hat{z}>0,\\ \max \{0,\hat{x}\}, &{} \quad \text{ if } \hat{z}=0,\\ 0, &{}\quad \text{ otherwise }. \end{array}\right. \end{aligned}$$
(13)

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 (P) is \(\tau ^{**} = \sup \{t\in [0,T]:z(t)=0\}\).

As with Eq. (8′) for Eq. (8), there exists an equivalent formulation for the initial-value problem (12) for the computation of z,

$$\begin{aligned} \dot{z}(t) = \Phi (x^2(t)-x^1(t)+r(t)z(t),z(t)), \quad z(0)=0, \quad t\in [0,T], \end{aligned}$$
(12′)

with the modified gain inflow \(\Phi \) 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}^\infty \), where \(z_0 \triangleq \hat{\phi }\) and \(z_{k+1} = \hat{\mathbf P} z_k\) for \(k\ge 0\), with initial seed

$$\begin{aligned} \hat{\phi }(t) \triangleq \int _0^t \frac{\beta (\theta )}{\beta (t)}\left( x^1(\theta )-x^2(\theta )\right) \,d\theta = \frac{V(0) - V(t)}{\beta (t)}, \quad t\in [0,T]. \end{aligned}$$

The operator \(\hat{\mathbf P}:{\mathcal W}^{1,\infty }([0,T])\rightarrow {\mathcal W}^{1,\infty }([0,T])\) maps any admissible function z to an admissible function \(\hat{\mathbf P}z\), with

$$\begin{aligned} \left( \hat{\mathbf P} z\right) (t) \triangleq \int _0^t \Phi \left( x^2(\theta )-x^1(\theta ) + r(\theta )z(\theta ),z(\theta )\right) \,d\theta , \quad t\in [0,T], \end{aligned}$$
(14)

similar to the definition of the operator \(\mathbf P\) in Eq. (11). With this, the left-sided adjoint variable z is attained by repeatedly applying \(\hat{\mathbf P}\) to \(\hat{\Phi }\):

$$\begin{aligned} \lim _{k\rightarrow \infty }\hat{\mathbf P}^k \hat{\phi } = z. \end{aligned}$$

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 \(\tau ^* = \tau ^{**}\). In the case where \(\tau ^*\ne \tau ^{**}\), it is still \(V^* = V(\tau ^*)=V(\tau ^{**})\). The solution set is then the upper contour set of V relative to its globally optimal value \(V^*\) on [0, T]: \({\mathcal P} = \{\tau \in [\tau ^*,\tau ^{**}] : V(\tau )\ge V^*\}\).

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

$$\begin{aligned} \lambda (t)\triangleq \beta (t)\max \{y(T-t),z(t)\}, \quad t\in [0,T], \end{aligned}$$

one naturally obtains a necessary and sufficient condition for an optimal switching time.

Proposition 4

A point \(\hat{t}\in [0,T]\) is a solution to (P) if and only if

$$\begin{aligned} \lambda (\hat{t}) = 0. \end{aligned}$$
(15)

Accordingly, the solution set is \({\mathcal P} = \{t\in [0,T]: \lambda (t)=0\}\).

The fact that \(\lambda (\tau )\) can be interpreted as the total gain available on the domain [0, T] relative to the point \(\tau \) implies that the present value \(V(\tau )\) plus \(\lambda (\tau )\) must always be equal to the optimal value of (P); see Fig. 4.

Corollary 1

For all \(\tau \in [0,T]: \lambda (\tau ) + V(\tau ) = V^*\).

Knowing the adjoint variable \(\lambda \) 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.

Corollary 2

\(y(T) = \lambda (0) = V^* - V(0)\) and \(\beta (T)z(T) = \lambda (T) = V^* - V(T)\).

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):

$$\begin{aligned} V^* = y(T) + \text{ PV }(x^2) = \beta (T)z(T) + \text{ PV }(x^1). \end{aligned}$$
(16)

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 \(\tau \) or continue searching for a better stopping time on the interval \([\tau ,T]\) because

$$\begin{aligned} y(T-\tau ) = 0 \Leftrightarrow V(\tau )\ge \max _{\hat{\tau }\in [\tau ,T]} V(\hat{\tau }), \end{aligned}$$
(17)

for any \(\tau \in [0,T]\). Similarly, the left-sided gain z fully describes the optimal policy of whether to stop at \(\tau \) or earlier, since

$$\begin{aligned} z(\tau ) = 0 \Leftrightarrow V(\tau )\ge \max _{\hat{\tau }\in [0,\tau ]} V(\hat{\tau }), \end{aligned}$$
(18)

for any \(\tau \in [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.

Fig. 4
figure 4

Adjoint variables for the cash-flow switching problem in Example 2

Remark 5

Let \(x^1\) and \(x^2\) be defined on the general interval \([{\underline{t}},\bar{t}]\), where \({\underline{t}},\bar{t}\) are real numbers such that \({\underline{t}}<\bar{t}\). Consider the cash-flow switching problem

$$\begin{aligned} W^* = \max _{\tau \in [{\underline{t}},\bar{t}]} W(\tau ), \end{aligned}$$
(P′)

where

$$\begin{aligned} W(\tau ) \triangleq \int _{\underline{t}}^\tau \beta (\theta )x^1(\theta )\,d\theta + \int _\tau ^{\bar{t}} \beta (\theta )x^2(\theta )\,d\theta , \quad \tau \in [{\underline{t}},\bar{t}], \end{aligned}$$

is a differentiable real-valued objective function in \({\mathcal W}^{1,\infty }([{\underline{t}},\bar{t}])\). While (P′) may appear more general than the basic switching problem discussed thus far, it can be reduced to (P) by maximizing \(V(\tau ) \triangleq W({\underline{t}}+\tau )\) on the interval [0, T] with \(T\triangleq \bar{t}-{\underline{t}}\), just as in (P). By a translation, any solution \(\tau ^*\) of (P) directly corresponds to a solution \(\hat{\tau }^*\) of (P′): \(\hat{\tau }^* = \tau ^*-{\underline{t}}\).

2.5 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 and \(\hat{r}\), defined on [0, T]. Let \(\tau ^*\) and \(\hat{\tau }^*\) 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.

Proposition 5

If \(r\le \hat{r}\), then \(\tau ^*\ge \hat{\tau }^*\).

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.

3 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.

3.1 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

figure a

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 (\(\hbox {P}_c\)) with nonzero switching cost can be reduced to the simple cash-flow switching problem (P). For this, we introduce \(({\mathbf P}_{x^1-x^2}) y \triangleq {\mathbf P}y\) and \((\hat{\mathbf P}_{x^1-x^2})z \triangleq \hat{\mathbf 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\in {\mathbb R}\). A point \(\tau _c^*\in [0,T]\) is a solution to the switching problem (\(\hbox {P}_c\)) if and only if \(\tau _c^*\in {\mathcal P}_c = \{\tau : \lambda _c(\tau )=0\}\), where \(\lambda _c = \beta \max \{y_c,z_c\}\) is the adjoint variable, and \(y_c,z_c\) are the unique solutions of \(y_c = ({\mathbf P}_{x^1+cr-x^2})y_c\) and \(z_c = (\hat{\mathbf P}_{x^1+cr-x^2})z_c\). The resulting optimal value is \(V_c^* = V(\tau _c^*)-c\beta (\tau _c^*)\).

To incorporate switching costs when switching is mandatory, it is therefore sufficient to consider the default cash-flow stream \(\hat{x}^1_c \triangleq x^1 + cr\) instead of \(x^1\). As noted earlier, a positive switching cost introduces inertia in the decision-maker’s willingness to move from \(\hat{x}^1_c\) to the alternative cash-flow stream \(x^2\).

Lemma 2

The (smallest) solution to (\(\hbox {P}_c\)) is nondecreasing in the switching cost c.

If switching becomes more expensive, then it is never optimal to switch earlier.

3.2 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 becomes

figure b

Because in the case where the decision-maker chooses \(\tau \in [0,T)\), his payoff is identical to the payoff in the problem (\(\hbox {P}_c\)) with mandatory switching cost, any extra payoff related to the additional flexibility in the relaxed problem (\(\hat{\hbox {P}}_c\)) must come from saving the switching cost by holding out until the end of the horizon without switch.

Proposition 7

For \(c\in {\mathbb R}\), consider the optional switching problem (\(\hat{\hbox {P}}_c\)). Let \({\mathcal 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 \(\tau _c^*\in {\mathcal P}_c\). The resulting optimal value is \(\hat{V}_c^* = \max \{V_c^*,V(T)\}\).

The solution to the problem (\(\hat{\hbox {P}}_c\)) with flexibility reduces to the problem (\(\hbox {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).

3.3 Switch-triggered cash-flow streams

If a switch at time \(\tau \in [0,T]\) triggers a commitment that is associated with a cash-flow stream \(x^0\) (which can be of any duration), then the present value of this cash-flow stream is

$$\begin{aligned} v(\tau ) \triangleq \int _{\tau }^\infty \beta (\theta )x^0(\theta -\tau )\,d\theta = \int _0^\infty \beta (\vartheta +\tau ) x^0(\vartheta )\,d\vartheta . \end{aligned}$$

The switch-triggered cash-flow stream may well extend beyond the consideration interval [0, T]. When triggered at time \(\tau \), only its (differentiable) time-0 value \(v(\tau )\) is important.Footnote 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

figure c

As in the simpler problem (\(\hbox {P}_c\)) with constant switching cost, the strategy for solving (\(\hbox {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 rent \(\dot{v}(t)\).

Proposition 8

Assume that switching at time \(\tau \) triggers an obligation with present value \(v(\tau )\). A point \(\hat{\tau }_v^*\in [0,T]\) is a solution to (\(\hbox {P}_v\)) if and only if \(\tau ^*_v\in {\mathcal P}_v = \{\tau : \lambda _v(\tau )=0\}\), where \(\lambda _v = \beta \max \{y_v,z_v\}\) is the adjoint variable, and \(y_v,z_v\) are the unique solutions of \(y_v = ({\mathbf P}_{\hat{x}^0+x^1-x^2})y_v\) and \(z_v = (\hat{\mathbf P}_{\hat{x}^0+x^1-x^2})z_v\), given the auxiliary cash-flow stream \(\hat{x}^0 \triangleq \dot{v}/\beta \). The resulting optimal value is \(V_v^* = V(\tau _v^*)+v(\tau _v^*)\).

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.

4 Multi-switching

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

4.1 Multiple switches

Let \(N\ge 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

$$\begin{aligned} V_N(\tau ) = \sum _{i=0}^N \int _{\tau ^{i}}^{\tau ^{i+1}} x^{1+ (i\,\text{ mod }\,2)}(\theta )\,d\theta . \end{aligned}$$

be the decision-maker’s value for a vector for switching times \(\tau = (\tau ^1,\ldots ,\tau ^N)\in {\mathcal T}_N\) with

$$\begin{aligned} {\mathcal T}_N\triangleq \left\{ \left( \hat{\tau }^1,\ldots ,\hat{\tau }^N\right) \in [0,T]^N : \tau ^0\triangleq 0\le \hat{\tau }^1 \le \cdots \le \hat{\tau }^N\le T \triangleq \tau ^{N+1} \right\} . \end{aligned}$$

The “N-multi-switching problem” is the original cash-flow switching problem (P) generalized to N switches:

figure d

To understand the general argument for a solution to (\(\hbox {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 [tT] is the payoff of switching immediately at t, plus the value of the option to switch later,

$$\begin{aligned} W_{21}(t) \triangleq \text{ PV }\left( \hat{x}^1_{[t,T]}\right) + \beta (t) y_{21}(T-t), \quad t\in [0,T]. \end{aligned}$$

Consider now the fictitious cash-flow stream \(\hat{x}^2\) such that \(\text{ PV }(\hat{x}^2_{[t,T]}) \equiv W_{21}(t)\), i.e.,

$$\begin{aligned} \int _t^T\beta (\theta )\hat{x}^2(\theta )\,d\theta = W_{21}(t), \quad t\in [0,T]. \end{aligned}$$

Then necessarily \(\hat{x}^2(t) \equiv - \dot{W}_{21}(t)/\beta (t)\), i.e.,

$$\begin{aligned} \hat{x}^2(t) = x^2(t) + \max \{0,x^1(t)-x^2(t)\} {\mathbf 1}_{\{y_{21}(T-t)=0\}}, \quad t\in [0,T]. \end{aligned}$$

The only remaining problem is how to optimally switch from \(x^1\) to \(\hat{x}^2\), which is equivalent to the simple cash-flow switching problem (P) discussed in Sect. 2.

In the general case with \(N\ge 2\) switches, odd-numbered switches are from \(x^1\) to \(x^2\), and even-numbered switches are from \(x^2\) to \(x^1\). Let \(\xi ^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 [tT] includes a maximum of k switches. For this, we set \(\xi ^0\triangleq x^1\) if N is even, and \(\xi ^0 \triangleq x^2\) if N is odd. Furthermore, we define recursively

$$\begin{aligned} \xi ^k(t) \triangleq \left\{ \begin{array}{l@{\quad }l} x^1(t) + \max \{0,\xi ^{k-1}(t) - x^1(t)\} {\mathbf 1}_{\{y^k(t) = 0\}}, &{} \text{ if } k+N \hbox { is even}\\ x^2(t) + \max \{0,\xi ^{k-1}(t) - x^2(t)\} {\mathbf 1}_{\{y^k(t) = 0\}}, &{} \text{ if } k+N \hbox { is odd} \end{array}\right\} , \quad t\in [0,T], \end{aligned}$$

for all \(k\in \{1,\ldots ,N\}\), where the (right-sided) adjoint variable for k remaining switches is given by

$$\begin{aligned} y^k \triangleq \left\{ \begin{array}{ll} \left( {\mathbf P}_{x^2 - \xi ^{k-1}}\right) y^k, &{}\quad \text{ if } k+N \,\,\hbox {is even}\\ \left( {\mathbf P}_{x^1 - \xi ^{k-1}}\right) y^k, &{}\quad \text{ if } k+N \,\,\hbox {is odd} \end{array}\right\} . \end{aligned}$$

The auxiliary cash-flow stream \(\xi ^k\) with k remaining switches incorporates the improvement of switching from the current cash-flow stream to the auxiliary cash-flow stream \(\xi ^{k-1}\) with \(k-1\) remaining switches. This implies a solution to the N-multi-switching problem.

Proposition 9

A solution \(\tau (N)=(\tau ^1(N),\ldots ,\tau ^N(N))\in {\mathcal T}_N\) to the cash-flow switching problem (\(\hbox {P}_N\)) with \(N\ge 1\) allowable switches between the cash-flow streams \(x^1\) and \(x^2\) is such that the i-th switching time is \(\tau ^i(N) = T - s^i(N)\), where \(s^i(N)\triangleq \sup \{s\in [\tau ^{i-1},T] : y^{N-i+1}(s)=0\}\), for all \(i\in \{1,\ldots ,N\}\), and \(\tau ^0\triangleq 0\).

Analogous to our discussion after Corollary 2, at any time \(t\in [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 [tT]. Similarly, \(\xi ^k(t)\) defines the (fictitious) cash-flow stream with that optimal policy implemented on the interval [tT]. 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 (\(\hbox {P}_N\)) for \(N\in \{1,\ldots ,7\}\). Table 1 shows the components of the optimal timing vector \(\tau (N)\in {\mathcal T}_N\). The solutions for \(N\in \{2,\ldots ,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 \(\tau ^1(1)\notin \{\tau ^1(2),\tau ^2(2)\}\); see Fig. 5.

Table 1 Solution \(\tau (N)\) of the N-multi-switching problem (\(\hbox {P}_N\)) in Example 4, for \(N\in \{1,\ldots ,7\}\)

As can be gleaned from Table 1 (with \(V^*_0\triangleq \text{ PV }(x^1)\approx 2.1133\)), the optimal value \(V^*_N\) of an N-multi-switching problem (\(\hbox {P}_N\)) is not necessarily concave in the allowed number of switches \(N\ge 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 (\(\hbox {P}_N\)) converges to the upper bound

$$\begin{aligned} V^*_\infty \triangleq \int _0^T \beta (\theta )\max \{x^1(\theta ),x^2(\theta )\}\,d\theta , \end{aligned}$$

i.e., \(\lim _{N\rightarrow \infty } V^*(N) = V^*_\infty \). This follows from the monotone convergence theorem (see, e.g., Rudin 1976, p. 55), for the sequence \((V^*_N)_{N=1}^\infty \) is nondecreasing and tightly bounded by \(V^*_\infty \).

Example 5

In the setting of Example 4, one obtains \(V^*_\infty = V^*_N \approx 3.2339\), for all \(N\ge 7\).

Fig. 5
figure 5

Optimal switching times of the N-multi-switching problem in Examples 4 and 5

4.2 Multiple cash-flow streams

Consider the switching problem for \(M\ge 2\) cash-flow streams \(x^1,\ldots ,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

figure e

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.

Proposition 10

The tuple \((j^*,\tau ^*)\) solves the cash-flow switching problem (\(\hbox {P}_M\)) if and only if

$$\begin{aligned} j^*\in \arg \max _{j\in \{2,\ldots ,M\}} y_j(T) \quad \text{ and } \quad \tau ^*\in {\mathcal P}_M, \end{aligned}$$

where \({\mathcal P}_M = \{\tau \in [0,T]:\lambda _{j^*}(\tau )=0\}\), with \(\lambda _j =\beta \max \{y_j,z_j\}\) and \(y_j,z_j\) uniquely determined by \(y_j = ({\mathbf P}_{x^1-x^j})y_j\) and \(z_j = (\hat{\mathbf P}_{x^1-x^j})z_j\), for \(j\in \{2,\ldots ,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.

5 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.Footnote 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.