THE W,Z SCALE FUNCTIONS KIT FOR FIRST PASSAGE PROBLEMS OF SPECTRALLY NEGATIVE LÉVY PROCESSES, AND APPLICATIONS TO CONTROL PROBLEMS

In the last years there appeared a great variety of identities for first passage problems of spectrally negative Lévy processes, which can all be expressed in terms of two “q-harmonic functions” (or scale functions) W and Z. The reason behind that is that there are two ways of exiting an interval, and thus two fundamental “two-sided exit” problems from an interval (TSE). Since many other problems can be reduced to TSE, researchers developed in the last years a kit of formulas expressed in terms of the “W,Z alphabet”. It is important to note – as is currently being shown – that these identities apply equally to other spectrally negative Markov processes, where however the W,Z functions are typically much harder to compute. We collect below our favorite recipes from the Lévy “W,Z kit”, drawing from various applications in mathematical finance, risk, queueing, and inventory/storage theory. A small sample of applications concerning extensions of the classic de Finetti dividend problem is offered. An interesting use of the kit is for recognizing relationships between problems involving behaviors apparently unrelated at first sight (like reflection, absorption, etc.). Another is expressing results in a standardized form, improving thus the possibility to check when a formula is already known. Mathematics Subject Classification. 60G51, 60G40, 60J45. Received November 1, 2017. Accepted November 6, 2019.


Introduction
From our biased point of view, the W, Z scale functions kit is a new set of clothes for the classic first passage theory used in risk, queueing, mathematical finance and related fields, which was developed over the last 40 yr. A recent explosion of new contributions to this topic, notably to processes with Parisian ruin and reflectionsee Section 8, and the extension to spectrally negative Markov processes -see Section 11, suggested the utility of offering a new review. We attempted to pack in our "cookbook" a possibly overwhelming quantity of results; the best way for the reader to get an idea of what's to be found here might be to have first a quick look at the List of notations Section 13.
In this section we introduce the Cramér-Lundberg risk process, we define first passage times and some main quantities of interest for the control and optimization of risk processes.
Origins. The origins of our field lie in the ruin problem for the Cramér-Lundberg or compound Poisson risk model [1,109] (1.1) Here c is the premium rate, C i , i = 1, 2, ... are i.i.d. nonnegative jumps with distribution F (dz), arriving after independent exponentially distributed times with mean 1/λ, and N (λ) denotes the associated Poisson process counting the arrivals. Note that the process in parenthesis, called "cumulative loss", is used also to model the workload process of the M/G/1 queue. First passage theory concerns the first passage times above and below, and the hitting time of a level b. For any process (X t ) t≥0 , these are defined by with inf ∅ = +∞. The upper script X will be typically omitted, as well as the signs +, −, when they are clear from the context. First passage times are important in the control of reserves/risk processes. The rough idea is that when below low levels a, reserves processes should be replenished at some cost, and when above high levels b, they should be partly invested to yield income -see for example [1] and, for most recent work, papers like [4,7,31,78], etc.
The first quantity to be studied historically was the eventual ruin probability for the Cramér-Lundberg/compound Poisson risk model [1,109]. Subsequently, first passage (or exit) problems were studied in mathematical finance (barrier options, American options -see for example [94]), in risk [1], queueing [13], storage theory [48,150], in mathematical biology [133], and in many other applications. The typical approach for a long while consisted in taking Laplace transform of the associated Kolmogorov integro-differential equation involving the generator operator. In recent years it became clear that most first passage problems for spectrally negative or spectrally positive Lévy processes may be reduced to the solution of the two fundamental "two-sided exit" problems from an interval (TSE), upwards or downwards. At their turn, these can be ergonomically expressed in terms of two scale functions/q-harmonic functions W q (x), Z q (x, θ). In the case of spectrally negative processes, one ends up with the following equations: 1 We will call Ψ b q (x, a), Ψ b q (x, a) (killed) survival and ruin first passage probabilities, respectively. When a = 0, it will be omitted, to simplify the notation. Remark 1.1. Note that the first quotient decomposition above holds true by the absence of positive jumps and by the strong Markov property, and that this defines W q up to a multiplicative constant. The second relation is equivalent to (1.11) below which defines Z q up to a multiplicative constant (see Thm. 12 in [78] and Rem. 6.4 below). For many other results in this vein, see [22,32,42,43,78,85,94,104,142,153], and many other papers listed in the more detailed but still too succinct chronology in Section 12 below. (1.5) Here κ is the Laplace exponent of X given below in (2.1) and the Laplace transform of W (x) is W (s) = 1 κ(s) . Note that above and throughout the paper we will assume that κ (0 + ) exists, which renders formulas simpler (and is typically satisfied in applications). The scale function W (x) provides an alternative characterization of a spectrally negative Lévy process, which may replace the classic Laplace exponent κ(s). Remark 1.3. The eventual ruin and survival probability have made the object of numerous numerical studies, for example by inversion of Padé approximations of 1 κ(s) [9,23,26] -see [1] for other methods and references. Furthermore, it is easy to adapt numerical studies of W to yield W q , by the so called Esscher transform (replacing κ(s) by κ(s + q) − κ(q)) -see Remark 5.4. Note that once W q and Z q are computed, we have obtained also the answer to many other problems, thus removing the need for Laplace transform inversion. Hence, a cookbook of W q , Z q formulas provides an alternative to the classic Markovian analytic approach.
Before continuing, we note that the last decade has witnessed also very interesting research on last passage times -see for example [38,53,112,128]. Since we had to stop at some point, these will not be covered in our review.
Control of dividends and capital injections. The next impetus came from control problems in risk theory which concern versions of X t which are reflected/constrained/regulated at first passage times (below or above): (1.7) Here, are the minimal "Skorokhod regulators" constraining X t to be bigger than a, and smaller than b, respectively, and we use the notation x + = max(x, 0) and x − = min(x, 0).
One problem of historical interest is the de Finetti problem of expected total discounted dividends until the ruin time T 0,− , in the presence of a constant (reflecting ) dividend barrier -see (6.1). Interestingly, its solution looks very similar to (1.3). Intuitively, this is due to the fact that the two problems differ only in what happens at the boundary b (reflection versus absorption), which is translated respectively into the boundary conditions Ψ b q (b) = 1, (V b] ) (b) = 1 -see Remark 6.2. In fact, this is the heart of the W, Z theory: problems which differ only via their boundary behavior have similar answers -see Section 6 for further examples.
Drawdowns and drawups. Applications require often the study of the running maximum and of the process reflected at its maximum/drawdown (1.8) or that of the running infimum and of the process reflected from below/drawup The first passage times of the reflected processes, called drawdown/regret time and drawup time, respectively, are defined for d > 0 by τ d := inf{t ≥ 0 : X(t) − X(t) > d}, τ d := inf{t ≥ 0 : X(t) − X(t) > d}. (1.10) Such times turn out to be optimal in several stopping problems, in statistics [121] in mathematical finance/risk theory (in problems involving dividends at a fixed barrier or capital injections) -see for example [22,41,50,95,99,100,118,141,143,144] and in queueing theory (for example when studying idle times until a buffer reaches capacity) -see for example [60,61]. Capital injections/bail-outs. A second important problem is that of the expected capital injections necessary to maintain a process positive, before reaching an upper barrier; this involves two reflecting boundaries. Since problems with double reflection live on finite intervals, the possibility to solve them by Laplace transforms seems lost at first; however, their solutions are also expressible in terms of the fundamental scale functions W q , Z q .
For example, the joint Laplace transform of the total regulation/capital injections into a spectrally negative process (1.7) reflected at a and of the first up-crossing of a level b is ( [78], Thm. 2) where E [a x denotes the expectation for the process reflected at a, T [a b denotes the corresponding hitting time (6.5), and e q denotes an independent exponential random variable of rate q. This factorization is essentially a direct consequence of the strong Markov property. In our view, it is maybe the most important first passage law -see Theorem 6.3.
Joint behavior of the process and its drawdown. The third act in the development of risk theory was the consideration of the joint behavior of the process and its historical maxima or minima, or, equivalently, of the process and its drawdowns or drawups. It turns out that this study, just like the previous problems, may be reduced to finding the W q , Z q functions -see for example Theorem 6.13.
Contents. We start with a brief review of Lévy processes in Section 2. Section 3 presents the function W q which is the pillar of this field, and includes three remarkable results in which it appears. Section 4 introduces the Z q scale function, and Section 5 introduces a two variables extension Z q (x, θ) of Z q (x).
We turn next to the extensive and expanding body of knowledge concerning spectrally negative Lévy processes. Our W, Z "cookbook" collects a list of some of our favorite recipes. They come from many recent papers, like [4, 7, 22, 31-33, 78, 79, 81, 126] and other papers cited below, and we apologize for any omission. Section 6 alone lists ten of the most important first passage laws, dubbed theorems, an eleventh "meta theorem" including the "Poissonian/Parisian version" of most of the first ten theorems is presented in Section 8, and other twelve results spread throughout the paper are called propositions (this partition was adopted for the same reasons we organize files in folders).
Section 7 reviews some W, Z formulas for smooth Gerber-Shiu functions. Here the smooth Gerber-Shiu function Z q (x, θ) which corresponds to the overshoot penalty e θX T 0 is replaced by a function G w (x) corresponding to an arbitrary penalty function w(X T0 ).
Section 8 reviews W, Z formulas for processes with Poisonian/Parisian observations, and for the more general Omega processes. The idea, which emerged naturally in the last decade in the context of financial modeling, is that "transgressing boundaries" may pass unnoticed, with or without purpose, if observations are not continuous. This gives rise to "soft boundaries", in addition to the traditional reflecting and absorbing "hard boundaries" from the physics world; it seems therefore an important development in the theory of Markov processes. This topic is excellently presented in the article [12], but we go beyond that. Quite surprisigly, despite the fact that the methods of proof are different, we have showed in [20] that several of the Parisian formulas coincide with the classic ones, in terms of two new scale functions (which generalize the classic ones). The same phenomenon was observed in [33] for processes with Parisian observations within a finite buffer, below which absolute ruin occurs. It is still not understood why the classic and (buffered) Parisian laws look identical, once the appropriate scale functions have been identified. Let us note that due to its theoretical and applied implications, this topic constitutes an active field of research, with many open problems, some of which are listed below.
To illustrate the potential applicability of W, Z formulas, we have included in Section 9 an important application: the optimization of dividends, under several objectives. We have chosen this application partly since it is a fundamental brick in the budding discipline of risk networks [17,18,20]. We also chose this to emphasize that the famous and still not completely understood de Finetti optimization problem [31,32,35,36,56,68,101,139] is just one of a family of similar optimization problems which can be tackled via the scale function methodology, some of which may be more tractable than the original. Section 10 illustrates the results on examples like (Sect. 10.1) and exponential claims (Sect. 10.3), and Section 10.4 illustrates the numerical optimization of dividends for the Azcue-Muler example [35].
Section 11 reports on recent results on drawdown problems. The motivation is to explore the idea that in risk control (and optimal consumption/harvesting problems) it may be profitable to base decisions both on the position of the underlying process and on its distance from previous suprema. This suggests basing decisions on Azema-Yor/generalized drawdown/trailing stop times, which involve certain admissible functions of the position and supremum. This framework provides a natural unification of drawdown and classic first passage times.
It was discovered in this context that W, Z formulas continue to hold for spectrally negative Markov processes [100]. The only difference is that in equations like (1.3) and (1.4), W q (x − a), Z q (x − a, θ) must be replaced by functions with one more variable W q (x, a), Z q (x, a, θ). Unfortunately, the computation of these scale functions is currently understood in only one particular case outside Lévy processes and diffusions: that of Ornstein-Uhlenbeck with phase-type jumps, treated in Jacobsen-Jensen [83]. However, we believe that other diffusions with phase-type jumps will be treated in the future via variations of this approach. For that reason, we decided to present the last Section 11 in the context of spectrally negative Markov processes (note though that this is mostly uncharted territory).
The paper ends with a short chronology in Section 12, and a summary of notations and asymptotic formulas in Sections 12, 13, 13.1.
We hope that our compilation may be of help as a quick introduction to more detailed treatments like [43,63,85,93,94] and also as a cookbook for computing quantities of interest in applications like risk theory, mathematical finance, inventory and queueing theory, reliability, etc. We will be forced to make appeal to the literature for many proofs, but some of the most useful methods of attack will be included.

A glimpse of Lévy processes
A Lévy process [43,94]. X = X t ∈ R, t ≥ 0 may be characterized by its Lévy-Khinchine/Laplace exponent/symbol κ(θ), defined by Remark 2.2. This result is behind the well-known duality between queueing and risk theories, which are concerned with reflected and absorbed processes, respectively. For example, applying it when t → ∞ to the negative of the Cramér-Lundberg process −X, when κ (0 + ) > 0, yields the well-known identity between the stationary law of the M/G/1 workload process and the infimum X ∞ of the Cramér-Lundberg risk process -see [13,14], and see [45,124] for further applications.
Remark 2.3. The reflected processes of a Lévy process are Markov processes ( [43], Prop. VI.1); therefore, nice results on them and first drawdown /drawup passage times are to be expected.
Lévy processes satisfy the well-known Wiener Hopf factorization ( [43], Prop. VI.5), a short version of which is: Lemma 2.4. Let G t := sup{0 ≤ s ≤ t : X s = X t } be the last time the process X equals its supremum before or at time t (t − G t is therefore the duration of the last drawdown at time t). For any independent exponential random variable e q with rate q > 0, the pairs (X(e q ), G(e q )) and (X(e q ) − X(e q ), e q − G(e q )) are independent under P 0 .

The spectrally negative Lévy risk model
From now on, X t , t ≥ 0 will denote a spectrally negative Lévy process. It is natural in applications to restrict to the case when the Laplace exponent has a Lévy-Khinchine decomposition of the form (and Π(−∞, 0) = 0). 2 This implies that the growth (or profit) rate satisfies a reasonable assumption in risk theory.
If furthermore the jumps of the process have a finite mean ∞ 0 yΠ(dy) < ∞ (but not necessarily finite mass, which allows including interesting examples like the Gamma process [58]), we may rewrite (2.2) as which reflects a decomposition into a Brownian motion with parameters (c, σ) and the negative of a subordinator. We will call this the Brownian perturbed finite mean subordinator risk model. A further particular case to bear in mind is that when the Lévy measure has finite mass Π(0, ∞) = λ < ∞. We may write then Π(dz) = λF (dz), and rewrite the process and its symbol as where B t is the Wiener process, C i , i = 1, 2, ... are i.i.d. nonnegative jumps with distribution F (dz), arriving after exponentially distributed times with mean 1/λ, and f C denotes the Laplace transform of C i . This is the Brownian perturbed compound Poisson risk model [57]. If furthermore X t has paths of bounded variation, which happens if and only if σ = 0, we obtain the classic Cramér-Lundberg risk model (1.1). The simplicity of this case comes from the fact that its down-ladder times are discrete, which made it a natural favorite in risk theory. Finally, let us mention the so-called "Pollaczek-Khinchine" processes which satisfy a generalization of the Pollaczek-Khinchine formula [57]. The most general version due to [77] is obtained by putting together a negative subordinator satisfying (0,∞) (y ∧ 1)Π(dy) < ∞ and an independent spectrally negative zero mean perturbation satisfying (2.3). The advantage of this class comes from the fact that its jump down-ladder times are discrete.
State dependent Lévy processes. Nowadays there is also considerable interest in "Lévy processes with state dependent coefficients". For example Albrecher and Cani studied the Cramér-Lundberg process with affine [2], and [55] studied a more general "Lévy driven Langevin model" dX t = p(X t )dt − dS t , where S t is a spectrally positive Lévy process.
3. The scale function W q and its logarithmic derivative ν q

Introduction
First passage results for spectrally negative Lévy processes are remarkably simpler than in the general case. Here everything reduces finally to the determination of the "scale functions" W q (x) : R + → [0, ∞), q ≥ 0 defined on the positive half-line by the Laplace transform (3.1), and extended to be 0 on R − .
Applying optional stopping at T x,+ to the Wald martingale e ΦqXt−qt yields the fundamental identity where e q is an independent exponential random variable with parameter q (thus, T x,+ , x ≥ 0 is a subordinator, with Laplace exponent Φ q [43], Thm. VII.1). The factorization simplifies considerably for Lévy processes which jump in only one direction (as is the case in queueing and risk theory), since then one part of the factorization involves only the root Φ(q) defined in (3.2). Typically, this renders the factorization unnecessary, with most things expressable in terms of the pair of functions κ, Φ. For example, in the spectrally negative case, the moment generating function of the drawdown Y eq at an exponential time e q , equal to that of −X eq , satisfies ( [94], Thm. 4.8) When q → 0, this becomes the Pollaczek-Khinchine formula which made some authors call (3.4) the generalized Pollaczek-Khinchine formula. Another case in which the factorization is easy to compute is that of two-sided phase-type jumps -see for example [15].
The smooth two-sided exit problem. The most fundamental first passage problem is the classic gambler's winning problem [69] ( [142], Thm. 3; [42], (6)). This is an extension of (3.3), in which one kills the process upon reaching a lower barrier a which may be taken w.l.o.g. to be 0.
Analytically, ν q (s) is the "logarithmic derivative of W q from the right" ( [94], (8.26)), 6) and the "from the right" will be omitted below since we assume W q ∈ C 1 (0, ∞). 5 Remark 3.3. Two probabilistic interpretations of ν q . We are trying to avoid as much as possible in our review the use of excursion theory. However, in preparation for the very important problem of dividends paid under a constant barrier policy, we will make an exception, and present a "homemade" version of excursion theory, explained in this remark and in Section 11.
1. It has been noted in [8] that the last equality in (3.5) may be interpreted as the probability that no arrival has occurred between times x and b, for a nonhomogeneous Poisson process of rate ν q (s). This checks with the probabilistic definition of ν q (s) provided by excursion theory: where n(d ) is the characteristic measure of the Poisson process of downward excursions from a running maximum, denotes the height of a downward excursion, s( ) denotes the starting time of an excursion, and e q is an independent exponential random variable of rate q -see for example [43], ([62], (12)). 2. We would prefer to avoid excursion theory in our cookbook; however, the concept of excursion is too fundamental to be avoided. We proceed therefore with a "homemade" version of excursion theory for spectrally negative processes, based on excising the negative excursions of X t . It has been noted in [11,30] that differentiating the last equality in (3.5) yields One may recognize here the Kolmogorov equation for the probability that a deterministic process X(s) = s starting at 0, and also killed at rate ν q (s) either when a negative excursion larger that s occurs, or when an exponential clock of rate q ticks, reaches b before being killed. "It turns out" that X(s) may be obtained by taking the running maximum value s as time parameter, and by excising the negative excursions of X(t) which are larger than s. This interpretation is fundamental, and holds for spectrally negative Markov processes as well -see the last Section 11, in particular Remark 11.1. X(s) will be called from now on "excised ladder process". Note that the quotation marks in "it turns out" above and below mean that the statement can be left as an exercise for the Cramér-Lundberg process, but needs in general careful treatment, which is beyond the scope of our cookbook.
Summarizing this discussion, we retain that ν q (s) represents the rate of the exponentially distributed period of time the process spends at an upward creeping moment (when X t = X t ), before a downward excursion bigger than s occurs, and before an exponential clock of rate q ticks [94].
This interpretation of ν q (s) is especially important in the de Finetti problem (6.1), where we will exploit the fact that the expected dividends v q (b) paid at a fixed barrier b when starting from b equal the expected discounted time until killing of X. This yields finally the simple relation This relation can be extended to spectrally negative Markov processes with generalized drawdown (11.29).
The smoothness of W q . Regarding the smoothness of the scale function, it holds that W q ∈ C 1 (0, ∞) iff the Lévy measure has no atoms, or X is of unbounded variation. If a Gaussian component is present (σ > 0), then furthermore W q ∈ C 2 (0, ∞). See [52,64] for further results on smoothness, and [101] for the case of completely monotone Lévy measures. 6 Below, we will always assume that W q (·) is smooth enough to satisfy the equation G(W q )(x) = qW q (x) in the classical sense.
The behavior in the neighborhood of zero of W q can be obtained from the behavior of its Laplace transform (3.1) Following the same approach, we may recursively compute W q (0), etc. (these Taylor coefficients may be used in Padé approximations, see [26]). We find, when the jump distribution has a density f , that where the notation for the compound Poisson case is as in (1.1). This equation is important in establishing the nonnegativity of the optimal dividends barrier -see Example 10.6. We offer now as appetizer a strikingly beautiful recent application of the scale function due to (14) in [71] to the calculation of the maximal severity of ruin [123] -see also Prop XII.2.15 in [1] for the compound Poisson case.
The cumulative distribution function of the maximal severity of ruin −X η (i.e. the absolute value of the infimum of the process before "recovery after ruin") is given by Proof. By requiring that the first passage time precedes reaching −u and by using the gambler's winning identity (3.5) one obtains that On the other hand, by considering the event of reaching 0, but never reaching −u at all we get and by using (1.5) and (3.12) it follows that Remark 3.5. We end this subsection by noting that showing that the function defined by (1.3) has Laplace transform (3.1) (up to a constant), is not trivial. The first construction via excursion theory is due to Theorem VII.8 in [43]. Other elegant solutions are due to [119], who used a Kennedy type martingale, and to (3) in [126], who constructed the scale function as where u q is the potential density -see (6.14) below for a proof of the last formula, which can be easily implemented via Monte Carlo simulation. 7,8 The simplest solution maybe is to reduce to the case q = 0 by using the easily checked Esscher transform relation (3.14) Here W (Φq) 0 (x) denotes the 0-scale function with respect to the "Esscher transformed" measure P (Φq) (in general, the transform P (r) of the measure P of a Lévy process with Laplace exponent κ(s) is the measure of the Lévy process with Laplace exponent κ(s + r) − κ(r), with r in the domain of κ(·) ( The advantage of W (Φq) 0 (x) is that this is a monotone bounded function, with values in the interval (lim s→∞ s κ(s) , 1 κ (Φq) ). Therefore, for numerical computation of W q it will be useful to replace it by W (removing thus the exponential growth). Padé and Laguerre approximations of (3.14) are provided in [29]. Another probabilistic interpretation of (3.14) is 7 (3.13) holds trivially for x ∈ R − as well, when it reduces to Px T {0} < eq = e xΦq , which may be interpreted as the value of a payment of 1 at the hitting time T {0} . 8 Noting finally that uq(x), x ∈ R + is exponential given by uq(x) = Φ q e −Φq x , x ≥ 0 and letting u + q (x) = Φ q e −Φq x , x ∈ R denote the analytic continuation of uq(x), x ≥ 0 yields yet another representation Wq(x) = u + q (−x) − uq(−x) [21].
Remark 3.6. Φ q and the other roots of the Cramér-Lundberg equation κ(s) − q = 0 play a central role in asymptotics computations. Clearly, Φ q is the asymptotically dominant singularity The other poles of the right hand side of (3.1) (the roots of the Cramér-Lundberg equation) intervene, when they exist, in the asymptotics of the eventual ruin probabilities when κ (0 + ) > 0 and in their numerical approximations -see for example [9,[23][24][25][26].

Two resolvents in terms of the W q (x) function
We will recall here two fundamental resolvent formulas expressed in terms of W q . Resolvents are at a level of sophistication above the other concepts reviewed in this paper, and these results will not be proved. However, once accepted, they provide us with a convenient point of entrance in our topic. We introduce first a notation style used throughout the paper.
Remark 3.7. Our cookbook will require notations for several types of boundaries for example absorbing, reflecting, refracting, and Parisian/Poisonian stopping or reflecting. To deal with these five cases, it is convenient, following [81], to append the state space to the specification of a process; the five cases above will be denoted below by b|, b], b[, b . . ., b} for an upper boundary, and for a lower boundary by |a, [a, ]a, . . .a, {a . For drawdown boundaries, the respective notations will be d, d,d,d, d. Note that the term "boundary" for the refracting and Parisian cases is meant in the sense of a discontinuous "regime switching" in the drift and killing parameters of the process, respectively. This convention gives suggestive notations when composing several mechanisms. For example, for the "classic reflection above at b, with Parisian reflection below at b 0 and absolute ruin at a < b 0 " studied in [33,130], the notation for the corresponding state space would be |a, {b 0 , b 1 ]. Such boundaries are useful in optimal control [132]. Note that absorption delimiters like |a and b| and may and will be often omitted without confusion (so the default for an unspecified end-point is absorbing). Proposition 3.8. Put W q (x, a) = W q (x − a) (as a reminder that these formulas hold also for spaceinhomogeneous models, like for example for refracted processes [114] Note also the following identities in limiting cases -see for example Chapter 8.4 in [94]: where b > 0 and the killing rate q ≥ 0 is implicit. B) The q-resolvent of a spectrally negative Lévy process absorbed below at a and reflected above at b (see (1.7) for definition of reflection) has the resolvent density ( [81], (21); [104], Thm. 2.4) where the derivative is taken with respect to the first variable.
Remark 3.10. For other resolvent laws involving all possible combinations of boundary conditions (reflection or/and absorption), see [81,94,104]. Note that the proofs use typically excursion theory. One exception is Theorem 4.1 in [132], who compute the resolvent density u ]0 q,λ (x, y) with Parisian reflection at Poisson observation times of intensity λ. The proof uses the Markov property in the bounded variation case, and a Laplace transform approach in the unbounded variation case.

4.
Obtaining the Z q (x) function in terms of W q (x) by using the resolvent The first resolvent formula will now be used to introduce the second pillar of this theory, the scale function Z q , which intervenes in the "non-smooth-exit law" below. Using this together with the "smooth-exit law" (3.5) will be essential in deriving the other recipes offered below.
The Laplace transform of the time until the lower boundary 0 in the presence of reflection at an upper boundary b ≥ 0 is ( [32], Prop. 5.5; [78], Thm. 6)

2)
where E b] denotes expectation for the process reflected from above at b and denotes the first passage below 0 under this measure (recall that τ b is a drawdown time (1.10), or, equivalently, the time when the process starting at b and Skorokohod reflected at b is ruined 10 ).
Here is a proof of Proposition 4.1, borrowed from [114] (who consider the more general case of Omega models).
Proof. A) Put T = min(T 0 , T b,+ ), and consider the elementary identity: taking expectation and using the resolvent formula (3.16), we get Putting now Z q (x) = 1 + qW q (x) yields the result. B) Applying the same steps to T b] 0 , we find Remark 4.2. These two proofs illustrate the very important method of integrating resolvent densities -see [81] for a compendium of resolvent formulas. For a direct proof not using resolvents, in the case of Brownian motion, see Theorem 1.1 in [116].  Let us examine now a "failed direct approach" to establish Using now the decomposition (4.3) yields The boundary condition on the derivative is equivalent thus to the boundary condition on the function Ψ b] , which we wanted to avoid establishing. A more sophisticated approach is thus needed. For the Cramér-Lundberg model, the boundary condition (4.6) on the derivative has been established in [111], using the regenerative property of the Poisson process at claim instants (their proof is quite ingenious). For spectrally negative Lévy processes, the use of excursion theory seems unavoidable.
Remark 4.4. The Propositions 3.2-4.1 and most of the results in this review may be modified to apply formally to the context of spectrally negative and spectrally positive Markov processes, which include for example the continuous state-space branching processes (CSBP) -see for example Chapter 12 in [94] (in particular Thm. 12.8), and the continuous-state branching processes with immigration (CBI) introduced by Kawazu and Watanabe [92], which may characterized in terms of two Laplace exponents ψ, κ of spectrally positive Lévy processes. However, while W, Z exist (as functions of two variables), no straightforward method for their computation is available. 11 Remark 4.5. Adding (3.5) and (4.1), we find that for T = min(T 0 , T b,+ ) which recovers ( [42], Cor. 1) (up to the omission of q there). Since this must be less than 1, it follows that the Wq(x) is increasing, or, equivalently, that W q (x) is log-concave, and see also [105]. 11 Recall that CSBPs are characterized by generators of the form xψ(D), where ψ(D) is the generator of a spectrally positive Lévy process, and that they may be obtained from spectrally positive Lévy process by a time-change called the Lamperti transformation -see [54]. This acts on the Skorokhod space D of càdlàg trajectories with values in E = [0, ∞], as follows: for any f ∈ D, introduce the additive functional I and its inverse ← − I , given by , so that 0, ∞ indeed are absorbing for L(f )). It may be checked that L is a bijection of D, with inverse given by L −1 (g) = g • I(g). An extension to the CBI case is offered in [51]. However, the Lamperti transformation seems too complicated to yield a method for the computation of W, Z in terms of the Lévy Laplace exponents. It is intriguing to investigate whether simple formulas for W, Z are available in these cases at all.
For a second probabilistic proof of (4.8), consider the time from b to 0 of a reflected process (4.2), which is equal in law to the drawdown time τ b . 12 Since this must be less than 1, the nonnegativity of the term in parenthesis follows.
Reduction of first passage problems to the computation of the solutions W q and Z q of TSE. It turns out that the solutions of a great variety of first passage problems reduce ultimately to the solutions of the two-sided smooth and non-smooth first passage problems of exit from a bounded interval (TSE). Thus, they may be expressed in terms of W q [42], and further simplified by the introduction of the second scale function Z q [22]. Many calculations and inversions of Laplace transforms may be replaced for spectrally negative Lévy processes by the computation of the W and Z scale functions -see [31,78,[125][126][127], to cite only a few papers. Furthermore, the formulas reviewed hold as well for spectrally negative Markov additive processes, where the appropriate matrix scale functions were identified in [78,79,89], for random walks (the compound binomial risk model) [19], and for positive self similar Markov processes with one-sided jumps [145,147].
Somewhat surprisingly, it appeared recently that the recipes reviewed below apply equally to spectrally negative Lévy processes with (exponential) Parisian absorption or reflection below [5,12,33,40,107], with the appropriate scale functions W, Z identified in [20,33]. This mystery was explained in [104,114,146], who showed that the W, Z recipes appropriately extended apply to the general class of Omega models, of which Parisian Poissonian models are a particular case. In fact, the second paper considers even more general models with refraction [86,90].

The three variables
Let x W q (θ) denote the Laplace transform of the shifted scale function x W q (y) := W q (x + y) (the composition of shift with Laplace transform is also called Dickson-Hipp operator).
When the Laplace transform E x [e θX T 0 ] of the first position of the process after exiting [0, ∞) is of interest, one ends up working with the two variables Z q scale function [22,78] ( [32], Cor. 5.9), defined for θ ∈ C such that the real part (θ) > Φ(q) (to ensure integrability) by: (5.1) (see Cor. 6.6 A for the proof of the last decomposition.) Thus, up to a constant, Z q (x, θ) is the Laplace transform x W q (θ) of the shifted scale function x W q (y) := W q (x + y), and the normalization ensures that Z q (0, θ) = 1. Remark 5.1. The first term in the decomposition above is asymptotically dominant for q > 0. The second term simplifies in the Cramér-Lundberg case when x = q = 0 to identifying the well-known Laplace transform of the deficit at ruin starting from 0 for the Cramér-Lundberg process, where Π denotes the Laplace transform of the tail of the Lévy measure Π(y) = Π(y, ∞).
The analytic continuation of (5.1) is This implies that Remark 5.2. We can also identify Z q (x, θ) via its Laplace transform in x: We list now some useful easy to check formulas involving Z q (x), Z q (x, θ): where denotes here and below derivative with respect to x and Π(y) = Π(y, ∞). The second formula for Z q (x) is a particular case of (7.4). Let us check it now when σ > 0: where we integrated qW q (x) = G (W q ) (x) with G given in (2.4), and used Fubini, integration by parts, and (3.9).

Remark 5.3. For Brownian motion, (5.4) yields
Recall that the Esscher transform refers to an exponential change of measure using the martingale e θXt−κ(θ)t , t ≥ 0. For each θ in the domain of κ(·), the process X remains in the class of spectrally negative Lévy processes, is characterized by the Laplace exponent κ(· + θ) − κ(θ), and W denote the scale functions of X under this change of measure. 13 Remark 5.5. It is easy to check by taking Laplace transform [108,125] that the convolution of two W scale functions satisfies the equation The analogue formula for the convolution of two Z scale functions is more complicated. When σ = 0, it holds that However, the convolution of W and Z is again simple ( [12], Lem. 4.1) The history of Z. The second scale function Z q (x) was introduced in the thesis of M. Pistorius (which the first author codirected with A. Kyprianou), as a means of expressing in a simpler way both the results of [42,142] and some new results involving reflected processes and drawdown stopping (used "Russian options"). See (6) in [22] for the first published reference. Its importance became clearer after its further use in [62,88,119,[125][126][127].
By some historical error, all these papers, as well as the textbook [94], omitted the information that the "birth certificate" of the function Z was signed in the thesis of Pistorius and in [22]. Instead, reference was made to the pioneering work [42], which however contains no Z function.
The three variables extension Z q (x, θ) was introduced essentially in [22] as an Esscher transform of Z q (x)see Remark 5.4. Then, the simultaneous papers [78] and Corollary 5.9 in [32] (first submitted in 2011, ArXiv 1110.4965) proposed the direct definition (5.2), without the Esscher transform from previous papers.
Subsequently, Z q (x, θ) was shown in Theorem 5.3, Corollary 5.9 in [32] to be a particular case of a "smooth Gerber-Shiu function" ( [32], Def. 5.2) associated to an exponential payoff e θx . More precisely, Z q (x, θ) is the unique "smooth" solution of where G is the Markovian generator (2.4) of the process X t -see (1.12), (5.23), Section 5 in [32] and Section 7.
Z q (x, θ) was used first as generating function for the smooth Gerber-Shiu functions associated to power rewards 1, x, x 2 , which were denoted respectively by Z q , Z (1) q , Z (2) q , . . . . Subsequently, it started being used intensively in exponential Parisian ruin problems following the work of [12].
As of recently, several papers [4,12,20,31,33,78,79,81,86] showed that Lévy formulas expressed in terms of W q (x) and Z q (x) or Z q (x, θ) hold also for doubly reflected processes, 14 refracted processes, spectrally negative Markov additive processes , processes with Parisian absorption or reflection, and combinations of these features. More precisely, formulas which hold for the Lévy model continue to hold for the others, once appropriate (matrix) scale functions are identified.
We will call this body of related first passage formulas the scale functions kit or cookbook. Its availability means that the analytic work required to solve a first passage problem may often be replaced by looking up in the cookbook. The next section contains ten of our favorite recipes.

Ten first passage laws
We will start with the easiest problem, which involves only W q (·).

Expected discounted dividends
We review now expected discounted dividends U under both reflection and absorption regimes. These are especially important in the control of reserves processes -see Section 9.
where E |0,b] denotes the law of the process reflected from above at b, and absorbed at 0 and below. B) The expected total discounted dividends over an infinite horizon for the doubly reflected process, with expectation denoted E [0,b] , are given by ( [31], (4.3)) by the smooth-exit law (3.5), the essential part is proving the result for where the latter (excursion theoretic) quantity has already been introduced in Remark 3.3. For the Cramér-Lundberg case, a direct computation of V b] (b) is provided in Lemma 6.4 in [93]; for the spectrally negative case, a generalization to all moments of the discounted dividends (using excursion theory) may be found in Theorem 10.3 in [94].
To see the idea behind the excursion theory proof, note, following [6], that Finally, the law of variable U T b] 0 ∧eq |x = b is exponential with parameter ν q (b), cf. Remark 3.3 (see also Thm. 6.8 A) below for a generalization). B) Again, it is enough to prove the result for x = b, since It turns out that for x = b, the variable U eq under the measure E , yielding the result (see Thm. 6.13 and Rem. 6.14 below for a generalization and further references).
requires excursion theory, one might try to establish instead the simpler boundary condition on the derivative which says roughly that 1. Let us start with the Cramér-Lundberg model, and follow the derivation suggested in [70], which note that when starting from b − , no dividends are gained during a period of c , while when starting from b, dividends roughly equal to c c = are gained during this period. More precisely, construct the processes starting from b and b − on the same probability space, and let A denote the event that there is no jump in the interval [0, /c]. Over this event, the processes are coupled at time c and the only difference between the dividends comes from the interval [0, /c]. Putting now together the contribution over A and over its complement yields: where we used the increasingness and locally Lipschitz property of the value function [139]  We turn now to the spectrally negative Lévy model. Armed with our two exit laws, we find: and we fall back on the problem of tackling V b] (b), suggesting that the boundary condition is not trivial and that the use of excursion theory (see [43]) is unavoidable in general. Note however that the perturbed Cramér-Lundberg model was solved in [96], via a perturbation approach.
6.2. The total discounted capital injections/bailout law, with non-smooth regulation The next result [78,125] shows the importance of Z for reflected spectrally negative Lévy processes. It also provides a generalization of the fundamental survival probability formula (1.3).
Remark 6.4. Theorem 6.3 was first proved in Theorem 2 from [78] as a consequence of a more general result ( [78], Thm. 13), but we prefer to use the observation that it is essentially equivalent to (6.8) [78]. Indeed, (6.5) implies: If the first term is known one gets an equation for the deficit at ruin . And if the deficit at ruin is known, one may use (6.7) with When W q (0) = 0, one must start with a "perturbation (approximation) approach", letting x → 0 [153]-see also Section 8.1, where this result is proved directly, in the more general context of Parisian ruin.

Deficit at ruin
We turn now to problems of deficit at ruin. We will present here a generalization of the "non-smooth-exit law", featuring the Z q (x, θ) function.
Theorem 6.5. Deficit at ruin for a process absorbed or reflected at b > 0.
A) The joint Laplace transform of the first passage time of 0 and the undershoot for a process absorbed at b > 0 is given by ( [32], Prop. 5.5; [78], Cor. 3; [12], (5)) B) The joint Laplace transform of the first passage time at 0 ("reflected ruin time", see (4.3)) and the undershoot in the presence of reflection at a barrier b ≥ 0 is ( [32],Prop. 5.5; [78], Thm. 6) Proof sketch. A) is a consequence of the harmonicity/q-martingale property of Z q (X t , θ), and of the boundary condition it satisfies (5.10). Indeed, stopping the martingale e −qt Z q (X t , θ) at min(T b,+ , T 0 ) yields Note also that using another (less smooth) harmonic function with the same boundary condition, necessarily of To determine k, we need to use either the (non-trivial) boundary condition Ψ b] q,θ (b) = 0 or the final value The latter has been established in the related drawdown literature -see (6.17) and Theorem 6.7 for a generalization and further references.
Turning now to the Laplace transform of the hitting time of 0, we find that for x ≥ 0, (alternatively, this formula may be obtained by a martingale stopping argument, and holds for x ∈ R as well). This yields the representation of W q announced in (3.13): (6.14)

From drawdowns to the dividends-penalty law
This section and the following ones will exploit the connection between drawdown s and dividends. Namely, the law of the drawdown triple and that of the dividend triple coincide. See Figure 1 below, where the paths of the process X b] are obtained from the paths of the process X on the right by Skorokhod reflection at b. For the picture of X, we may assume that X 0 = b for simplicity, but that is not necessary. Now note that: a) the times T b] 0 and τ b coincide; b) the total regulation equals the sum of the projections on the X axis of the segments when X is at a running maximum; c) the last drop must be the same on both pictures, since no reflection occurs during the last drop.
This section reviews first the independence of the law of the supremum X τ d − x of the law of the (killed) drawdown achieved on the last downwards excursion. The former law is exponential with parameter ν q (d) = Wq(d) (recall this follows intuitively from the fact that the upward ladder process with downward excursions excised is a drift killed at rate ν q (d)). The independence is due intuitively to the fact that each time the upward ladder process reaches a new point, the search for the killing excursion larger than d starts again. Equivalently, by (6.15), the independence of the dividends until ruin and of the final deficit when starting from b follows. When starting from x < b, one gets the famous Dividends-Penalty identity first obtained in [111].
Using now the alternative interpretation furnished by (6.15) yields a powerful generalization of the deficit at ruin with reflection, Theorem 6.5 B): Thus, when starting from x = b, the dividends U T b] 0 ∧eq and the deficit at ruin X T b] 0 ∧eq are independent, with the first variable having an exponential distribution [94]. B) Furthermore ( [78], Thm. 6): Proof. A) When starting at x = b one may apply Theorem 6.7 from the drawdown literature. 20 B) Stopping at T 0 ∧ T b,+ yields that l(x) satisfies: and the result follows from part A) by easy algebra.
Remark 6.9. It is easy to check that when x = b, the transform (6.19) factorizes and we recover (6.18): The obvious nonnegativity of ∆ (ZW ) q,θ implies that the function is decreasing (other papers refer to this as the log-convexity of Z q (x)). It also implies an upper bound for the Wronskian

From bailouts to the joint dividends-bailouts law
After dividends, we now turn to bailouts as defined by L t = − min(X t , 0), and finally to their joint law.
Theorem 6.11. Bailouts until an exponential time.
q,θ,ϑ (x), the (mixed) boundary condition at x = b is now l (b) + ϑl(b) = 0; this offers another line of attack, at least in the Cramér-Lundberg case.
where we used the minimum law (4.7) and the deficit law (6.8). In the Cramér-Lundberg case when W q (0) = 0 we may plug x = 0 and conclude that The same may be shown in the general case by a perturbation argument. Plugging now l(0) yields the result A). B) Follows by adding (6.6). C) Follows by conditioning at time e q ∧ T where for the last equality we have used h (b) = 0 and the fact that for two functions f and g, f (x)/g(x) = c implies f (x)/g (x) = c. Theorem 6.13. The joint dividends-bailouts law for a process doubly reflected at 0 and b, over an exponential horizon.
The dividends-bailouts function is given by Proof. Conditioning at e q ∧ T [0 b and using Theorem 6.11 A) and Theorem 6.3 we find The value of l(b) was obtained in Theorem 1 in [7], via excursion theoretic arguments.
Remark 6.14. When θ = 0, (6.24) shows that discounted dividends starting from b over an exponential horizon, with double reflection, have an exponential law with parameter , a surprising result which seems to have gone unnoticed. Also, E Putting ϑ = 0 in (6.23) yields Theorem 6.11 C), and differentiating recovers ( [31], (4.4)) where Z q (x) is defined in (5.5).

Expected discounted bailouts
We recall now results on expected discounted bailouts until T b,+ and over an infinite horizon, which may be obtained simply by differentiating the corresponding moment generating functions in Theorem 6.11 B), C).
A) The expectation of the total discounted bailouts up to T b, B) The expected total discounted bailouts over an infinite horizon, with reflection at b are ( [31], (4.4)): G B q may also be taken to be in both results. Remark 6.16. As may be easily checked, the first expression for G B q , i.e. Z q (x), is the smooth Gerber-Shiu function (see [32] and next section), fitting the value of w(x) = x at 0, and also its derivative in the noncompound Poisson case. Without smoothness, the Gerber-Shiu function is unique only up to adding a multiple of the corresponding scale function, and simpler expressions like (6.28) may be available.
Remark 6.17. Note that several relations for the process reflected below like (6.27), and the relation [22] may be obtained formally from analog relations for the process absorbed at 0, by substituting the second scale function Z q instead of the first scale function W q .

Results obtained by differentiating the moment generating functions
We turn now to obtain the expectations of the ruin time, exit time from an interval, reflected ruin time, reflected up time and recovery after ruin time, obtained by differentiating the respective moment generating functions (6.11), (4.7), (6.9), (6.6), (6.14) with respect to q (making use of the analyticity of W q in q [94], Lem. 8.3), and putting q = 0. In the proof of B) below, we additionally use the fact that when some function f is differentiable at 0, it holds that When κ (0 + ) > 0 =⇒ Φ(0) = 0, it holds that where we used and the series expansion ( [94], (8.29)) with W * ,k (x) denoting convolution. .
Our examples show that the expected time to ruin conditioning on ruin happening is unimodular, with a unique maximum. This maximum could be viewed as a reasonable lower bound for the initial reserve, which postpones ruin as much as possible (in the worst case).
To give an idea of very recent developments in the W, Z theory, we end this section with a hitting time result which holds for certain Omega spectrally negative Markov processes as well ( [114], Cor. 1) (the proof is quite elegant). 21 This provides a third proof of the monotonicity of   ∈ (a, b), it holds that For the general result with Omega non-constant killing, it suffices to replace ω(X s )ds, where ω : R → R + is an arbitrary locally bounded nonnegative measurable state dependent discounting, to replace b − a by b, a,..., etc., and to identify the scale function W ω [104,114] -see also Section 8.2.

Smooth Gerber-Shiu functions:
When e θX T 0 is replaced in the previous formulas (6.8), (6.9) by an arbitrary penalty function w(X T0 ), w : (−∞, 0] → R, extensions of these formulas still hold for if one replaces Z q (x, θ) by an infinite horizon Gerber-Shiu penalty function Indeed, applying the strong Markov property at T b,+ immediately yields Note that V(x) is not unique: it may be replaced in the identity above by adding to it any multiple of W q (x) ( [32], Prop. 5.4). For this reason, Theorem 5.3 in [32] identify the unique "smooth Gerber-Shiu function" G ( [32], Def. 5.2), which exists if w satisfies some minimal integrability conditions. Under these, given 0 < b < ∞, x ∈ (0, b), there exists a unique smooth function G = G q so that the following hold: Stated informally, both problems above admit decompositions involving the same "non-homogeneous solution" G.
The "smoothness" required is: Under these conditions, the function G is unique. Furthermore, it may be represented as ( [32], (5.13) Lem. 5.6): is the expected liquidation cost conditioned on a pre-ruin position of y, with ruin causing jump bigger than y. The second equality follows by using (5.4).
Proposition 7.2. For w(x) = e θx , the Gerber-Shiu function is Z q (x, θ) and the decomposition (7.4) becomes: This may be easily checked by taking Laplace transforms, since

Poissonian/Parisian detection of bankruptcy/insolvency, and occupation times
A useful type of models developed recently [5,12,33] assume that insolvency is only observed periodically, at an increasing sequence of Poisson observation times T λ = {t i , i = 1, 2, ...}, the arrival times of an independent Poisson process of rate λ, with λ > 0 fixed. 22 The analog concepts for first passage times are the stopping times Under Parisian observation times, first passage is recorded only when the most recent excursion below a/above b has exceeded an exponential random variable e λ of rate λ. We use here the same notation as for classic first passage times (which correspond to the case λ = ∞).
Remark 8.1. We will refer to stopping at T 0,− as (exponential) Parisian absorption. A spectrally negative Lévy processes with (exponential) Parisian reflection below 0 may be defined by pushing the process up to 0 each time it is below 0 at an observation time t i . In both cases, this will not be made explicit in the notation; classic and Parisian absorption and reflection will be denoted in the same way. Note that the case λ → 0 corresponds to complete leniency; default is never observed. We see thus that Parisian inspection is an intermediate situation between continuous inspection and no inspection, and can help to render modelling more realistic.
It was recently observed that the classic first passage laws listed above hold with a "Parisianly observed" lower boundary, once W q , Z q are replaced by appropriate generalizations, defined by [20,33]: with the value for θ = Φ(q + λ) being interpreted in the limiting sense. 23 Remark 8.2. Exponential Parisian detection below 0 is related to the Laplace transform of the total "occupation time spent in the red" a fundamental risk measure studied by [103,123,154]. Indeed, the probability of Parisian ruin not being observed (and of recovering without bailout) when κ (0 + ) > 0 is ( [106], Cor. 1,Thm. 1; [12], Eq. (11)) When x = 0, this reduces to a quantity which could be viewed as a model dependent extension of the profit parameter κ (0 + ), measuring the profitability of a risk process. Note that κ (0 + ) Φ(λ) λ furnishes also the Laplace transform of six other remarkable random variables besides T <0 , by the "Sparre-Andersen identities" due to Proposition 1.1, (2) in [82]. Differentiating (8.5) with respect to λ when κ (0 + ) > 0 shows that the Sparre-Andersen-Ivanovs variables have all expectation − Φ (0) 2 = κ (0) (κ (0)) 3 , a quantity which appeared already in several previous computations.
The following proposition lists some basic first passage results for processes with Parisian detection of ruin, reflected or absorbed, following [12,33,40]. Note that these results coincide with the ones with classic, "hard" detection of ruin, and imply them when λ → ∞. Theorem 8.3. First passage results for processes with classic detection at a smooth boundary b > 0 and Parisian detection below 0, followed by stopping or by reflection. Let X be a spectrally negative Lévy process with Parisian detection below 0, and fix b > 0. Assuming x ∈ [0, b] and q, λ > 0, 0 ≤ θ < ∞, using the notation of Remark 3.7 and letting W q,λ (x) and Z q,λ (x, θ) be defined by (8.2), the following hold: 23 When λ → ∞, the Parisian results reduce to the classic ones, since Z q,λ (x, θ), W q,λ (x) are asymptotically equivalent to Zq(x, θ), Wq(x). The first assertion is trivial, for the second see (13.4). The notation W q,λ (x) := Φ(q+λ)−Φq λ Zq(x, Φ(q + λ)) has been chosen to emphasize that this replaces, for processes with Parisian ruin, the Wq scale function in the classic "gambler's winning" problem, and also to ensure a convenient asymptotic behavior.
0 are ( [12], Eq. (27)): B) The expected discounted dividends with reflection at 0 at Parisian times, until the total bail-outs surpass an exponential variable e θ ([4], Eq. (15)) are 3. The capital injections/bailouts law for a process with Parisian reflection at 0, until T b,+ ([33], Cor. 3.1 ii)). Let L t denote the regulator for the process with Parisian reflection at 0 and E

{0
x the expectation for such process.Then: 4. Deficit at ruin for a process absorbed or reflected at b > 0.
A) The joint Laplace transform of the Parisian first passage time of 0 and the undershoot for a process absorbed at T b,+ is given by ( [12], Eq. (15)): 24 B) The joint Laplace transform of the first passage time at 0 and the undershoot in the presence of reflection at a barrier b ≥ 0 is 6. The dividends-penalty law for a process reflected at b, with Parisian ruin is: 25 We included the second, rather complicated formula, to allow comparison with the original formula in (23) from [12]. b e θX T 0 −ϑU T 0 ; T 0 < e q (8.15) as: and (8.16) follows by simple algebra. By (8.16), U T0 and X T0 are independent when starting from b, and the former has an exponential distribution with parameter ν q,λ ( [12], (23), (26)). When ϑ = 0, this result reduces to (8.12).

7.
A) The expected total discounted bailouts at Parisian times up to T b,+ are given for 0 ≤ x ≤ b and q > 0 by ( [33], Cor. 3.2 ii)):   5) is the Parisian analog of the dividends-penalty Theorem 6.8; -(6) corresponds to the expected total discounted bailouts Theorem 6.15. One may check that  [78]. Most interesting is the problem of resolvents. One case already resolved is the resolvent density u {0 q,λ (x, y) with Parisian reflection at Poisson observation times of intensity λ, obtained in Theorem 4.1 in [132]. It is not easy to prove that their result converges when λ → ∞ to the classic one in (22), Corollary 2 in [81]. Problem 8.9. It would be interesting to generalize the W, Z formalism in a way which applies also to the case of periodic observations of the smooth boundary.
where K θ is the first time when the total bail-out exceeds an independent exponential random variable e θ . Finally, (22) in [12] extend this to the case when T b,+ is replaced by its Parisian version.
Similar results hold also for processes X b[ q (t) with δ-refraction at a fixed point b [86,90,131,134]. The scale functions are: where W q is the scale function of X t − δt. For example, by Corollary 2 in [90], it holds that

Elements of proof for Theorem 8.3
In the following, we provide some proofs for Theorem 8.3. Before that, let us record some useful preliminaries.
Proposition 8.11. For z ≤ 0, it holds that A) the "recovery before Parisian ruin" probability is

Proof.
A) The second equation follows from the first, which is just the fundamental identity (3.3) (or set z ≤ 0 in (6.14)). B) follows by the strong Markov property at T {0} , and C) follows from B).
For the third part we use Proposition 8.11 C). We find Now in the finite variation case we may substitute x = 0, and, using W q (0) > 0, conclude that l(0, b) = 1 Z q,λ (b,θ) , which yields the result.
In the infinite variation case, we may use a perturbation approach. For b > x > 0, we have We can check that e −Φ(q+λ)y W q (y)dy = e Φ(q+λ)x + o(W q (x)), and Solving now (8.24) for l(0, b) and letting x → 0+, we find again

Spectrally negative Omega pocesses
Recently, it was discovered that the classic exponential Parisian formulas may be further extended to Omega models, [10,74,104,114], in which a state-dependent rate of killing (or observation) rate ω(x) is used, where ω : R → R + is an arbitrary locally bounded nonnegative measurable function. Exponential Parisian models are just the particular case when ω(x) is a step function with two values.
Analogs of Propositions 3.2, 3.8 and of Theorems 6.5, 6.3 are provided in Theorems 2.1-2.4 in [104], who showed that the first passage theory of Omega models rests on two functions {W ω (x), x ∈ R} and {Z ω (x), x ∈ R} called ω-scale functions, which are defined uniquely as the solutions of the renewal equations: W ω (x, a) =W ω (x, a) + W ω (x, y) ( ω(y) − ω(y)) Z ω (y, a) dy. (8.28) Note that in the case of constant ω(x) = q, these reduce W q − W = qW q * W and Z q − Z = qW q * Z, (8.29) which can be easily checked by taking the Laplace transforms of their both sides and by using the expansion (6.30).

Occupation times
Here is an elegant result ( [115], Thm. 3.1) on the joint law of the occupation times above and below 0 of a spectrally negative Lévy process. Proposition 8.12. Introduce the auxiliary function ( [115], (1)) (a slight modification of which had essentially appeared already in (6) from [108]), defined for all x ∈ R and λ, q ≥ 0 by: where the second equalities hold by the convolution identity W λ * W q (x) = (5)). 27 Let L − t = t 0 1 (−∞,0) (X s )ds, L + t = t 0 1 (0,∞) (X s )ds denote the occupation times below and above 0. Then, ∀λ − , λ + > 0 and ∀x, y ∈ R it holds that Integrating the final position yields ( [115], . , (8.32) which recovers the previous result (8.31) by using lim b→∞ has been obtained in Theorem 3.3 in [138], as a direct consequence of the Gärtner-Ellis theorem, which states that this is the Legendre transform of λ(r) := lim

Optimization of dividends
Risk theory initially revolved around minimizing the probability of ruin. However, insurance companies are realistically more interested in maximizing company value than minimizing risk and an alternative approach is therefore to study optimal dividend policies, in the sense of maximizing the expected value of the sum of discounted future dividend payments until the time of ruin, as suggested by De Finetti in the 1950 [56]-see also Miller and Modigliani [117]. 27 Note that these functions satisfy ( [33], (2.18)) lim a↓−∞ W a λ,q (x) W λ (a) = Zq(x, Φ(λ)) and lim x↑∞ W a λ,q (x) Wq (x) = Z λ (a, Φ(q)).
A second interesting objective to maximize introduced by Shreve, Lehoczky and Gaver (1984) [140], is the expected discounted cumulative dividends for the reflected process obtained by redressing the reserves by capital injections, at a proportional cost, each time this becomes necessary.
These two objectives and certain generalizations are easily expressed for spectrally negative Lévy processes in terms of the scale functions W, Z (at least when restricting to barrier policies).

The de Finetti objective with Dickson-Waters modification for spectrally negative processes
This objective proposed by de Finetti (1957) [56] is to maximize expected discounted dividends until the ruin time. It makes sense to include a penalization for the final deficit [66], arriving at: Here U π t is an "admissible" dividend paying policy, and w(x) is a bail-out penalty function. 28 The most important class of policies is that of constant barrier policies π b , which modify the surplus only when X t > b, by a lump payment bringing the surplus at b, and then keep it there by Skorokhod reflection, until the next negative jump, 29 until the next claim.
Under a reflecting barrier strategy π b , the dividend part of the de Finetti objective has a simple expression (6.1) in terms of the W scale function: where E |0,b] denotes the law of the process reflected from above at b, and absorbed at 0 and below. This formula reflects the representation and the fact that the local time U t at b with reflection at b is an exponential random variable. The "barrier function" plays a central role in the solution of the problem, and the optimal dividend policy is often a barrier strategy at its maximum. In particular, when the barrier function is differentiable and has a unique local maximum b * > 0 =⇒ W q (b * ) = 0, this b * yields the optimal dividend policy. Furthermore, the value function  is then the largest concave minorant of W q (x). In the presence of several inflection points, however the optimal policy is multiband [32,35,102,139]. The first numerical examples of multiband policies were produced in [35,102], by Cramér-Lundberg model (1.1) with Erlang claims E 2,1 . However, it was shown in [102] that multibands cannot occur when W q (x) is increasing after its last global minimum b * (i.e. when no local minima are allowed after the global minimum). 30 [102] further made the interesting observation that in the Brownian perturbed Cramér-Lundberg model (2.5) with Erlang claims E 2,1 (which are non-monotone), multiband policies may occur for σ smaller than a threshold value, but barrier polices (with non-concave value function!) will occur when σ is big enough. Figure 2 displays the first derivative W q (x), for σ 2 /2 ∈ {1/2,1, 3/2, 2}. The last two values yield barrier polices with non-concave value function, due to the presence of an inflection point in the interior of the interval [0, b * ].
Even when barrier strategies do not achieve the optimum, and multi-band policies must be used instead, constructing the solution must start by determining the global maximum of the barrier function [32,35,139]. We will only consider barrier strategies in this review.
The penalty part of the objective (9.1) for a barrier strategy π b can be expressed as is the smooth Gerber-Shiu function associated to the penalty w (see Sect. 7); finally, the modified de Finetti value function is: (9.4) 30 One instance when that happens is when the Lévy measure is completely monotone. Then, (3.13) may be written as Wq(x) = Φ q e Φq x − Φ q ∞ 0 e −xt µq(dt), x ≥ 0, for some finite measure µq. This implies W q (x) ≥ 0, x ≥ 0, and implies finally that W q (x) is convex, with a unique minimum.

The corresponding barrier function is
The most important cases of bail-out costs w(x) are 1. exponential w(x) = e θx , when G w (x) = Z q (x, θ) (Prop. 7.2), and 2. linear w(x) = kx − K. For x < 0, the constants k > 0 and K ∈ R may be viewed as proportional and fixed bail-out costs, respectively. 31 In this case as well, G w (x) may be obtained by using Z q (x, θ) as generating function in θ, i.e. the coefficients of K, k in G w (x) are found by differentiating with respect to θ the Z q (x, θ) scale function 0 and 1 times respectively, and taking θ = 0. This yields where Z (1) q (x) is given by (5.6). In the simple, but important particular case w(x) = −K, the modified de Finetti value function and barrier function are respectively Remark 9.1. Optimality largely rests on the sign of the numerator For (9.7) for example, Since the excursion rate The cases k ∈ (0, 1] and k > 1 correspond to management being held responsible for only part of the deficit at ruin, and to having to pay extra costs at liquidation, respectively. When K < 0, early liquidation is rewarded; when K > 0, late ruin is rewarded. 32 Incidentally, when σ > 0, this is also implied by the creeping drawdown law [118] ( [98], (2.5)): , ∀x.
≥ 0, (9.11) denote the unique K ≥ 0 satisfying H K (b) = 0. Then, assuming complete monotonicity of the Lévy measure, Proposition 4.5 and Theorem 4.4 from [75] show that for every b ≥ b 0 K(b) is strictly increasing. Therefore, barrier policies are optimal and b yields the optimal barrier for the cost K(b) (in their paper, the parameter K intervenes as a Lagrange multiplier associated to a time constraint).

Optimal de Finetti dividends barrier until Parisian ruin
Differentiating (8.7) and using twice (5.7), we find that the optimal de Finetti dividends barrier b until Parisian ruin must satisfy (note that the same equation was obtained in [120] in the context of a different, but equivalent problem involving running costs). When λ → ∞, the LHS of (9.12) converges to W q (b) + W q (b) by (13.4). Thus, lim λ→∞ b * λ = b * , recovering the classic optimality equation.
An important case is that when the optimal dividends barrier is 0; this may be viewed as a measure of the process involved corresponding to an "efficient company" (ready to pay dividends) -see [18]. The "efficiency" condition here is see also [135].

The Shreve-Lehoczky-Gaver infinite horizon objective, with linear penalties
We turn now to an objective which was first considered in a diffusion setting by Shreve, Lehoczky, and Gaver (SLG) [140] -see also [46,113] -to be called SLG objective.
Suppose a subsidiary must be bailed out each time its surplus is negative, and assume the penalty costs are linear w(x) = kx. The optimization objective of interest combines discounted dividends U t , and cumulative bailouts L t where π is a dividend/bailout policy, and k ≥ 1. Importantly, for Lévy processes the optimal dividend/bailout policy π is always of constant barrier type [31], and the objective for fixed b has the simple expressions provided in (4.3) and (4.4) in [31] (and included above as (6.2), Thm. 6.1 and (6.27), Thm. 6.15), resulting in: 33 (9.14) with barrier function -see also Proposition 3.1 from [148] for a generalization involving fixed dividend costs K. This impulse control problem involves replacing the reflection barrier by a b 1 , b 2 band. It turns out that the value function is of the same form, but the barrier function changes, to Note that the derivation becomes simpler than in the reflection case. The next proposition merges new results from Proposition 1 in [27] with previously known results from Lemma 2 in [31]. The main object is the function , b > 0, (9.16) , if X is of bounded variation. (9.17) This function is increasing, by the well known identity ( [22], Thm. 1) 34 The monotonicity allows us to re-parametrize the problem in terms of the optimal barrier b k associated to a fixed cost k. Proposition 9.2. Assume X is a SNLP and K = 0. We have the following results: k (x) defined in (9.14) is non-increasing. 2. For k = k f (b), the value function defined in (9.14) can be written as follows: where Z q (x) is defined in (5.6), and V b] (b) is the de Finetti objective when starting at the barrier. 33 As already noted in Remark 6.17, this has the same form as the de Finetti objective (9.6) with Z replacing W . 34 Some papers refer to this as the log-convexity of Zq(x).
3. For fixed k, the barrier function H SLG k defined in (9.15) is an increasing-decreasing function with a unique maximum b k ≥ 0. Moreover, if b k > 0, then k f (b k ) = k.

Proof.
1. This is obvious since the Shreve, Lehoczky and Gaver value function (9.14) is decreasing in k, and the value function V 0,b k (x) can be seen as the maximum of E x ∞ 0 e −qt (dD t − kdC t ) over control couples (C, D) keeping the surplus in [0, b]. Since the cost functional is non-increasing in k, our assertion follows. 2. Recalling (9.14), we need to show that Indeed, it is easy to check that the equality For the sake of completeness, let us reproduce this proof from Lemma 2 in [31]. The derivative of the barrier function (9.15) satisfies (6.22)). The sign of the derivative of the barrier function (9.15) coincides therefore with that of Clearly the latter function f is decreasing in b from lim b→0 f (b) = k k0 − 1 to −1.
Remark 9.3. We may conclude therefore that if then b k = 0 is the optimal barrier, and otherwise there is a unique global and local maximum satisfying Remark 9.4. The last identity in Proposition 9.2 turns out useful in establishing the so called Lokka-Zervos alternative for Brownian motion with drift -see [113], [97] -and for the Cramér-Lundberg model with exponential jumps [27]. These results state that, depending on the size of transaction costs, one of the following strategies is optimal: 1. if the cost k of capital injections is below a critical point k c , then it is optimal to pay dividends and to inject capital, according to a double-barrier strategy, meaning that ruin never occurs; 2. if the cost of capital injections is above the critical point k c , it is optimal to use a single-barrier strategy and declare bankruptcy at the first passage below 0.
The crucial point in these two cases is that a further identity holds which allows expressing the RHS of (9.18) in terms of the W scale function, and implies where b * denotes the optimal barrier level in de Finetti's problem. More precisely, in the Brownian motion case, note the easily checked identities and use then the monotonicity of V SLG k (x) in k. Similar computations establish the Lokka-Zervos alternative in the Cramér-Lundberg case with exponential claims [27].

The dividends and penalty objective, with exponential utility
Given δ, θ, ϑ > 0, one may consider the barrier strategy obtained by minimizing the objective (6.19). Such an objective is based on exponential utility that rewards late ruin and cumulative dividends while penalizing deficit at ruin. Recall that the barrier function of (6.19) is For θ = ϑ = 0, this reduces to q , which is clearly an increasing function. For θ = 0, (6.19) reduces to a dividends and time objective, with barrier function .
(9.23) Remark 9.5. Note that this objective encourages taking dividends soon; in fact, everything is lost at e q , which must be interpreted as a catastrophic event. An alternative would be to minimize 0 ∧eq , which would also encourage taking dividends soon, but with less urgency. The optimal barrier for this last objective should increase with respect to that of (9.23).
Remark 9.6. The sign of the derivative of the barrier function (9.22) of the exponentiated dividends and time objective (9.23) is determined by Some numerical results involving the exponential utility barrier functions (6.20), (9.22) and their critical points are presented in Section 10.4. We have never found multi-modal instances, suggesting that the optimal policy is simpler to implement than that for the de Finetti objective. 35 Even after simplification this seems hard to analyze. Remark 9.7. For comparison with (9.23), consider also the linearized value function (see Thms. 6.18 C) and 6.1 A)) which needs to be maximized. The optimization (9.23) may then be viewed as a risk sensitive optimization with exponential utility e −x , applied to the random variable qT b]

Optimization of dividends for spectrally positive processes
The dividends of a spectrally positive process X t are the bailouts of its dual −X t . Furthermore, for a fixed upper barrier b, the argument x of the scale functions must be replaced by b − x. The end result for the de Finetti problem is ( [39], Lem. 2.1)
Example 10.1. Theorem 6.18 becomes with x > 0: (1) the expected time to ruin when µ < 0 is We can also check, as is well known, that the last result holds asymptotically for any Lévy process with κ (0) < 0, i.e. that lim x→∞ When µ > 0, using W * ,2 (x) = µ −2 x(1 + e −γx ) − 2 1−e −γx γ , we find that the expected time to ruin conditional on ruin occurring is: with maximum at x * = γ −1 = σ 2 2µ = κ (0) 2κ (0) . This value furnishes a reasonable initial reserve, also since it coincides with the expected global infimum of a risk process started at x * is 0. Indeed, assuming κ (0) > 0 and differentiating the Wiener-Hopf factorization Now the scale function verifies that From this, it follows that if µ > 0, then b * satisfies 5) and is explicitly given by [73] e 2b * D σ 2 Furthermore, as shown by Jeanblanc and Shiryaev [84], for µ > 0 it holds that σ 2 and this implies that π b * is the optimal strategy (among all admissible strategies).

Scale computations for processes with rational Laplace exponent
Generalizing the previous example, we now assume the Laplace exponent is a rational function and that the equation κ(θ) − q = 0 has distinct real roots λ (i) q . From the partial fraction expansion of 1/(κ(θ) − q), we easily obtain the W scale function κ(θ)−q with θ = 0. Then, from (5.4) and (5.6) For q = 0 the formulas are slightly different due to the fact that zero is one solution of κ(θ) = 0.

Cramér-Lundberg model with exponential jumps
We analyze now the Cramér-Lundberg model with exponential jump sizes with mean 1/µ, jump rate λ, premium rate c > 0, and Laplace exponent κ(θ) = θ c − λ µ+θ , assuming κ (0) = c − λ µ = 0. Let γ = µ − λ/c denote the adjustment coefficient, and let λ = λ cµ . Solving κ(θ) − q = 0 for θ yields two distinct solutions λ 2 ≤ 0 ≤ λ 1 = Φ(q) given by The W scale function and its integral are: . Using the general results of the previous example, we find By tedious simplification of (10.7), we find that Example 10.5. Theorem 6.18 becomes: , we find that the expected time to ruin conditional on ruin occurring is: with maximum at x * = 1 γ (2 − λ −1 ). This value furnishes a possible lower bound for the initial reserve, which is positive if and only if c < 2 λ µ ⇔ p < λ µ . Example 10.6. Let us recall now that the function W q (x) = H D (x) −1 is unimodal with global minimum at (3.10)). Furthermore, the optimal strategy is always the barrier strategy at level b * [31].

Numerical optimization of dividends for the Azcue-Muller example
Consider the Cramér-Lundberg model perturbed by Gaussian component, where C i are iid pure Erlang claims, E 2,1 of order n = 2 and N (λ) is an independent Poisson process with arrival rate λ. The Laplace exponent is κ(θ) = cθ − λ + λ( µ µ+θ ) 2 + σ 2 2 θ, and the equation κ(θ) − δ = 0 has four roots. In what follows, the choice of parameters will be such that these roots are distinct. Since κ is a rational function, the results of Section 10.2 can be used to obtain scale functions.
The interest in this example was awakened by Azcue and Muller [35], who showed that the barrier dividend strategy is not optimal for certain parameter values. It was shown later that this is the case when the barrier function has two local maxima, and the last one is not the global maximum -see Figure 1 in [101].
It is natural to ask whether the barrier function (6.20) can have the property of multi-modality which complicates the management of dividends. We did not find any such example in our experiments presented below.  We present now some numerical experiments using a choice of parameters close to [101], namely µ = 1, λ = 10, c = 107 5 and q = 1 10 . We consider σ = 1.4 and σ = 2 as given in [101]. Note that, with these choice of parameters and in the absence of Brownian component, this example corresponds to the example given by Azcue and Muler [35] for which sufficient conditions for optimal barrier strategy do not hold.
Concerning the performance of barrier strategies under the model given above, see Figures 3 and 4, where we provide typical plots of the barrier function (6.20) of (6.19), for different values of ϑ > 0, q > 0, θ < 0. Recall that, for θ = 0, (6.20) reduces to (9.22) which is the barrier function of (9.23). Furthermore, plots of (9.22) are presented in Figures 5 and 6.

Strong Markov processes with generalized drawdown stopping
In this section, X t will denote a one dimensional strong Markov process without positive jumps, defined on a filtered probability space (Ω, {F t } t≥0 , P ).
Since many results for spectrally negative Lévy and diffusion processes require not much more than the strong Markov property, it was natural to attempt to extend such results to spectrally negative strong Markov processes. As expected, everything worked out almost smoothly for "Lévy -type cases" like random walks [19], Markov additive processes [78], Lévy processes with Ω state dependent killing [78], and there are also some results for the more challenging case of Lévy processes with state dependent drift [55]. In fact, the existence of some functions W, Z satisfying (1.3), (1.11) is clear in general, by smooth crossing and the strong Markov property. However, prior to the pioneering [100], the classic and drawdown first passage literatures were restricted mostly to parallel treatments of the two particular cases of diffusions and of spectrally negative Lévy processes. [100] showed that a direct unified approach (inspired by [95] in the case of diffusions) may achieve the same results for all time homogeneous Markov processes.
The crux of the approach is to replace W, Z in the state dependent case by differential versions ν and δ, which were denoted in [100] by b, c, in the context of the study of drawdowns. Later, in [30], they were extended to generalized drawdown times (which include first passage times). As will be clear from the discussion below, ν and δ capture the behavior of excursions of the process away from its running maximum. Note however that ν is a measure, and determining when it admits a density requires quite different technical treatments for spectrally negative Lévy and diffusion processes (see for example Lem. 8.2 in [94] which relates this to the challenging issue of the differentiability of W q ); note also that computing W, Z, ν, δ is still an open problem, even for simple classic processes like the Ornstein-Uhlenbeck process and the Feller branching diffusion with jumps. [100] (and [30]) cut through this Gordian node by restricting to processes for which the limits defining ν, δ exist -see Assumptions (11.14), (11.15), and leaving to the user's responsibility to check this for their process; they also showed that the known results for diffusions and spectrally negative Lévy processes were just particular cases of their general formulas -see Section 11.3.
The results of [30,100] provide a unifying umbrella for Lévy processes, diffusions, branching processes (including with immigration), logistic branching processes, etc., under the caveat that beyond the Lévy and diffusion cases, the user must establish the validity of Assumptions (11.14), (11.15) and manage computing ν, δ.
The end result is that for non-homogeneous spectrally negative Markov processes with classic first passage stopping we may provide extensions of the two-sided exit equalities (1.3), (1.4) and similar, involving now scale functions with one more variable For diffusions for example, W q (x, a) is a certain Wronskian (see [47]) and for Langevin type processes with decreasing state-dependent drifts, W q (x, a) solves a certain renewal equation [55]. So, formally the spectrally negative Markov case is similar to the Lévy one, up to adding one variable to the fundamental functions. Extensions to drawdown stopping are possible as well [30,100], but they are easier to state in terms of differential exit parameters ν, δ defined in (11.14), (11.15) below. Before reviewing these extensions, we will introduce some objects of interest via an illustrative example of first passage problem for (X, Y ), with Y a drawdown process. In this case, simple geometric arguments (see Fig. 7) reduce the computation of Laplace transforms of exit times of (X, Y ) from rectangles to those of simpler Laplace transforms defined in (11.7), (11.9), which seem to be fundamental to this setup.

Joint evolution of a strong Markov process and its drawdown in a rectangle
In order to study the process (X, Y ), it is convenient to start with its evolution in a rectangular region A sample path of (X, Y ), where X is chosen to be the standard Brownian motion, and the region R is depicted in Figure 7. Remark 11.1. As suggested by Figure 7, the study of the process (X, Y ) may be reduced to one-dimensional problems: 1. On the y = 0 axis, we observe the maximum process X. If furthermore downward excursions are excised, we obtain the so-called upward ladder process X(m) = m (the maximum studied as a function of itself), which is of course Markovian with generator ∂ ∂m . If furthermore time killing is present, X(m) becomes a killed drift subordinator, with Laplace exponent κ(s) = s + Φ q (as a consequence of the Wiener-Hopf decomposition [94]). Figure 7. A sample path of (X, Y ) (sampled at time step ∆t = 0.1) when X is a standard Brownian motion with X 0 = 0.2, and the region R with d = 10, a = −6 and b = 7. The dark boundary shows the possible exit points of (X, Y ) from R. The base of the red line separates R in two parts with different behavior.
2. Away from the boundary y = 0, the process oscillates during negative excursions from the maximum on line segments l Xt where, for c ∈ R, l c := {x ∈ R × R + : x 1 + x 2 = c}. Since X t is fixed during such an excursion, we are dealing here essentially with the process −X t . 3. If the first excursion outside the rectangle kills the process, the ladder process becomes a killed drift with generator Gφ(m) := φ (m) − ν q (d)φ(m) [11,34], since the killing excursions are a Poisson process with rate ν q (d). 4. With generalized drawdown defined in the next subsection (when the upper boundary is replaced by one determined by certain parametrizations ( d(m), d(m)), d(m) = m − d(m)), the generator of X m will have state dependent killing: 5. Finally, in the spectrally negative Markov case, the generator becomes: where the killing rate ν q (m, y)| y= d(m) (11.4) depending of both the current position and the killing limit y = d(m) is defined in (11.14) below.
The fact that many functionals (ruin, dividends, tax, etc.) of the original process may be expressed as functionals of the killed ladder process explains the prevalence of first order ODE's related to the generator (11.2) when working with spectrally negative processes.
We see from the remarks above that ν q may serve as a more convenient alternative characteristic of a spectrally negative Markov process, replacing W q , and that it may be used also in the case of generalized drawdown killing.
Define now Several implications for T R are immediately clear from these dynamics: for example, the process (X, Y ) can leave R only through ∂R ∩ {x ∈ R × R + : x 1 ≤ b − d} or through the point (b, 0) (see the shaded region in Fig. 7). Also, Here it suffices to apply the spectrally negative drawdown formulas provided in [99,118]. 3. In the remaining case x ≤ a + d ≤ b, both drawdown and classic exits are possible. For the latter case, see Figure 7. The key observation here is that drawdown [classic] exit occurs if and only if X t does [does not] cross the line x 1 = d + a. The final answers will combine these two cases.
Two natural objects of interest in "mixed drawdown /first passage " control over the rectangle are the "two-sided exit" times τ b,d = min(τ d , T b,+ ), τ a,d = min(τ d , T a,− ).
In terms of the two dimensional process t → (X t , Y t ), these are the first exit times from the regions (−∞, b) × [0, d] and (a, ∞) × [0, d].
We introduce now two Laplace transforms U bD/DbU (standing for up-crossing before drawdown/drawdown before up-crossing) involving the "two-sided exit" times, which are analogues of the killed survival and ruin probabilities: (11.5) By using U bD/DbU we provide now Laplace transforms of T R and of the eventual overshoot at T R . One can break down the analysis of T R to nine cases, depending on which of the three exit boundaries T a,− , T b,+ or τ d occurred, and on the three relations between x, a, b and d described above. The results are then the immediate applications of the strong Markov property.
Proposition 11.2. Consider a spectrally negative Markov process X with differentiable scale function W q . Then, for d ≥ 0 and a ≤ x ≤ b, we have: Proof. Note that in the third column the d boundary is invisible and does not appear in the results, and in the first column the a boundary is invisible and does not appear in the results. These two cases follow therefore by applying already known results. The middle column holds by breaking the path at the first crossing of a + d. The main points here are that 1. the middle case may happen only if X t visits a before a + d; 2. the first case (exit through b) and the third case (drawdown exit) may happen only if X t visits first a + d, with the drawdown barrier being invisible, and that subsequently the lower first passage barrier a becomes invisible.
The results follow then due to the smooth crossing upward and the strong Markov property.
We will leave open the question of how to compute the drawdown functions U bD/DbU until Section 11.3 where we will consider more general drawdown boundaries. However, we note here that for spectrally negative Lévy processes they have simple formulas. In the Lévy case for example where δ q,θ (d) is given by (6.17). Integrating (6.16) yields δ q,θ (d). (11.9) Note that the fundamental law reflects the independence of the path before the last maximum and after, conditional on the value of the last maximum. The exponential law of the last maximum is due to the Lévy setup, and will be lost in the Markov case, where it will be replaced by the law of the first arrival in a "nonhomogeneous Poisson process of killing excursions".

Generalized drawdown stopping for processes without positive jumps
Generalized drawdown times appear naturally in the Azema-Yor solution of the Skorokhod embedding problem [37], and in the Dubbins-Shepp-Shiryaev, and Peskir-Hobson-Egami optimal stopping problems [65,67,76,122]. Importantly, they allow a unified treatment of classic first passage and drawdown timessee [34,110] (see also [30] for a further generalization to taxed processes). The idea is to replace the upper side of the rectangle R by a parametrized curve where s = x 1 + x 2 represents the value of X t during the excursion which intersects the upper boundary at (x 1 , x 2 ) (see Fig. 8). Alternatively, parametrizing by x yields (note Definition 11.4. [37,110] For any function d(s) > 0 such that d(s) = s − d(s) is nondecreasing, a generalized drawdown time is defined by (11.10) Such times provide a natural unification of classic and drawdown times. Introduce to be called drawdown type process. Note that we have Y 0 = − d(X 0 ) < 0, and that the process Y t is in general non-Markovian. However, it is Markovian during each negative excursion of X t , along one of the oblique lines in the geometric decomposition sketched in Figure 7.
Example 11.5. With affine functions we obtain the affine drawdown/regret times studied in [34]. Affine drawdown times reduce to a classic drawdown time (1.10) when ξ = 1, d(s) = d, and to a time of first passage below a level when ξ = 0, d(s) = −d, d(s) = s + d. When ξ varies, we are dealing with the pencil of lines passing through (x, y) = (−d, d). In particular, for ξ = 1 we obtain an infinite strip, and for ξ = 0, d = 0, we obtain the positive quadrant (this case corresponds to the classic ruin time).
One of the merits of affine drawdown times is that they allow unifying the classic first passage theory with the drawdown theory [34]. A second merit is that they are optimal for the variational problem considered below.
Introduce now generalized drawdown analogues of the drawdown survival and ruin probabilities (4.9), for which we will use the same notation: An extension of Theorem 11.2 to generalized drawdowns is straightforward: Proposition 11.6. Consider a spectrally negative Markov process X with differentiable scale function W q . Then, for a ≤ x ≤ b and d(·) satisfying the conditions of Definition 11.4, we have: Ex e −qT a,− +θ(X T a,− −a) ; Ta,− ≤ min(τ d(·) , T b, 11.3. First passage theory for upwards skip-free Markovian processes: ν and δ replace W, Z In this section, we review the functions ν q , δ q,θ , essentially differential versions of the scale functions W q , Z q of spectrally negative Lévy theory, which serve to extend the spectrally negative Lévy theory to the spectrally negative Markov case. They were first constructed in [95,100], via an "infinitesimal decomposition" approach into two sided infinitesimal exit problems for X t out of intervals [x − d, x + ]. It was later observed in [30] that using intervals [x − d(x), x + ] allows extending this to the framework of generalized drawdown /Azema-Yor times -see Figure 8.
The key step is assuming the existence of differential versions of the ruin and survival probabilities (1.3), (1.4): Assumption 11.7. For all q, θ ≥ 0 and y ≤ x fixed, assume that Ψ b q (x, y) and Ψ b q,θ (x, y) are differentiable in b at b = x, and in particular that the following limits exist: (total infinitesimal hazard rate) (11.14) and δ q,θ (x, y) := lim ε↓0 Ψ x+ε q,θ (x, y) ε (infinitesimal spatial killing rate) (11.15) Remark 11.8. It turns out that everything reduces to the differentiability of the two-sided ruin and survival probabilities as functions of the upper limit. Informally, we may say that the pillar of first passage theory for spectrally negative Markov processes is proving the existence of ν, δ.
A necessary condition for Assumption 11.7 to hold is that, In other words, X must be upward regular 37 and upward creeping at every x ∈ R. Assumption 11.7 holds for processes X that are upward skip-free.
Assuming the existence of the limits in Assumption 11.7, ([100], Eq. (3.2), Thm. 3.1, Cor. 3.1) show how to compute the first passage functions from their differential versions. The extension of this result with generalized drawdown times is ( [30], Thm. 1): Proposition 11.10. Consider a Markov process X such that Assumption 11.7 holds. Assume d(·) satisfies the conditions of Definition 11.4, and q, θ ≥ 0, b ∈ R.
Remark 11.11. We view differential equations like (11.17), (11.19) as the fundamental object of spectrally negative first passage theory, due to their probabilistic interpretation as Kolmogorov equations of the upward ladder process with excised negative excursions.
Remark 11.12. In the spectrally negative Lévy case, (11.16) reduces by using (3.6) to Wq (d(s)) ds , and (11.18) becomes Furthermore, if we have classic drawdown d(s) = d ≥ 0, then we obtain (11.7) and (11.9) We may also express Proposition 11.10 in terms of a generalized W, Z basis.
Remark 11.13. (1) Introducing for some arbitrary a ≤ x, we may rewrite (11.16) as . (11.21) (2) We may rewrite (11.18) in an alternative form θ). (11.22) where we put δ q,θ (x, y) := δ q,θ (x,y) νq(x,y) and Remark 11.14. Note that while ν, δ are just functions of two variables, in the drawdown framework W and Z are functionals of the initial position and of the drawdown function d(·).
Proof. B) It may be checked that substituting Z q,d(·) (x, θ) given by the first equality in (11.23) into (11.22) yields W q,d(·) (s) ds; but this is just an alternative way to express the solution of the ODE (11.19), obtained by an integration by parts.
Remark 11.15. With classic first passage stopping d(x) = a, and we obtain with scale functions involving now just the variable a (the non-smooth first passage end), which reduce to the classic Lévy formulas upon replacing (x, a) by x − a.
Remark 11.17. Recall now that in the Lévy context, the second scale function Z [22,78,125] may also be defined via the solution of the non-smooth total discounted "regulation"/capital injections problem. Let X [d(·) t = X t + L t denote the process X t modified by Skorokhod reflection at d(·), and let E

Optimal dividends problem with generalized drawdowns
Let T d(·) = τ d(·) ∧ T a,− denote the first passage time either below a, or below the drawdown boundary for the process X b] t reflected at b with regulator U t . One can consider the extension of de Finetti's optimal dividend problem (6.1) e −qt dU t (11.27) where V depends now also on the function d(·). 38 By the strong Markov property, it holds that (11.28) Remark 11.18. The function v(b) represents the expected discounted time until killing for the reflected process, when starting from b. This equals the time the process reflected at b spends at point (b, 0) in Figure 8, before a downward excursion beyond d(b) kills the process. Furthermore, this time is exponential with parameter ν q (b, d(b)) (as a consequence of the fact that the drawdown process away from a running maximum is Markovian and the corresponding process of upward excursions is Poisson, just as in the Lévy case). Thus, the expectation is the reciprocal of ν q (b, d(b)), and v(b) = ν q (b, d(b)) −1 = W q,d(·) (b) W q,d(·) (b) .
The problem of choosing a drawdown boundary to optimize dividends in (11.30) is tackled in [16] via Pontryaghin's maximum principle. The result depends of course of the process considered, but it always must use one of two types of segments: "de Finetti segments" of maximal slope, of direction ( d (s), d (s) = (0, 1) and segments along which the equation ∂ 2 ν q (s, d(s)) = const (11.31) is satisfied.
We may obtain in this case a more precise version of Proposition 11.6. Note first that when a + h(a) > b, the drawdown constraint is invisible. The value function (11.27) is therefore  B) The barrier influence function (which must be optimized in b) in the case a + h(a) ≤ x is (11.34) The critical points b * for fixed d, ξ satisfy 39 For local maxima at b * > 0 to exist, it is necessary that W q Wq (W q ) 2 (0) + ξ 1−ξ < 0 and that W q W q W q + W q W q 2 − 2W q W q 2 (d(b * )) > 0. 39 When ξ = d = 0, we recover in the compound Poisson case the equation W q (b) = 0.

Proof.
A) The first case, in which barrier a is invisible, holds by Theorem 1.1 in [34] (by plugging there γ = 0). 40 The second case holds by the strong Markov property. Note that until X t visits a + h(a), the upper drawdown barrier is invisible, and the classic formula for smooth passage applies. Subsequently, we are in the first case, with starting point x = a + h(a), applying the first case and using d(a + h(a)) = h(a) (see Fig. 8).
B) For the critical points, note that the sign of −BI coincides with that of W q Wq (W q ) 2 (d(b)) + ξ 1−ξ , and that W is positive. Also, the "de Finetti solution" ξ = 0 always beats ξ > 0 at equal d, due to the singularity of BI(b) (11.34) at 0 when ξ > 0, which makes immediate stopping optimal. Since W q (d) is increasing, it follows that without extra constraints, with affine drawdown boundary, the optimal solution is trivially d = ∞, ξ = 0 ⇔ b * = 1, V b * ] (x) = ∞. Other solutions become thus of interest only under a constraint d(a) ≤ d 0 .
Furthermore, ξ > 0 becomes interesting once an upper bound on the derivative d (s) or on the total "regret/risk area" is placed -see Figure 8.
Let us provide an example.
Example 11.22. Brownian motion Consider Brownian motion with drift X(t) = σB t + µt and affine drawdown stopping. The scale function W q is given in (10.1).
Solving the quadratic equation implies that b * satisfies which reduces when ξ = 0 to (10.5).

Chronology
A) Ruin theory for the Cramér-Lundberg or compound Poisson risk model was born in Lundberg's treaty [109]. B) The extension to the Lévy case was achieved in the landmark paper "Problem of destruction and resolvent of a terminating process with independent increments", where the formula q (x, a) = E x e −qT b, for the "smooth" two-sided exit problem (TSE) ( [142], Thm. 3) is provided. 41 The Laplace transform of W q was computed in (33) from [142]. Also, Theorem 2 from [142] provided the formula of the resolvent density for the process killed outside an interval [a, b]. 42 C) [42, (4)-(7)] introduced the notation W q and the name scale function for spectrally negative Lévy processes. The central object of the paper is now W q (instead of Suprun's resolvent). Probabilistic proofs of other problems are provided, by reducing them to smooth TSE. The non-smooth two-sided first passage problem is solved in Corollary 1 from [42], and Theorem 2 from [42] determined the decay parameter λ of the process killed upon exiting an interval, and showed that the quasi-stationary distribution is W −λ . The subsequent landmark textbook [43] offers a comprehensive treatment of Lévy processes, including the beautiful excursion theory. D) A first treatment of the optimal discounted dividends problem in the classical compound Poisson model can be found in Section 6.4 of Buhlmann (1970) [49]. The resulting formula Wq(b) W q (b) for dividends at b, when starting from b, is a consequence of the fact that the discounted dividends have an exponential law of rate [111] studies the Gerber-Shiu function (a generalization of the ruin probability) for a compound Poisson process with a constant barrier and discovers the "dividends-penalty" identity connecting it to the scale function, denoted by h, and to the Gerber-Shiu function without barrier. F) [22] introduced the second scale function Z q , initially for relating to W q the solution of the ruin problem X t = inf 0≤s≤t X s , X t = sup 0≤s≤t X s , infimum and supremum processes (1.7) L drawdown and draw-up processes (1.8), (1.9) κ(θ), Φ(q), W q (x), Z q (x, θ), W q,λ (x), Z q,λ (x, θ) Levy exp.  = Z q (x − a, θ) Z q (b − a, θ) discounted cumulative bailouts (1.11), (6.6) Shreve-Lehoczky-Gaver objective (9.14) U bD b q, d(·) (x) = E x e −qT b,+ ; T b,+ ≤ τ d(·) up before drawdown (11.12) DbU b q,θ, d(·) (x) = E x e −qτ d(·) −θ Yτ d(·) ; τ d(·) < T b,+ drawdown before up (11.13) 13.1. A summary of asymptotic relations for spectrally negative Lévy processes 1. When κ (0 + ) > 0, Φ q is the asymptotically dominant singularity of W q (x) ∼ e xΦq κ (Φq) = Φ (q)e xΦq as x → ∞. Furthermore, by (3.13) W q (x) = Φ (q)e Φqx − u q (−x). 2. Recalling Z q (x, θ) = (κ(θ) − q) ∞ 0 e −θy W q (x + y)dy (5.1), it follows that When θ = 0, this yields 3. Recalling Z q (x, θ) = κ(θ)−q θ−Φq W q (x) + Ψ q,θ (x) (5.1), it follows that