Paul Gassiat

Fausto Gozzi

Huyên Pham

Investment/consumption problem in illiquid markets with regimes switching

Keywords: Optimal consumption, liquidity effects, regime-switching models, viscosity solutions, integro-differential system MSC Classification (2000) : 49K22, 49L25, 60J75, 91B28, 93E20

We consider an illiquid financial market with different regimes modeled by a continuous-time finite-state Markov chain. The investor can trade a stock only at the discrete arrival times of a Cox process with intensity depending on the market regime. Moreover, the risky asset price is subject to liquidity shocks, which change its rate of return and volatility, and induce jumps on its dynamics. In this setting, we study the problem of an economic agent optimizing her expected utility from consumption under a nonbankruptcy constraint. By using the dynamic programming method, we provide the characterization of the value function of this stochastic control problem in terms of the unique viscosity solution to a system of integro-partial differential equations. We next focus on the popular case of CRRA utility functions, for which we can prove smoothness C 2 results for the value function. As an important byproduct, this allows us to get the existence of optimal investment/consumption strategies characterized in feedback forms. We analyze a convergent numerical scheme for the resolution to our stochastic control problem, and we illustrate finally with some numerical experiments the effects of liquidity regimes in the investor's optimal decision.

Introduction

A classical assumption in the theory of optimal portfolio/consumption choice as in Merton [START_REF] Merton | Optimum consumption and portfolio rules in a continuous-time model[END_REF] is that assets are continuously tradable by agents. This is not always realistic in practice, and illiquid markets provide a prime example. Indeed, an important aspect of market liquidity is the time restriction on assets trading: investors cannot buy and sell them immediately, and have to wait some time before being able to unwind a position in some financial assets. In the past years, there was a significant strand of literature addressing these liquidity constraints. In [START_REF] Rogers | A simple model of liquidity effects[END_REF], [START_REF] Matsumoto | Optimal portfolio of low liquid assets with a log-utility function[END_REF], the price process is observed continuously but the trades succeed only at the jump times of a Poisson process. Recently, the papers [START_REF] Pham | A model of optimal consumption under liquidity risk with random trading times[END_REF], [START_REF] Cretarola | Optimal consumption policies in illiquid markets[END_REF], [START_REF] Gassiat | Optimal investment on finite horizon with random discrete order flow in illiquid markets[END_REF] relax the continuous-time price observation by considering that asset is observed only at the random trading times. In all these cited papers, the intensity of trading times is constant or deterministic. However, the market liquidity is also affected by long-term macroeconomic conditions, for example by financial crisis or political turmoil, and so the level of trading activity measured by its intensity should vary randomly over time. Moreover, liquidity breakdowns would typically induce drops on the stock price in addition to changes in its rate of return and volatility.

In this paper, we investigate the effects of such liquidity features on the optimal portfolio choice. We model the index of market liquidity as an observable continuous-time Markov chain with finite-state regimes, which is consistent with some cyclicality observed in financial markets. The economic agent can trade only at the discrete arrival times of a Cox process with intensity depending on the market regimes. Moreover, the risky asset price is subject to liquidity shocks, which switch its rate of return and volatility, while inducing jumps on its dynamics. In this hybrid jump-diffusion setting with regime switching, we study the optimal investment/consumption problem over an infinite horizon under a nonbankruptcy state constraint. We first prove that dynamic programming principle (DPP) holds in our framework. Due to the state constraints in two dimensions, we have to slightly weaken the standard continuity assumption, see Remark 3.1. Then, using DPP, we characterize the value function of this stochastic control problem as the unique constrained viscosity solution to a system of integro-partial differential equations. In the particular case of CRRA utility function, we can go beyond the viscosity properties, and prove C 2 regularity results for the value function in the interior of the domain. As a consequence, we show the existence of optimal strategies expressed in feedback form in terms of the derivatives of the value function. Due to the presence of state constraints, the value function is not smooth at the boundary, and so the verification theorem cannot be proved with the classical arguments of Dynkin's formula. To overcome this technical problem, we use an ad hoc approximation procedure (see Proposition 5.2). We also provide a convergent numerical scheme for solving the system of equations characterizing our control problem, and we illustrate with some numerical results the effect of liquidity regimes in the agent's optimal investment/consumption. We also measure the impact of continuous time observation with respect to a discrete time observation of the stock prices. Our paper contributes and extends the existing literature in several ways. First, we extend the papers [START_REF] Rogers | A simple model of liquidity effects[END_REF] and [START_REF] Matsumoto | Optimal portfolio of low liquid assets with a log-utility function[END_REF] by considering stochastic intensity trading times and regime switching in the asset prices. For a two-state Markov chain modulating the market liquidity, and in the limiting case where the intensity in one regime goes to infinity, while the other one goes to zero, we recover the setup of [START_REF] Diesinger | Asset allocation and liquidity breakdowns: what if your broker does not answer the phone?[END_REF] and [START_REF] Ludkovski | Illiquidity effects in optimal consumption-investment problems[END_REF] where an investor can trade continuously in the perfectly liquid regime but faces a threat of trading interruptions during a period of market freeze. On the other hand, regime switching models in optimal investment problems was already used in [START_REF] Zariphopoulou | Investment-consumption models with transaction fees and Markovchain parameters[END_REF], [START_REF] Sotomayor | Explicit solutions of consumption-investment problems in financial markets with regime switching[END_REF] or [START_REF] Pirvu | On investment-consumption with regime switching[END_REF] for continuous-time trading.

The rest of the paper is structured as follows. Section 2 describes our continuous-time market model with regime-switching liquidity, and formulates the optimization problem for the investor. In Section 3 we state some useful properties of the value function of our stochastic control problem. Section 4 is devoted to the analytic characterization of the value function as the unique viscosity solution to the dynamic programming equation. The special case of CRRA utility functions is studied in Section 5: we show smoothness results for the value functions, and obtain the existence of optimal strategies via a verification theorem. Some numerical illustrations complete this last section. Finally two appendices are devoted to the proof of two technical results: the dynamic programming principle, and the existence and uniqueness of viscosity solutions.

A market model with regime-switching liquidity

Let us fix a probability space (Ω, F, P) equipped with a filtration F = (F t ) t≥0 satisfying the usual conditions. It is assumed that all random variables and stochastic processes are defined on the stochastic basis (Ω, F, F, P).

Let I be a continuous-time Markov chain valued in the finite state space I d = {1, . . . , d}, with intensity matrix Q = (q ij ). For i = j in I d , we can associate to the jump process I, a Poisson process N ij with intensity rate q ij ≥ 0, representing the number of switching from state i to j. We interpret the process I as a proxy for market liquidity with states (or regimes) representing the level of liquidity activity, in the sense that the intensity of trading times varies with the regime value. This is modeled through a Cox process (N t ) t≥0 with intensity (λ It ) t≥0 , where λ i > 0 for each i ∈ I d . For example, if λ i < λ j , this means that trading times occur more often in regime j than in regime i. The increasing sequence of jump times (τ n ) n≥0 , τ 0 = 0, associated to the counting process N represents the random times when an investor can trade a risky asset of price process S.

Remark 2.1 Notice that the jumps of I and N are a.s. disjoint. Indeed, for any n,

E 1 {∆Iτ n =0} |I, τ n-1 = ∞ τ n-1 1 {∆It =0} λ It e -t τ n-1 λ Iu du dt = 0 a.s.,
since almost surely I has countably many jumps.

In the liquidity regime I t = i, the stock price follows the dynamics

dS t = S t (b i dt + σ i dW t ),
where W is a standard Brownian motion independent of (I, N ), and b i ∈ R, σ i ≥ 0, for i ∈ I d . Moreover, at the times of transition from I t -= i to I t = j, the stock changes as follows:

S t = S t-(1 -γ ij )
for a given γ ij ∈ (-∞, 1), so the stock price remains strictly positive, and we may have a relative loss (if γ ij > 0), or gain (if γ ij ≤ 0). Typically, there is a drop of the stock price after a liquidity breakdown, i.e. γ ij > 0 for λ j < λ i . Overall, the risky asset is governed by a regime-switching jump-diffusion model:

dS t = S t -b I t -dt + σ I t -dW t -γ I t -,I t dN I t -,It t . (2.1)
Portfolio dynamics under liquidity constraint. We consider an agent investing and consuming in this regime-switching market. We denote by (Y t ) the total amount invested in the stock, and by (c t ) the consumption rate per unit of time, which is a nonnegative adapted process. Since the number of shares Y t /S t in the stock held by the investor has to be kept constant between two trading dates τ n and τ n+1 , then between such trading times, the process Y follows the dynamics:

dY t = Y t - dS t S t - , τ n ≤ t < τ n+1 , n ≥ 0,
The trading strategy is represented by a predictable process (ζ t ) such that at a trading time t = τ n+1 , the rebalancing on the number of shares induces a jump ζ t in the amount invested in the stock :

∆Y t = ζ t .
Overall, the càdlàg process Y is governed by the hybrid controlled jump-diffusion process

dY t = Y t -b I t -dt + σ I t -dW t -γ I t -,I t dN I t -,It t + ζ t dN t . (2.2)
Assuming a constant savings account, i.e. zero interest rate, the amount (X t ) invested in cash then follows

dX t = -c t dt -ζ t dN t . (2.3)
The total wealth is defined at any time t ≥ 0, by R t = X t + Y t , and we shall require the non-bankruptcy constraint at any trading time:

R τn ≥ 0, a.s. ∀n ≥ 0. (2.4)
Actually, this non-bankruptcy constraint means a no-short sale constraint on both the stock and savings account, as showed by the following Lemma.

Lemma 2.1 The nonbankruptcy constraint (2.4) is formulated equivalently in the no-short sale constraint:

X t ≥ 0, and Y t ≥ 0, ∀t ≥ 0. (2.5)
This is also written equivalently in terms of the controls as:

-Y t -≤ ζ t ≤ X t -, t ≥ 0, (2.6)
τ n+1 t c s ds ≤ X t , τ n ≤ t < τ n+1 , n ≥ 0. (2.7)
Proof. By writing by induction the wealth at any trading time as

R τ n+1 = R τn + Y τn S τ n+1 S τn -1 - τ n+1 τn c t dt, n ≥ 0,
and since (conditionally on F τn ) the stock price S τ n+1 has support in (0, ∞), we see that the nonbankruptcy condition R τ n+1 ≥ 0 is equivalent to a no-short sale constraint:

0 ≤ Y τn ≤ R τn , n ≥ 0, (2.8)
together with the condition on the nonnegative consumption rate

τ n+1 τn c t dt ≤ R τn -Y τn = X τn , n ≥ 0. ( 2
H t = 1 {ζt<-Yt-or ζt>X t -} , H is predictable, so that ∀t ≥ 0, 0 = E τn≤t H τn = E t 0 H s λ
Is ds , and we deduce that H t = 0 dP ⊗ dt a.e. since λ It > 0. Moreover, since X t = X τn -t τn c s ds for τ n ≤ t < τ n+1 , the condition (2.9) is equivalent to (2.7). By rewriting the conditions (2.8)-(2.9) as Y τn ≥ 0, X τn ≥ 0, X (τ n+1 )-≥ 0, ∀n ≥ 0, and observing that for

τ n ≤ t < τ n+1 , Y t = S t S τn Y τn , X τn ≥ X t ≥ X (τ n+1 )-,
we see that they are equivalent to (2.5). ✷ Remark 2.2 Under the nonbankruptcy (or no-short sale constraint), the wealth (R t ) t≥0 is nonnegative, and follows the dynamics:

dR t = R t -Z t -b I t -dt + σ I t -dW t -γ I t -,I t dN I t -,It t -c t dt, (2.10)
where Z valued in [0, 1] is the proportion of wealth invested in the risky asset:

Z t = Yt Rt , R t > 0 0, R t = 0,
evolving according to the dynamics:

dZ t = Z t -(1 -Z t -) b I t --Z t -σ 2 I t -dt + σ I t -dW t - γ I t -,I t 1 -Z t -γ I t -,I t dN I t -,It t + ζ t R t- dN t + Z t- c t R t- dt, (2.11)
for t < τ = inf{t ≥ 0 : R t = 0}.

Given an initial state (i, x, y) ∈ I d × R + × R + , we shall denote by A i (x, y) the set of investment/consumption control process (ζ, c) such that the corresponding process (X, Y ) solution to (2.2)-(2.3) with a liquidity regime I, and starting from (I 0 -, X 0 -, Y 0 -) = (i, x, y), satisfy the non-bankruptcy constraint (2.5) (or equivalently (2.6)-(2.7)).

Optimal investment/consumption problem. The preferences of the agent are described by a utility function U which is increasing, concave, C 1 on (0, ∞) with U (0) = 0, and satisfies the usual Inada conditions: U ′ (0) = ∞, U ′ (∞) = 0. We assume the following growth condition on U : there exist some positive constant K, and p ∈ (0, 1) s.t.

U (x) ≤ Kx p , x ≥ 0.
(2.12)

We denote by Ũ the convex conjugate of U , defined from R into [0, ∞] by:

Ũ (ℓ) = sup x≥0 [U (x) -xℓ],
which satisfies under (2.12) the dual growth condition on R + :

Ũ (ℓ) ≤ Kℓ -p , ∀ℓ ≥ 0, with p = p 1 -p > 0, (2.13)
for some positive constant K. The agent's objective is to maximize over portfolio/consumption strategies in the above illiquid market model the expected utility from consumption rate over an infinite horizon. We then consider, for each i ∈ I d , the value function

v i (x, y) = sup (ζ,c)∈A i (x,y) E ∞ 0 e -ρt U (c t )dt , (x, y) ∈ R 2 + , (2.14)
where ρ > 0 is a positive discount factor. We also introduce, for i ∈ I d , the function

vi (r) = sup x∈[0,r] v i (x, r -x), r ≥ 0, (2.15)
which represents the maximal utility performance that the agent can achieve starting from an initial nonnegative wealth r and from the regime i. More generally, for any locally bounded function w i on R 2 + , we associate the function ŵi defined on R + by: ŵi (r) = sup x∈[0,r] w i (x, y), so that:

ŵi (x + y) = sup e∈[-y,x]
w i (xe, y + e), (x, y) ∈ R 2 + .

In the sequel, we shall often identify a d-tuple function (w i ) i∈I d defined on R 2 + with the function w defined on R 2 + × I d by w(x, y, i) = w i (x, y). In this paper, we focus on the analytic characterization of the value functions v i (and so vi ), i ∈ I d , and on their numerical approximation.

Some properties of the value function

We state some preliminary properties of the value functions that will be used in the next section for the PDE characterization. We first need to check that the value functions are well-defined and finite. Let us consider for any p > 0, the positive constant:

k(p) := max i∈I d ,z∈[0,1] pb i z - σ 2 i 2 p(1 -p)z 2 + j =i q ij ((1 -zγ ij ) p -1) < ∞.
We then have the following lemma.

Lemma 3.1 Fix some initial conditions (i, x, y) ∈ I d × R + × R + , and some p > 0. Then:

(1) For any admissible control (ζ, c) ∈ A i (x, y) associated with wealth process R, the process (e -k(p)t R p t ) t≥0 is a supermartingale. So, in particular, for ρ > k(p),

lim t→∞ e -ρt E[R p t ] = 0. ( 3.1)
(2) For fixed T ∈ (0, ∞), the family (R p T ∧τ ) τ,ζ,c is uniformly integrable, when τ ranges over all stopping times, and (ζ, c) runs over A i (x, y).

Proof. (1) By Itô's formula and (2.10), we have

d(e -k(p)t R p t ) = -k(p)e -k(p)t R p t dt + e -k(p)t d(R p t ) = e -k(p)t -k(p)R p t + pR p-1 t- -c t + b I t-R t-Z t-+ p(p -1) 2 R p-2 t-σ I t-R t-Z t- 2 + j =I t- q I t-,j (R p t-(1 -γ I t-j Z t-) p -R p t-) dt + dM t ,
where M is a local martingale. Now, by definition of k(p), we have

pR p-1 t- -c t + b I t-R t-Z t-+ p(p -1) 2 R p-2 t-σ I t-R t-Z t- 2 + j =I t- q I t-,j (R p t-(1 -γ I t-j Z t-) p -R p t-) ≤ -pc t R p-1 t-+ k(p)R p t- ≤ k(p)R p t-. Since R has countable jumps, R t = R t-,
dP ⊗ dt a.e., and so the drift term in d(e -k(p)t R p t ) is nonpositive. Hence (e -k(p)t R p t ) t≥0 is a local supermartingale, and since it is nonnegative, it is a true supermartingale by Fatou's lemma. In particular, we have

0 ≤ e -ρt E[R p t ] ≤ e -(ρ-k(p))t (x + y) p (3.2)
which shows (3.1).

(2) For any q > 1, we get by the supermartingale property of the process (e -k(pq)t R pq t ) t≥0 and the optional sampling theorem:

E R p T ∧τ q ≤ e k(pq)T (x + y) pq < ∞, ∀(ζ, c) ∈ A i (x, y), τ stopping time ,
which proves the required uniform integrability. ✷

The next proposition states a comparison result, and, as a byproduct, a growth condition for the value function. (1) Let w = (w i ) i∈I d be a d-tuple of nonnegative functions on R 2 + , twice differentiable on R 2 + \ {(0, 0)} such that

ρw i -b i y ∂w i ∂y - 1 2 σ 2 i y 2 ∂ 2 w i ∂y 2 - j =i q ij [w j (x, y(1 -γ ij )) -w i (x, y)] -λ i [ ŵi (x + y) -w i (x, y)] -Ũ ∂w i ∂x ≥ 0, (3.3)
for all i ∈ I d , (x, y) ∈ R 2 + \ {(0, 0)}. Then, for all i ∈ I d , v i ≤ w i , on R 2 + .
(2) Under (2.12), suppose that ρ > k(p). Then, there exists some positive constant C s.t.

v i (x, y) ≤ C(x + y) p , ∀(i, x, y) ∈ I d × R 2 + . (3.4)
Proof.

(1) First notice that for (x, y) = (0, 0), the only admissible control in A i (x, y) is the zero control ζ = 0, c = 0, so that v i (0, 0) = 0. Now, fix (x, y) ∈ R 2 + \ {(0, 0)}, i ∈ I d , and consider an arbitrary admissible control (ζ, c) ∈ A i (x, y). By Itô's formula to e -ρt w(X t , Y t , I t ), we get:

d[e -ρt w(X t , Y t , I t )] = e -ρt -ρw -c t ∂w ∂x + b I t -Y t - ∂w ∂y + 1 2 σ 2 I t -Y 2 t - ∂ 2 w ∂y 2 + j =I t - q I t -j [w(X t -, Y t -(1 -γ I t -j ), j) -w(X t -, Y t -, I t -)] + λ I t -w(X t --ζ t , Y t -+ ζ t , I t -) -w(X t -, Y t -, I t -) dt + e -ρt σ 2 I t -Y t - ∂w ∂y (X t -, Y t -, I t -)dW t +e -ρt j =I t - [w(X t -, Y t -(1 -γ I t -j ), j) -w(X t -, Y t -, I t -)] dN I t -j -q I t -j dt +e -ρt w(X t --ζ t , Y t -+ ζ t , I t -) -w(X t -, Y t -, I t -) dN t -λ I t -dt . (3.5)
Denote by τ = inf{t ≥ 0 : (X t , Y t ) = (0, 0)}, and consider the sequence of bounded stopping times τ n = inf{t ≥ 0 :

X t + Y t ≥ n or X t + Y t ≤ 1/n} ∧ n, n ≥ 1.
Then, τ n ր τ a.s. when n goes to infinity, and c t = 0, X t = Y t = 0 for t ≥ τ , and so

E ∞ 0 e -ρt U (c t )dt = E τ 0 e -ρt U (c t )dt . (3.6)
From Itô's formula (3.5) between time t = 0 and t = τ n , and observing that the integrands of the local martingale parts are bounded for t ≤ τ n , we obtain after taking expectation:

w(x, y, i) = E e -ρτn w(X τn , Y τn , I τn )

+ τn 0 e -ρt ρw + c t ∂w ∂x -b I t -Y t - ∂w ∂y - 1 2 σ 2 I t -Y 2 t - ∂ 2 w ∂y 2 - j =I t - q I t -j [w(X t -, Y t -(1 -γ I t -j ), j) -w(X t -, Y t -, I t -)] -λ I t -w(X t --ζ t , Y t -+ ζ t , I t -) -w(X t -, Y t -, I t -) dt ≥ E e -ρτn w(X τn , Y τn , I τn ) + τn 0 e -ρt U (c t )dt ≥ E τn 0 e -ρt U (c t )dt ,
where we used (3.3), and the nonnegativity of w. By sending n to infinity with Fatou's lemma, and (3.6), we obtain the required inequality:

w i ≥ v i since (c, ζ) are arbitrary.
(2) Consider the function w i (x, y) = C(x + y) p . Then, for (x, y) ∈ R 2 + \ {(0, 0)}, and denoting by z = y/(x + y) ∈ [0, 1], a straightforward calculation shows that

ρw i -b i y ∂w i ∂y - 1 2 σ 2 i y 2 ∂ 2 w i ∂y 2 - j =i q ij [w j (x, y(1 -γ ij )) -w i (x, y)] -λ i [ ŵi (x + y) -w i (x, y)] -Ũ ( ∂w i ∂x ) = C(x + y) p ρ -pb i z + σ 2 i 2 p(1 -p)z 2 - j =i q ij ((1 -zγ ij ) p -1) -Ũ ((x + y) p-1 pC) ≥ (x + y) p C(ρ -k(p)) -K(pC) -p 1-p (3.7)
by (2.13). Hence, for ρ > k(p), and for C sufficiently large, the r.h.s. of (3.7) is nonnegative, and we conclude by using the comparison result in assertion 1). ✷

In the sequel, we shall assume the standing condition that ρ > k(p) so that the value functions are well-defined and satisfy the growth condition (3.4). We now prove continuity properties of the value functions.

Proposition 3.2

The value functions v i , i ∈ I d , are concave, nondecreasing in both variables, and continuous on R 2 + . This implies also that vi , i ∈ I d , are nondecreasing, concave and continuous on R + . Moreover, we have the boundary conditions for

v i , i ∈ I d , on {0} × R + : v i (0, y) = 0, if y = 0 E e -ρτ 1 vI i τ 1 y Sτ 1 S 0 , if y > 0. (3.8)
Here I i denotes the continuous-time Markov chain I starting from i at time 0.

Proof. Fix some (x, y, i) ∈ R 2 + × I d , δ 1 ≥ 0, δ 2 ≥ 0, and take an admissible control (ζ, c) ∈ A i (x, y). Denote by R and R ′ the wealth processes associated to (ζ, c), starting from initial state (x, y, i) and (x + δ 1 , y + δ 2 , i). We thus have R ′ = R + δ 1 + δ 2 S/S 0 . This implies that (ζ, c) is also an admissible control for (x + δ 1 , y + δ 2 , i), which shows clearly the nondecreasing monotonicity of v i in x and y, and thus also the nondecreasing monotonicity of vi by its very definition.

The concavity of v i in (x, y) follows from the linearity of the admissibility constraints in X, Y, ζ, c, and the concavity of U . This also implies the concavity of vi (r) by its definition.

Since v i is concave, it is continuous on the interior of its domain R 2 + . From (3.4), and since v i is nonnegative, we see that v i is continuous on (x 0 , y 0 ) = (0, 0) with v i (0, 0) = 0. Then, vi is continuous on R + with vi (0) = 0. It remains to prove the continuity of v i at (x 0 , y 0 ) when x 0 = 0 or y 0 = 0. We shall rely on the following implication of the dynamic programming principle

v i (x, y) = sup c∈C(x) E τ 1 0 e -ρt U (c t )dt + e -ρτ 1 vI i τ 1 (R τ 1 ) (3.9) = sup c∈C(x) E τ 1 0 e -ρt U (c t )dt + e -ρτ 1 vI i τ 1
x -

τ 1 0 c t dt + y S τ 1 S 0 , ∀(x, y) ∈ R 2 + ,
where C(x) denotes the set of nonnegative adapted processes (c t ) s.t.

τ 1 0 c t dt ≤ x a.s. (i)
We first consider the case x 0 = 0 (and y 0 > 0). In this case, the constraint on consumption c in C(x 0 ) means that c t = 0, t ≤ τ 1 , so that (3.9) implies (3.8). Now, since v i is nondecreasing in x, we have:

v i (x, y) ≥ v i (0, y).
Moreover, by concavity and thus continuity of v i (0, .), we have: lim y→y 0 v i (0, y) = v i (0, y 0 ). This implies that lim inf (x,y)→(0,y 0 ) v i (x, y) ≥ v i (0, y 0 ). The proof of the converse inequality requires more technical arguments. For any x, y ≥ 0, we have:

v i (x, y) = sup c∈C(x) E τ 1 0 e -ρs U (c s )ds + e -ρτ 1 vI i τ 1 x - τ 1 0 c s ds + y S τ 1 S 0 ≤ sup c∈C(x) E τ 1 0 e -ρs U (c s )ds + E e -ρτ 1 vIτ 1 x + y S τ 1 S 0 =: E 1 (x) + E 2 (x, y). (3.10)
Now, by Jensen's inequality, and since U is concave, we have:

∞ 0 U c s 1 {s≤τ 1 } ρe -ρs ds ≤ U ∞ 0 c s 1 {s≤τ 1 } ρe -ρs ds ,
and thus:

τ 1 0 e -ρs U (c s )ds ≤ U (ρx) ρ , a.s. ∀c ∈ C(x), (3.11)
by using the fact that τ 1 0 c t dt ≤ x a.s. By continuity of U in 0 with U (0) = 0, this shows that E 1 (x) converges to zero when x goes to x 0 = 0. Next, by continuity of vi , we have:

vI i τ 1 x + y Sτ 1 S 0 → vI i τ 1 y 0 Sτ 1
S 0 a.s. when (x, y) → (0, y 0 ). Let us check that this convergence is dominated. Indeed from (3.4), there is some positive constant C s.t.

vI i τ 1 x + y S τ 1 S 0 ≤ C x + y S τ 1 S 0 p ≤ C(x + y) p 1 ∨ S τ 1 S 0 p . Moreover, E e -ρτ 1 S τ 1 S 0 p I, W = ∞ 0 λ It e -t 0 λ Is e -ρt S t S 0 p dt ≤ max i∈I d λ i ∞ 0 e -ρt S t S 0 p dt,
and so

E e -ρτ 1 S τ 1 S 0 p ≤ max i∈I d λ i ∞ 0 E e -ρt S t S 0 p dt ≤ max i∈I d λ i ∞ 0 e -(ρ-k(p))t dt < ∞,
where we used in the second inequality the supermartingale property in Lemma 3.1 (and, more precisely, equation (3.2)) for x = 0, y = 1, c ≡ ζ ≡ 0. One can then apply the dominated convergence theorem to E 2 (x, y), to deduce that E 2 (x, y) converges to

E e -ρτ 1 vI i τ 1 y 0 Sτ 1 S 0
when (x, y) → (0, y 0 ). This, together with (3.8), (3.10), proves that lim sup (x,y)→(0,y 0 ) v i (x, y) ≤ v i (0, y 0 ), and thus the continuity of v i at (0, y 0 ).

(ii) We consider the case y 0 = 0 (and x 0 > 0). Similarly, as in the first case, from the nondecreasing and continuity properties of v i (., 0), we have: lim inf (x,y)→(x 0 ,0) v i (x, y) ≥ v i (x 0 , 0). Conversely, for any x ≥ 0, and c ∈ C(x), let us consider the stopping time τ c = inf t ∈≥ 0 :

t 0 c s ds = x 0 .
Then, the nonnegative adapted process c ′ defined by: c ′ t = c t 1 t≤τc∧τ 1 , lies obviously in C(x 0 ). Furthermore,

τ 1 0 e -ρs U (c s )ds = τc∧τ 1 0 e -ρs U (c ′ s )ds + τ 1 τc∧τ 1 e -ρs U (c s )ds ≤ τ 1 0 e -ρs U (c ′ s )ds + U (ρ(x -x 0 ) + ) ρ , (3.12)
by the same Jensen's arguments as in (3.11), and for all y ≥ 0, vI i τ 1

x -

τ 1 0 c t dt + y S τ 1 S 0 ≤ vI i τ 1 x 0 - τ 1 0 c ′ t dt + (x -x 0 ) + + y S τ 1 S 0 ≤ vI i τ 1 x 0 - τ 1 0 c ′ t dt + vI i τ 1 (x -x 0 ) + + y S τ 1 S 0 , (3.13)
where we have used the fact that vi is nondecreasing, and subadditive (as a concave function with vi (0) ≥ 0). By adding the two inequalities (3.12)-(3.13), and taking expectation, we obtain from (3.9):

v i (x, y) ≤ v i (x 0 , 0) + U (ρ(x -x 0 ) + ) ρ + E e -ρτ 1 vI i τ 1 (x -x 0 ) + + y S τ 1 S 0 ,
and by the same domination arguments as in the first case, this shows that lim sup

(x,y)→(x 0 ,0) v i (x, y) ≤ v i (x 0 , 0),
which ends the proof. ✷ Remark 3.1 The above proof of continuity of the value functions at the boundary by means of the dynamic programming principle is somehow different from other similar proofs that one can find e.g. in [START_REF] Giacinto | Pension funds with minimum guarantee: a stochastic control approach[END_REF][START_REF] Pham | A model of optimal consumption under liquidity risk with random trading times[END_REF][START_REF] Zariphopoulou | Investment-consumption models with transaction fees and Markovchain parameters[END_REF]. Indeed in such problems the proof of dynamic programming principle is done (or referred to) in two parts: the "easy" one (≤) which does not require continuity of the value function, and the 'difficult" one (≥) which requires the continuity of the value function up to the boundary. The proof of continuity at the boundary in such cases uses only the "easy" inequality. In our case, due to the specific boundary condition of our problem, the "easy" inequality is not enough to prove the continuity at the boundary. We need also the "hard" inequality. For this reason we give, in Appendix A, a proof of the dynamic programming principle in our case that, in the "hard" inequality part, uses the continuity of v i in the interior and the continuity of its restriction to the boundary (which are both implied by the concavity and by the growth condition (3.4)).

We shall also need the following lemma.

Lemma 3.2 There exists some positive constant C > 0 s.t.

∂v i ∂x (x + , y) := lim δ↓0 v i (x + δ, y) -v i (x, y) δ ≥ C U ′ (2x), ∀ x, y ∈ R + , i ∈ I d . (3.14)
Proof. Fix some x, y ≥ 0, and set

x 1 = x + δ for δ > 0. For any (ζ, c) ∈ A i (x, y) with associated cash/amount in shares (X, Y ), notice that ( ζ, c) := (ζ, c+δ1 [0,1∧τ 1 ]
) is admissible for (x 1 , y). Indeed, the associated cash amount satisfies

Xt = X t + (x 1 -x) - t 0 δ1 [0,1∧τ 1 ] (s)ds ≥ X t ≥ 0,
while the amount in cash Ỹt = Y t ≥ 0 since ζ is unchanged. Thus, ( ζ, c) ∈ A i (x 1 , y), and we have

v i (x 1 , y) ≥ E ∞ 0 e -ρt U ( ct )dt = E ∞ 0 e -ρt U (c t )dt + E 1∧τ 1 0 e -ρt (U (c t + δ) -U (c t )) dt . (3.15)
Now, by concavity of U :

U (c t + δ) -U (c t ) ≥ δU ′ (c t + δ), and
1∧τ 1 0 e -ρt (U (c t + δ) -U (c t ))dt ≥ 1∧τ 1 0 e -ρt δU ′ (c t + δ)dt ≥ δe -ρ(1∧τ 1 ) 1∧τ 1 0 U ′ (c t + δ)dt ≥ δe -ρ(1∧τ 1 ) U ′ (2x + δ) 1∧τ 1 0 1 {ct<2x} dt. (3.16) Moreover, 2x 1∧τ 1 0 1 {ct≥2x} dt ≤ 1∧τ 1 0 c t dt ≤ x, since (ζ, c
) is admissible for (x, y), so that

1∧τ 1 0 1 {ct<2x} dt ≥ (1 ∧ τ 1 ) - 1 2 ∧ τ 1 ≥ 1 2 1 {τ 1 ≥1} . (3.17)
By combining (3.16) and (3.17), and taking the expectation, we get

E 1∧τ 1 0 e -ρt (U (c t + δ) -U (c t ))dt ≥ δU ′ (2x + δ)E e -ρ(1∧τ 1 ) 1 2 1 {τ 1 ≥1} .
By taking the supremum over (ζ, c) in (3.15), we thus obtain with the above inequality

v i (x + δ, y) ≥ v i (x, y) + δU ′ (2x + δ)E e -ρ(1∧τ 1 ) 1 2 1 {τ 1 ≥1} .
Finally, by choosing C = E e -ρ(1∧τ 1 ) 1 2 1 {τ 1 ≥1} > 0, and letting δ go to 0, we obtain the required inequality (3.14). ✷

Dynamic programming and viscosity characterization

In this section, we provide an analytic characterization of the value functions v i , i ∈ I d , to our control problem (2.14), by relying on the dynamic programming principle, which is shown to hold and formulated as:

v i (x, y) = sup (ζ,c)∈A i (x,y) E τ 0 e -ρt U (c t )dt + e -ρτ v Iτ (X τ , Y τ ) . (4.1)
Proof. See Appendix A. ✷

The associated dynamic programming system (also called Hamilton-Jacobi-Bellman or HJB system) for v i , i ∈ I d , is written as

ρv i -b i y ∂v i ∂y - 1 2 σ 2 i y 2 ∂ 2 v i ∂y 2 -Ũ ∂v i ∂x (4.2) - j =i q ij v j x, y(1 -γ ij ) -v i (x, y) -λ i vi (x + y) -v i (x, y) = 0, (x, y) ∈ (0, ∞) × R + , i ∈ I d ,
together with the boundary condition (3.8) on {0} × R + for v i , i ∈ I d . Notice that, arguing as one does for the deduction of the HJB system above, the boundary condition (3.8) may also be written as:

ρv i (0, .) -b i y ∂v i ∂y (0, .) - 1 2 σ 2 i y 2 ∂ 2 v i ∂y 2 (0, .) - j =i q ij v j 0, y(1 -γ ij ) -v i (0, y) -λ i vi (y) -v i (0, y) = 0, y > 0, i ∈ I d . (4.3)
Notice that in this boundary condition the term Ũ ∂v i ∂x has disappeared. This implicitly comes from the fact that, on the boundary x = 0 the only admissible consumption rate is c = 0. We will say more on this in studying the case of CRRA utility function in Section 5.1.

In our context, the notion of viscosity solution to the non local second-order system (E) is defined as follows.

Definition 4.1 (i) A d-tuple w = (w i ) i∈I d of continuous functions on R 2 + is a viscosity supersolution (resp. subsolution) to (4.2) if ρϕ i (x, ȳ) -b i ȳ ∂ϕ i ∂y (x, ȳ) - 1 2 σ 2 i ȳ2 ∂ 2 ϕ i ∂y 2 (x, ȳ) -Ũ ∂ϕ i ∂x (x, ȳ) - j =i q ij ϕ j x, ȳ(1 -γ ij ) -ϕ i (x, ȳ) -λ i φi (x + ȳ) -ϕ i (x, ȳ) ≥ ( resp. ≤) 0, for all d-tuple ϕ = (ϕ i ) i∈I d of C 2 functions on R 2 + , and any (x, ȳ, i) ∈ (0, ∞) × R + × I d , such that w i (x, ȳ) = ϕ i (x, ȳ), and w ≥ (resp. ≤) ϕ on R 2 + × I d . (ii) A d-tuple w = (w i ) i∈I d of continuous functions on R 2
+ is a viscosity solution to (4.2) if it is both a viscosity supersolution and subsolution to (4.2).

The main result of this section is to provide an analytic characterization of the value functions in terms of viscosity solutions to the dynamic programming system. Proof. The proof of viscosity property follows as usual from the dynamic programming principle. The uniqueness and comparison result for viscosity solutions is proved by rather standard arguments, up to some specificities related to the non local terms and state constraints induced by our hybrid jump-diffusion control problem. We postponed the details in Appendix B. ✷

The case of CRRA utility

In this section, we consider the case where the utility function is of CRRA type in the form:

U (x) =
x p p , x > 0, for some p ∈ (0, 1).

(5.1)

We shall exploit the homogeneity property of the CRRA utility function, and go beyond the viscosity characterization of the value function in order to prove some regularity results, and provide an explicit characterization of the optimal control through a verification theorem. We next give a numerical analysis for computing the value functions and optimal strategies, and illustrate with some tests for measuring the impact of our illiquidity features.

Regularity results and verification theorem

For any (i, x, y) ∈ I d × R 2 + , (ζ, c) ∈ A(x, y) with associated state process (X, Y ), we notice from the dynamics (2.3)-(2.2) that for any k ≥ 0, the state (kX, kY ) is associated to the control (kζ, kc). Thus, for k > 0,we have (ζ, c) ∈ A i (x, y) iff (kζ, kc) ∈ A(kx, kc), and so from the homogeneity property of the power utility function U in (5.1), we have:

v i (kx, ky) = k p v i (x, y), ∀(i, x, y) ∈ I d × R 2 + , k ∈ R + . (5.2)
Let us now consider the change of variables:

(x, y) ∈ R 2 + \ {(0, 0)} -→ r = x + y, z = y x + y ∈ (0, ∞) × [0, 1].
Then, from (5.2), we have

v i (x, y) = v i (r(1 -z), rz) = r p v i (1 -z, z
), and we can separate the value function v i into:

v i (x, y) = U (x + y)ϕ i y x + y , ∀(i, x, y) ∈ I d × (R 2 + \ {(0, 0)}) (5.3)
where

ϕ i (z) = p v i (1 -z, z) is a continuous function on [0, 1]
. By substituting this transformation for v i into the dynamic programming equation (4.2) and the boundary condition (4.3), and after some straightforward calculations, we see that ϕ = (ϕ i ) i∈I d should solve the system of (nonlocal) ordinary differential equations (ODEs):

(ρ -pb i z + 1 2 p(1 -p)σ 2 i z 2 )ϕ i -(1 -p) ϕ i - z p ϕ ′ i -p 1-p (5.4)
-z(1 -z)(b i -z(1 -p)σ 2 i )ϕ ′ i - 1 2 z 2 (1 -z) 2 σ 2 i ϕ ′′ i - j =i q ij (1 -zγ ij ) p ϕ j z(1 -γ ij ) 1 -zγ ij -ϕ i (z) -λ i sup π∈[0,1] ϕ i (π) -ϕ i (z) = 0, z ∈ [0, 1), i ∈ I d ,
together with the boundary condition for z = 1:

(ρ -pb i + 1 2 p(1 -p)σ 2 i )ϕ i (1) - j =i q ij (1 -γ ij ) p ϕ j (1) -ϕ i (1) -λ i sup π∈[0,1] ϕ i (π) -ϕ i (1) = 0, i ∈ I d . (5.5)
The following boundary condition for z = 0, obtained formally by taking z = 0 in (5.4),

ρϕ i (0) -(1 -p) ϕ i (0) -p 1-p - j =i q ij ϕ j (0) -ϕ i (0) -λ i sup π∈[0,1] ϕ i (π) -ϕ i (0) = 0, i ∈ I d , (5.6)
is proved rigorously in the below Proposition.

Proposition 5.1 The d-tuple ϕ = (ϕ i ) i∈I d is concave on [0, 1], C 2 on (0, 1). We further have

lim z→0 zϕ ′ i (z) = 0, (5.7) lim z→0 z 2 ϕ ′′ i (z) = 0, (5.8) lim z→1 (1 -z)ϕ ′ i (z) = 0, (5.9) lim z→1 (1 -z) 2 ϕ ′′ i (z) = 0, (5.10) lim z→1 ϕ ′ i (z) = -∞, (5.11)
and ϕ is the unique bounded classical solution of (5.4) on (0, 1), with boundary conditions (5.5)-(5.6).

Proof. Since ϕ i (z) = p v i (1z, z), and by concavity of v i (., .) in both variables, it is clear that ϕ i is concave on [0, 1]. From the viscosity property of v i in Theorem 4.1, and the change of variables (5.3), this implies that ϕ is the unique bounded viscosity solution to (5.4) on [0, 1), satisfying the boundary condition (5.5). Now, recalling that q ii =j =i q ij , we observe that the system (5.4) can be written as:

(ρ -q ii + λ i -pb i z + 1 2 p(1 -p)σ 2 i z 2 )ϕ i -z(1 -z)(b i -z(1 -p)σ 2 i )ϕ ′ i - 1 2 z 2 (1 -z) 2 σ 2 i ϕ ′′ i -(1 -p) ϕ i - z p ϕ ′ i -p 1-p = j =i q ij (1 -zγ ij ) p ϕ j z(1 -γ ij ) 1 -zγ ij + λ i sup π∈[0,1] ϕ i (π), z ∈ (0, 1), i ∈ I d . (5.12)
Let us fix some i ∈ I d , and an arbitrary compact [a, b] ⊂ (0, 1). By standard results, see e.g. [START_REF] Crandall | User's Guide to Viscosity Solutions of Second Order Partial Differential Equations[END_REF], we know that the second-order ODE:

(ρ -q ii + λ i -pb i z + 1 2 p(1 -p)σ 2 i z 2 )w i -z(1 -z)(b i -z(1 -p)σ 2 i )w ′ i - 1 2 z 2 (1 -z) 2 σ 2 i w ′′ i -(1 -p) w i - z p w ′ i -p 1-p = j =i q ij (1 -zγ ij ) p ϕ j z(1 -γ ij ) 1 -zγ ij + λ i sup π∈[0,1] ϕ i (π) (5.13)
has a unique viscosity solution w i satisfying w i (a) = ϕ i (a), w i (b) = ϕ i (b), and that this solution [START_REF] Ladyzhenskaya | Linear and quasilinear elliptic equations[END_REF]. Since ϕ i is a viscosity solution to (5.13) by (5.12), we deduce by uniqueness that ϕ i = w i on [a, b]. Since a, b are arbitrary, this means that ϕ is C 2 on (0, 1). By concavity of ϕ i , we have for all z ∈ (0, 1),

w i is twice differentiable on [a, b] since the second term z(1 -z)σ 2 i is uniformly elliptic on [a, b], see
ϕ i (1) -ϕ i (z) 1 -z ≤ ϕ ′ i (z) ≤ ϕ i (z) -ϕ i (0) z .
Letting z → 0 and z → 1, and by continuity of ϕ i , we obtain (5.7) and (5.9). Now letting z go to 0 in (5.4), we obtain lim z→0 z 2 ϕ ′′ i (z) = l for some finite l ≤ 0. If l < 0, z 2 ϕ ′′ i (z) ≤ l 2 whenever z ≤ η, for some η > 0. By writing that

z(ϕ ′ i (z) -ϕ ′ i (η)) = z z η ϕ ′′ i (u)du ≥ - l 2 z η z du u 2 = l 2 z 1 η - 1 z ,
and sending z → 0, we get lim inf z→0 zϕ ′ i (z) ≥ -l/2, which contradicts (5.7). Thus l = 0, and the boundary condition (5.6) follows by letting z → 0 in (5.4). In the same way, letting z → 1 in (5.4) and comparing with (5.5), we have lim

z→1 1 2 (1 -z) 2 ϕ ′′ i (z) = ϕ i (1) -ϕ ′ i (1-) -p 1-p ∈ [0, ∞].
(5.9) implies that this limit is 0, and we obtain (5.10) and (5.11). ✷ Remark 5.1 From (5.3) and the above Proposition, we deduce that the value functions v i , i ∈ I d , are C 2 on (0, ∞) × (0, ∞), and so are solutions to the dynamic programming system (4.2) on (0, ∞) × (0, ∞) in classical sense.

We now provide an explicit construction of the optimal investment/consumption strategies in feedback form in terms of the smooth solution ϕ to (5.4)-(5.6)-(5.5). We start with the following Lemma.

c * (i, z) =        ϕ i (z) -z p ϕ ′ i (z) -1 1-p when 0 < z < 1 (ϕ i (0)) -1 1-p when z = 0 0 when z = 1 , π * (i) ∈ arg max π∈[0,1] ϕ i (π).
Then for each i ∈ I d , c * (i, .) is continuous on [0, 1], C 1 on (0, 1), and given any initial conditions (r, z) ∈ I d × R + × [0, 1], there exists a solution ( Rt , Ẑt ) t≥0 valued in R + × [0, 1] to the SDE:

d Rt = Rt -Ẑt -b I t -dt + σ I t -dW t -γ I t -,I t dN I t -,It t -Rt-c * (I t-, Ẑt-)dt, (5.14)
d Ẑt = Ẑt -(1 -Ẑt -) b I t --Ẑt -σ 2 I t -dt + σ I t -dW t - γ I t -,I t 1 -Ẑt -γ I t -,I t dN I t -,It t + (π * (I t-) -Ẑt-)dN t + Ẑt c * (I t-, Ẑt-)dt. (5.15)
Moreover, if r > 0, then Rt > 0, a.s. for all t ≥ 0.

Proof. First notice that Lemma 3.2, written in terms of the variables (r, z), is formulated equivalently as

ϕ i (z) - z p ϕ ′ i (z) ≥ C2 p-1 (1 -z) p-1 , z ∈ (0, 1).
This implies that c * (i, .) is well-defined on (0, 1), and C 1 since ϕ is C 2 . The continuity of c * (i, .) at 0 and 1 comes from (5.7) and (5.11).

Let us show the existence of a solution Z to the SDE (5.15). We start by the existence of a solution for t < τ 1 (recall that (τ n ) is the sequence of jump times of N ). In the case where z = 1 (resp. z = 0), then Z t ≡ 1 (resp. Z t ≡ 0) is clearly a solution on [0, τ 1 ). Consider now the case where z ∈ (0, 1). From the local Lipschitz property of z → zc * (i, z), and recalling that γ ij < 1, we know, adapting e.g. the result of Theorem 38, page 303 of [START_REF] Protter | Stochastic Integration and Differential Equations[END_REF], that there exists a solution to

d Ẑt = Ẑt -(1 -Ẑt -) b I t --Ẑt -σ 2 I t -dt + σ I t -dW t - γ I t -,I t 1 -Ẑt -γ I t -,I t dN I t -,It t + Ẑt c * (I t-, Ẑt-)dt, (5.16) which is valued in [0, 1] up to time t < τ ′ 1 := τ 1 ∧ lim ε→0 inf t ≥ 0| Ẑt (1 -Ẑt ) ≤ ε . By noting that Ẑt ≥ Z 0 t ,
where

Z 0 t = z St S 0 z St S 0 + (1 -z) , t ≥ 0,
is the solution to (5.16) without the consumption term, and since S is locally bounded away from 0, we have lim

t→τ ′ 1 Z t = 1 on {τ ′ 1 < τ 1 }. By extending Ẑt ≡ 1 on [τ ′ 1 , τ 1 )
, we obtain actually a solution on [0, τ 1 ). Then at τ 1 , by taking Ẑτ 1 = π * (I τ 1 -), we obtain a solution to (5.15) valued in [0, 1] on [0, τ 1 ]. Next, we obtain similarly a solution to (5.15) on [τ 1 , τ 2 ] starting from Ẑτ 1 . Finally, since τ n ր ∞, a.s., by pasting we obtain a solution to (5.15) for t ∈ R + .

Given a solution Ẑ to (5.15), the solution R to (5.14) starting from r at time 0 is determined by the stochastic exponential:

Rt = r • E • 0 Ẑs -b I s -ds + σ I s -dW s -γ I s -,Is dN I s -,Is s -c * (I s-, Ẑs-)dt t .
Since -Ẑtγ I t -,I t > -1, we see that R t > 0, t ≥ 0, whenever r > 0, while R ≡ 0 if r = 0. ✷ Proposition 5.2 Given some initial conditions (i, x, y) ∈ I d ×(R 2 + \{(0, 0)}), let us consider the pair of processes ( ζ, ĉ) defined by:

ζt = Rt-(π * (I t-) -Ẑt-) (5.17) ĉt = Rt-c * (I t-, Ẑt-), (5.18)
where the functions (c * , π * ) are defined in Lemma 5.1, and ( R, Ẑ) are solutions to (5.14)-(5.15), starting from r = x + y, z = y/(x + y), with I starting from i. Then, ( ζ, ĉ) is an optimal investment/consumption strategy in A i (x, y), with associated state process ( X, Ŷ )

= ( R(1 -Ẑ), R Ẑ), for v i (x, y) = U (r)ϕ i (z).
Proof. For such choice of ( ζ, ĉ), the dynamics of ( R, Ẑ) evolve according to (2.10)-(2.11) with a feedback control ( ζ, ĉ), and thus correspond (via Itô's formula) to a state process ( X, Ŷ ) = ( R(1 -Ẑ), R Ẑ) governed by (2.2)-(2.3), starting from (x, y), and satisfying the nonbankruptcy constraint (2.5). Thus, ( ζ, ĉ) ∈ A i (x, y). Moreover, since r = x + y > 0, this implies that R > 0, and so ( X, Ŷ ) lies in R 2 + \ {(0, 0)}. As in the proof of the standard verification theorem, we would like to apply Itô's formula to the function e -ρt v( Xt , Ŷt , I t ) (denoting by v(x, y, i) = v i (x, y) = U (x + y)ϕ i (y/(x + y))). However this is not immediately possible since the process ( Xt , Ŷt ) may reach the boundary of R 2 where the derivatives of v do not have classical sense. To overcome this problem, we approximate the function ϕ i (and so v(x, y, i)) as follows. We define, for every ε > 0 a function

ϕ ε = (ϕ ε ) i∈I d ∈ C 2 ([0, 1], R d )
as in the proof of Theorem 4.24 in [START_REF] Giacinto | Pension funds with minimum guarantee: a stochastic control approach[END_REF], such that

• ϕ ε i = ϕ i on [ε, 1 -ε],
•

ϕ ε i → ϕ i uniformly on [0, 1] as ε → 0, • z(1 -z)(ϕ ε i ) ′ → z(1 -z)ϕ ′ i uniformly on [0, 1] as ε → 0, • z 2 (1 -z) 2 (ϕ ε i ) ′′ → z 2 (1 -z) 2 ϕ ′′ i uniformly on [0, 1]
as ε → 0, Now we can apply Dynkin's formula to the function v ε (x, y, i) = U (x + y)ϕ ε i (y/(x + y)) calculated on the process ( X, Ŷ , I) between time 0 and τ n ∧ T , where τ n = inf{t ≥ 0 : Xt + Ŷt ≥ n} :

v ε (x, y, i) = E e -ρ(τn∧T ) v ε ( Xτn∧T , Ŷτn∧T , I τn∧T ) + τn∧T 0 e -ρt ρv ε + ĉt ∂v ε ∂x -b I t -Ŷt - ∂v ε ∂y - 1 2 σ 2 I t - Ŷ 2 t - ∂ 2 v ε ∂y 2 - j =I t - q I t -j [v ε ( Xt -, Ŷt -(1 -γ I t -j ), j) -v ε ( Xt -, Ŷt -, I t -)] -λ I t -v ε ( Xt --ζt , Ŷt -+ ζt , I t -) -v ε ( Xt -, Ŷt -, I t -) dt (5.19)
We denote by ζ(i, r, z) = r(π * (i)-z), ĉ(i, r, z) = rc * (i, z), and define g ε on (R 2 + \{(0, 0)})×I d by

ρv ε i -b i y ∂v ε i ∂y - 1 2 σ 2 i y 2 ∂ 2 v ε i ∂y 2 + ĉ(i, x + y, y x + y ) ∂v ε i ∂x -U ĉ(i, x + y, y x + y ) - j =i q ij v ε j x, y(1 -γ ij ) -v ε i (x, y) -λ i v ε i x -ζ i, x + y, y x + y , y + ζ i, x + y, y x + y -v ε i (x, y) =: g ε i (x, y),
so that from (5.19):

ε (i, x, y) = E e -ρ(τn∧T ) v ε ( Xτn∧T , Ŷτn∧T , I τn∧T ) + τn∧T 0 e -ρt (U (ĉ t ) + g ε ( Xt , Ŷt , I t ))dt . (5.20)
Notice that the properties of ϕ ε imply :

• v ε i = v i on ε ≤ y x+y ≤ 1 -ε , • v ε i → v i uniformly on bounded subsets of R 2 + ,
• ĉ(i, x + y, y x+y )

∂v ε i ∂x →    c(i, x + y, y x+y ) ∂v i ∂x , x > 0 0, x = 0 uniformly on bounded subsets of R 2 + , • y ∂v ε i ∂y →    y ∂v i ∂y , y > 0 0, y = 0 uniformly on bounded subsets of R 2 + , • y 2 ∂ 2 v ε i ∂y 2 →    y 2 ∂ 2 v i ∂y 2 , y > 0 0, y = 0 uniformly on bounded subsets of R 2 + .
The details can be found in [6]. Since v is a classical solution of (4.2) on (0, ∞) × (0, ∞), this implies that g ε converges to 0 uniformly on bounded subsets of R 2 + when ε goes to 0. We then obtain by letting ε → 0 in (5.20):

v(x, y, i) = E e -ρ(τn∧T ) v( Xτn∧T , Ŷτn∧T , I τn∧T ) + τn∧T 0 e -ρt U (ĉ t )dt ,
From the growth condition (3.4) we get

E e -ρ(τn∧T ) v( Xτn∧T , , I τn∧T ) ≤ CE e -ρ(τn∧T ) R p τn∧T .
So, using Lemma 3.1, sending n to infinity, and then T to infinity, we get lim

T →∞ lim n→∞ E e -ρ(τn∧T ) v( Xτn∧T , Ŷτn∧T , I τn∧T ) = 0.
Applying monotone convergence theorem to the second term in the r.h.s. of (5.20), we then obtain

v i (x, y) = E ∞ 0 e -ρt U (ĉ t )dt ,
which proves the optimality of ( ζ, ĉ). ✷

Numerical analysis

We focus on the numerical resolution of the system of ODEs (5.4)-(5.6)-(5.5) satisfied by (ϕ i ) i∈I d and rewritten for all ∈ I d as:

(ρ -q ii + λ i -pb i z + 1 2 p(1 -p)σ 2 i z 2 )ϕ i -z(1 -z)(b i -z(1 -p)σ 2 i )ϕ ′ i - 1 2 z 2 (1 -z) 2 σ 2 i ϕ ′′ i -(1 -p) ϕ i - z p ϕ ′ i -p 1-p = j =i q ij (1 -zγ ij ) p ϕ j z(1 -γ ij ) 1 -zγ ij + λ i sup π∈[0,1] ϕ i (π), z ∈ (0, 1), (ρ -q ii + λ i )ϕ i (0) -(1 -p)ϕ i (0) -p 1-p = j =i q ij ϕ j (0) + λ i sup π∈[0,1] ϕ i (π), (ρ -q ii + λ i -pb i + 1 2 p(1 -p)σ 2 i )ϕ i (1) = j =i q ij (1 -γ ij ) p ϕ j (1) + λ i sup π∈[0,1] ϕ i (π).
The main numerical difficulty comes from the nonlocal terms in the r.h.s. of these equations. We shall adopt an iterative method as follows: starting with ϕ 0 = (ϕ 0 i ) i∈I d = 0, we solve ϕ n+1 = (ϕ n+1 i ) i∈I d as the (classical) solution to the local ODEs where the non local terms are calculated from (ϕ n i ) :

(ρ -q ii + λ i -pb i z + 1 2 p(1 -p)σ 2 i z 2 )ϕ n+1 i -z(1 -z)(b i -z(1 -p)σ 2 i )(ϕ n+1 i ) ′ - 1 2 z 2 (1 -z) 2 σ 2 i (ϕ n+1 i ) ′′ -(1 -p) ϕ n+1 i - z p (ϕ n+1 i ) ′ -p 1-p = j =i q ij (1 -zγ ij ) p ϕ n j z(1 -γ ij ) 1 -zγ ij + λ i sup π∈[0,1] ϕ n i (π),
with boundary conditions

(ρ -q ii + λ i )ϕ n+1 i (0) -(1 -p)ϕ n+1 i (0) -p 1-p = j =i q ij ϕ n j (0) + λ i sup π∈[0,1] ϕ n i (π), (ρ -q ii + λ i -pb i + 1 2 p(1 -p)σ 2 i )ϕ n+1 i (1) = j =i q ij (1 -γ ij ) p ϕ n j (1) + λ i sup π∈[0,1] ϕ n i (π).
Let us denote by:

v n i (x, y) = U (x + y)ϕ n i y x+y , for (i, x, y) ∈ I d × (R 2 + \ {(0, 0)}) 0,
for i ∈ I d , (x, y) = (0, 0).

A straightforward calculation shows that v n = (v n i ) i∈I d are solutions to the iterative local PDEs:

(ρ -q ii + λ i )v n+1 i -b i y ∂v n+1 i ∂y - 1 2 σ 2 i y 2 ∂ 2 v n+1 i ∂y 2 -Ũ ∂v n+1 i ∂x = j =i q ij v n j x, y(1 -γ ij ) + λ i vn i (x + y), (x, y) ∈ (0, ∞) × R + , i ∈ I d , (5.21)
together with the boundary condition (3.8) on {0} × (0, ∞) for v i , i ∈ I d :

(ρ -q ii + λ i )v n+1 i (0, .) -b i y ∂v n+1 i ∂y (0, .) - 1 2 σ 2 i y 2 ∂ 2 v n+1 i ∂y 2 (0, .) = j =i q ij v n j 0, y(1 -γ ij ) + λ i vn i (y), y > 0, i ∈ I d . (5.22)
We then have the stochastic control representation for v n (and so for n ).

Proposition 5.3 For all n ≥ 0, we have

v n i (x, y) = sup (ζ,c)∈A i (x,y) E θn 0 e -ρt U (c t )dt , (i, x, y) ∈ I d × R 2 + , (5.23)
where the sequence of random times (θ n ) n≥0 are defined by induction from θ 0 = 0, and:

θ n+1 = inf t > θ n : ∆N t = 0 or ∆N I t-,It t = 0 ,
i.e. θ n is the n-th time where we have either a change of regime or a trading time.

Proof. Denoting by w n i (x, y) the r.h.s. of (5.23), we need to show that w n i = v n i . First (with a similar proof to Proposition 4.1) we have the following Dynamic Programming Principle for the w n : for each finite stopping time τ ,

w n+1 i (x, y) = sup (ζ,c)∈A i (x,y) E τ ∧θ 1 0 e -ρt U (c t )dt + 1 {τ ≥θ 1 } e -ρθ 1 w n I θ 1 (X θ 1 , Y θ 1 ) +1 {τ <θ 1 } e -ρτ w n+1 Iτ (X τ , Y τ ) (5.24)
The only difference with the statement of Proposition 4.1 is the fact that when τ ≥ θ 1 , we substitute w n+1 with w n since there are only n stopping times remaining before consumption is stopped due to the finiteness of the horizon in the definition of w n . By using (5.24), we can show as in Theorem 4.1 that w n is the unique viscosity solution to (5.21), satisfying boundary condition (5.22) and growth condition (3.4) (it is actually easier since there are only local terms in this case). Since we already know that v n is such a solution, it follows that w n = v n . ✷

As a consequence, we obtain the following convergence result for the sequence (v n ) n .

Proposition 5. [START_REF] Diesinger | Asset allocation and liquidity breakdowns: what if your broker does not answer the phone?[END_REF] The sequence (v n ) n converges increasingly to v, and there exists some positive constants C and δ < 1 s.t.

0 ≤ v i -v n i ≤ Cδ n (x + y) p , ∀(i, x, y) ∈ I d × R 2 + .
(5.25)

Proof. First let us show that

δ := sup (c, ζ) ∈ A i (x, y) {(x, y) ∈ R 2 + : x + y = 1} E e -ρθ 1 R p θ 1 < 1. (5.26)
By writing that e -ρt R p t = D t L t , where (L t ) t = (e -k(p)t R p t ) t is a nonnegative supermartingale by Lemma 3.1, and (D t ) t = (e -(ρ-k(p))t ) t is a decreasing process, we see that (e -ρt R p t ) t is also a nonnegative supermartingale for all (ζ, c) ∈ A i (x, y), and so: y) with x + y = 1 (recall the supermartingale property of (e -k(p)t R p t ) t ), and by using also the uniform integrability of the family e -k(p)(θ 1 ∧1) R p The nondecreasing property of the sequence (v n i ) n follows immediately from the representation (5.23), and we have:

E e -ρθ 1 R p θ 1 ≤ E e -ρ(θ 1 ∧1) R p θ 1 ∧1 = E e -(ρ-k(p))(θ 1 ∧1) e -k(p)(θ 1 ∧1) R p θ 1 ∧1 . Now, since e -(ρ-k(p))(θ 1 ∧1) < 1 a.s., E e -k(p)(θ 1 ∧1) R p θ 1 ∧1 ≤ 1, for all (ζ, c) ∈ A i (x,
v n i ≤ v n+1 i
≤ v for all n ≥ 0. Moreover, the dynamic programming principle (5.24) applied to τ = θ 1 gives

v n+1 i (x, y) = sup (ζ,c)∈A i (x,y) E θ 1 0 e -ρt U (c t )dt + e -ρθ 1 v n I θ 1 (X θ 1 , Y θ 1 ) (5.27)
Let us show (5.25) by induction on n. The case n = 0 is simply the growth condition (3.4) since v 0 = 0. Assume now that (5.25) holds true at step n. From the dynamic programming principle (4.1) and (5.27) for v and v n+1 , we then have:

v n+1 i (x, y) ≥ v i (x, y) - sup (ζ,c)∈A i (x,y) E e -ρθ 1 (v I θ 1 -v n I θ 1 ) X θ 1 , Y θ 1 ≥ v i (x, y) - sup (ζ,c)∈A i (x,y) E e -ρθ 1 Cδ n R p θ 1 = v i (x, y) -Cδ n+1 (x + y) p ,
by definition of δ. This proves the required inequality at step n + 1, and ends the proof. ✷

In the next section, we solve the local ODEs for ϕ n with Newton's method by a finitedifference scheme (see section 3.2 in [START_REF] Keller | Numerical methods for two-point boundary-value problems[END_REF]).

Numerical illustrations

Single-regime case

In this paragraph, we consider the case where there is only one regime (d = 1). In this case, our model is similar to the one studied in [START_REF] Pham | A model of optimal consumption under liquidity risk with random trading times[END_REF], with the key difference that in their model, the investor only observes the stock price at the trading times, so that the consumption process is piecewise-deterministic. We want to compare our results with [START_REF] Pham | A model of optimal consumption under liquidity risk with random trading times[END_REF], and take the same values for our parameters ρ = 0.2, b = 0.4, σ = 1.

Defining the cost of liquidity P (x) as the extra amount needed to have the same utility as in the Merton case : v(x + P (x)) = v M (x), we compare the results in our model and in the discrete observation model in [START_REF] Pham | A model of optimal consumption under liquidity risk with random trading times[END_REF]. The results in Table 1 indicate that the impact of the lack of continuous observation is quite large, and more important than the constraint of only being able to trade at discrete times. In Figure 1 we have plotted the graph of ϕ(z) and of the optimal consumption rate c * (z) for different values of λ. Notice how the value function, the optimal proportion and the optimal consumption rate converge to the Merton values when λ increases.

We observe that the optimal investment proportion is increasing with λ. When z is close to 1 i.e. the cash proportion in the portfolio is small, the investor faces the risk of "having nothing more to consume" and the further away the next trading date is the smaller the consumption rate should be, i.e. c * is increasing in λ. When z is far from 1 it is the opposite : when λ is smaller the investor will not be able to invest optimally to maximize future income and should consume more quickly.

Two regimes

In this paragraph, we consider the case of d = 2 regimes. We assume that the asset price is continuous, i.e. γ 12 = γ 21 = 0. In this case, the value functions and optimal strategies for the continuous trading (Merton) problem are explicit, see [START_REF] Sotomayor | Explicit solutions of consumption-investment problems in financial markets with regime switching[END_REF]: v i,M (r) = r p p ϕ i,M where (ϕ i,M ) i=1,2 is the only positive solution to the equations:

ρ -q ii - b 2 i p 2σ 2 i (1 -p) ϕ i,M -(1 -p)ϕ -p 1-p i,M = q ij ϕ j,M , i, j ∈ {1, 2}, i = j.
The optimal proportion invested in the asset

π * i,M = b i (1-p)σ 2 i
is the same as in the singleregime case, and the optimal consumption rate is c * i,M = (ϕ i,M ) -1 p . We take for values of the parameters p = 0.5,

q 12 = q 21 = 1, b 1 = b 2 = 0.4, σ 1 = 1, σ 2 = 2,
i.e. the difference between the two market regimes is the volatility of the asset. In Figure 2, we plot the value function and optimal consumption for each of the two regimes in this market, for various values of the liquidity parameters (λ 1 , λ 2 ). As in the single-regime case, when the liquidity increases, ϕ and c * converge to the Merton value.

To quantify the impact of regime-switching on the investor, it is also interesting to compare the cost of liquidity with the single-regime case, see Tables 2 and3. We observe that, for equivalent trading intensity, the cost of liquidity is higher in the regime-switching case. This is economically intuitive : in each regime the optimal investment proportion is different, so that the investor needs to rebalance his portfolio more often (at every change of regime).

(λ 1 , λ 2 ) P 1 (1) P 2 [START_REF] Arisawa | A remark on the definitions of viscosity solutions for the integro-differential equations with Lévy operators[END_REF] (1,1) 0.257 0.224 [START_REF] Giacinto | Pension funds with minimum guarantee: a stochastic control approach[END_REF][START_REF] Giacinto | Pension funds with minimum guarantee: a stochastic control approach[END_REF] 0.112 0.103 (10,10) 0.069 0.064 Define W as the space of continuous functions on R + , I the space of cadlag I d -valued functions, N the space of nondecreasing cadlag N-valued functions. On W × I × N , define the filtration (B 0 t ) t≥0 , where B 0 t is the smallest σ-algebra making the coordinate mappings for s ≤ t measurable, and define B 0 t+ = s>t B 0 s .

c * 2 (z) (λ 1 , λ 2 ) = (1, 1) (λ 1 , λ 2 ) = (10, 1) (λ 1 , λ 2 ) = (1, 10) (λ 1 , λ 2 ) = (10, 10) Merton
Lemma A.2 If c is F 0 -progressively measurable (resp. F 0 -predictable), there exists a B 0 t+progressively measurable (resp. B 0 t -predictable) process f c : R + × W × I × N → R, such that c t = f c (t, W .∧t , I .∧t , N .∧t ), for Pa.e ω, for all t ∈ R + Proof. For the progressively measurable part one can see e.g. Theorem 2.10 in [START_REF] Zhou | Stochastic controls, Hamiltonian systems and HJB equations[END_REF]. For c predictable, notice that this is true if c = X1 (t,s] , where X is F 0 t -measurable, and conclude with a monotone class argument. ✷ Proof of Proposition A.1. Let V i (x, y) be the right hand side of (A.1).

Step 1. v i (x, y) ≤ V i (x, y): Take U ∈ A w i (x, y). Then

E ∞ 0 e -ρt U (c t )dt |F τ = τ 0 e -ρt U (c t )dt + e -ρτ E ∞ 0 e -ρs U (c τ +s )ds |F τ . (A.2)
Remark A.1, w.l.o.g. we can assume that c is F 0 -progressively measurable (resp. ζ F 0 -predictable). For ω 0 ∈ Ω, define the shifted control Ũ ω 0 = (Ω, F τ , P ω 0 , Fτ t , W , Ĩ, Ñ , c, ζ), where :

• P ω 0 = P(.|F τ )(ω 0 ) • Wt = W τ +t -W τ • Ĩt = I τ +t • N ′ t = N τ +t -N τ
• F τ is the augmentation of F by the P ω 0 -null sets, and Fτ t is the augmented filtration generated by ( W , Ĩ, Ñ ).

• ct = c t+τ , ζt = ζ t+τ
Then we can check that for almost all ω 0 , Ũ ω 0 satisfies the conditions of Definition A.1 (with initial conditions (I τ (ω 0 ), X τ (ω 0 ), Y τ (ω 0 ))) : 2. comes from the independence of W and (I, N ) and the strong Markov property, and 4. is verified because for almost all ω 0 F 0 t+τ ⊂ Fτ t . Moreover, there is a modification (X ′ , Y ′ ) of (X, Y ) s.t. (X ′ τ +t , Y ′ τ +t ) is F τ -adapted, and a solution of (2.3)-(2.2) for ( W , Ĩ, Ñ ). Hence Ũ ω 0 ∈ A w Iτ (ω 0 ) (X τ (ω 0 ), Y τ (ω 0 )), and

E ∞ 0 e -ρs U (c τ +s )ds |F τ (ω 0 ) = J( Ũ ω 0 ) ≤ v Iτ (X τ , Y τ )(ω 0 ).
Hence taking the expectation over ω 0 in (A.2),

E ∞ 0 e -ρt U (c t )dt ≤ E τ 0 e -ρt U (c t )dt + e -ρτ v Iτ (X τ , Y τ ) ,
and taking the supremum over U , we obtain v i (x, y) ≤ V i (x, y).

Step 2. v i (x, y) ≥ V i (x, y): Recall that in the proof of Proposition 3.2 we only needed the DPP to prove the continuity of v i up to the boundary. Hence we know a priori that v i is continuous on Int(R 2 + ), and that the restriction of v i to the boundary is continuous. One can then find a countable sequence (U k ) k≥0 s.t.

(i) (U k ) k is a partition of R 2 + , (ii) ∀(x, y), (x ′ , y ′ ) ∈ U k , ∀i, |v i (x, y) -v i (x ′ , y ′ )| ≤ ε, (iii) U k contains its bottom-left corner (x k , y k ) = min (x,y)∈U k x, min (x,y)∈U k y .
Indeed, we can construct such a partition in the following way: v i is continuous on the boundary so we can partition each of the boundary lines into a countable number of segments verifying (ii) and (iii). Then in the interior we have first a partition in "squared rings" :

Int(R 2 + ) = ∪ n≥1 K n , where K n = [1/(n + 1), n + 1] 2 \ [1/n, n] 2 .
Since v i is continuous on the interior, we can partition each K n into a finite number of squares verifying (ii) and (iii). By taking the union of the line segments and the squares for each K n , we obtain a sequence (U k ) satisfying (i)-(iii).

Notice that (iii) implies the inclusion Then c (resp. ζ) is F-progressively measurable (resp. predictable). Furthermore, for almost all ω 0 , with i = I τ (ω 0 ) and (X τ , Y τ )(ω 0 ) ∈ U k ,

A i (x k , y k ) ⊂ A i (x, y), for all (x, y) ∈ U k . For each k, take U i,k = (Ω i,k , F i,k , P i,k , F i,k , W i,k , I i,k , N i,k , c i,k , ζ i,k ) ε-optimal for (i, x k , y k ),
L P ω 0 ( W , Ĩ, Ñ , (c t+τ ), ( ζt+τ )) = L P i,k (W i,k , I i,k , N i,k , c i,k , ζ i,k ),
and since and(c, ζ) ∈ A i (x, y). We also have

A i (x k , y k ) ⊂ A Iτ (ω 0 ) (X τ (ω 0 ), Y τ (ω 0 )), this implies X c, ζ t , Y c, ζ t ≥ 0 a.s.,
E ∞ 0 e -ρs U (c τ +s )ds |F τ (ω 0 ) = E i,k ∞ 0 e -ρs U (c i,k s )ds ≥ v i (x k , y k ) -ε ≥ v Iτ (X τ , Y τ )(ω 0 ) -2ε.
By taking expectation in (A.2), we have

E ∞ 0 e -ρt U (c t )dt ≥ E τ 0 e -ρt U (c t )dt + e -ρτ v Iτ (X τ , Y τ ) -2ε.
Finally, by taking the supremum over U , and letting ε go to 0, we obtain v i (x, y) ≥ V i (x, y). ✷ Remark A.2 Actually the weak value function is equal to the value function defined in (2.14) for any (Ω, F, P, F, W, I, N ) satisfying ( 1)-(3) in Definition A.1. Indeed, given any

U ′ = (Ω ′ , F ′ , P ′ , F ′ , W ′ , I ′ , N ′ ) ∈ A w i (x,
U ′ ∈A w i (x,y) J(U ′ ) = sup (c,ζ)∈A i (x,y) E ∞ 0 e -ρs U (c s )ds .
in (0, ∞) × R + × I d , and consider the sequence of stopping time: θ n = θ ∧ h n , where θ = inf t ≥ 0 : ( Xt , Ȳt , I t ) / ∈ V , and (h n ) is a strictly positive sequence converging to zero. From the dynamic programming principle (4.1), and by applying Itô's formula to e -ρt ϕ( Xt , Ȳt , I t ) between 0 and θ n , we get:

ϕ(x, ȳ, i) = v(x, y, i) ≥ E θn 0 e -ρt U (c t )dt + e -ρθn v( Xθn , Ȳθn , I θn ) ≥ E θn 0 e -ρt U (c t )dt + e -ρθn ϕ( Xθn , Ȳθn , I θn ) = ϕ(x, ȳ, i) + E θn 0 e -ρt U (c t ) -ρϕ -ct ∂ϕ ∂x + b I t -Ȳt - ∂ϕ ∂y + 1 2 σ 2 I t - Ȳ 2 t - ∂ 2 ϕ ∂y 2 + j =I t - q I t -j [ϕ( Xt -, Ȳt -(1 -γ I t -j ), j) -ϕ( Xt -, Ȳt -, I t -)] +λ I t -ϕ( Xt --ζt , Ȳt -+ ζt , I t -) -ϕ( Xt -, Ȳt -, I t -) dt ,
and so

E 1 h n θn 0 e -ρt ρϕ -U (c t ) + ct ∂ϕ ∂x -b I t -Ȳt - ∂ϕ ∂y - 1 2 σ 2 I t - Ȳ 2 t - ∂ 2 ϕ ∂y 2 - j =I t - q I t -j [ϕ( Xt -, Ȳt -(1 -γ I t -j ), j) -ϕ( Xt -, Ȳt -, I t -)] -λ I t -ϕ( Xt --ζt , Ȳt -+ ζt , I t -) -ϕ( Xt -, Ȳt -, I t -) dt ≥ 0 (B.2)
Now, we have almost surely for n large enough, θ ≥ h n , i.e. θ n = h n , so that by using also (B.1)

1 h n θn 0 e -ρt ρϕ -U (c t ) + ct ∂ϕ ∂x -b I t -Ȳt - ∂ϕ ∂y - 1 2 σ 2 I t - Ȳ 2 t - ∂ 2 ϕ ∂y 2 - j =I t - q I t -j [ϕ( Xt -, Ȳt -(1 -γ I t -j ), j) -ϕ( Xt -, Ȳt -, I t -)] -λ I t -ϕ( Xt --ζt , Ȳt -+ ζt , I t -) -ϕ( Xt -, Ȳt -, I t -) dt -→ ρϕ i (x, ȳ) -U (c) + c ∂ϕ i ∂x (x, ȳ) -b i ȳ ∂ϕ i ∂y (x, ȳ) - 1 2 σ 2 i ȳ2 ∂ 2 ϕ i ∂y 2 (x, ȳ) - j =i q ij [ϕ j (x, ȳ(1 -γ ij )) -ϕ i (x, ȳ)] -λ i [ϕ i (x -e, ȳ + e) -ϕ i (x, ȳ)], a.s.
when n goes to infinity. Moreover, since the integrand of the Lebesgue integral term in (B.2) is bounded for t ≤ θ, one can apply the dominated convergence theorem in (B.2), which gives:

ρϕ i (x, ȳ) -U (c) + c ∂ϕ i ∂x (x, ȳ) -b i ȳ ∂ϕ i ∂y (x, ȳ) - 1 2 σ 2 i ȳ2 ∂ 2 ϕ i ∂y 2 (x, ȳ) - j =i q ij [ϕ j (x, ȳ(1 -γ ij )) -ϕ i (x, ȳ)] -λ i [ϕ i (x -e, ȳ + e) -ϕ i (x, ȳ)] ≥ 0.
Since c and e are arbitrary, we obtain the required viscosity supersolution inequality by taking the supremum over c ∈ R + and e ∈ (-ȳ, x).

Viscosity subsolution:

Let ( ī, x, ȳ) ∈ I d × (0, ∞) × R + , ϕ = (ϕ i ) i∈I d , C 2 test functions s.t.
v(x, ȳ, ī) = ϕ(x, ȳ, ī), and v ≤ ϕ. We can also assume w.l.o.g. that v < ϕ outside (x, ȳ, ī). We argue by contradiction by assuming that

ρϕī(x, ȳ) -bī ȳ ∂ϕī ∂y (x, ȳ) - 1 2 σ 2 ī ȳ2 ∂ 2 ϕī ∂y 2 (x, ȳ) -Ũ ∂ϕī ∂x (x, ȳ) - j = ī qī j [ϕ j (x, ȳ(1 -γī j )) -ϕī(x, ȳ)] -λī[ φī(x + ȳ) -ϕī(x, ȳ)] > 0.
By continuity of ϕ, and of its derivatives, there exist some compact neighbourhood V of (x, ȳ, ī) in (0, ∞) × R + × I d , and ε > 0, such that

ρϕ i (x, y) -b i y ∂ϕ i ∂y (x, y) - 1 2 σ 2 i y 2 ∂ 2 ϕ i ∂y 2 (x, y) -Ũ ∂ϕ i ∂x (x, y) (B.3) - j =i q ij [ϕ j (x, y(1 -γ ij )) -ϕ i (x, y)] -λ i [ φi (x + y) -ϕ i (x, y)] ≥ ε, ∀(x, y, i) ∈ V.
Since v < ϕ outside (x, ȳ, ī), there exists some δ > 0 s.t. v < ϕδ outside of V. We can also assume that ε ≤ δρ. By the DPP (4.1), there exists

(ζ, c) ∈ Aī(x, ȳ) s.t. v(x, ȳ, ī) -ε 1 -e -ρ 2ρ ≤ E θ∧1 0 e -ρt U (c t )dt + e -ρ(θ∧1) v(X θ∧1 , Y θ∧1 , I θ∧1 ) ,
where (X, Y, I) is controlled by (ζ, c), and we take θ = inf t ≥ 0 : (X t , Y t , I t ) / ∈ V . We then get:

ϕ(x, ȳ, ī) -ε 1 -e -ρ 2ρ = v(x, ȳ, ī) -ε 1 -e -ρ 2ρ ≤ E θ∧1 0 e -ρt U (c t )dt + e -ρ(θ∧1) ϕ(X θ∧1 , Y θ∧1 , I θ∧1 ) -e -ρθ δ1 {θ<1} = ϕ(x, ȳ, ī) + E θ∧1 0 e -ρt U (c t ) -ρϕ -c t ∂ϕ ∂x + b I t -Y t - ∂ϕ ∂y + 1 2 σ 2 I t -Y 2 t - ∂ 2 ϕ ∂y 2 + j =I t - q I t -j [ϕ(X t -, Y t -(1 -γ I t -j ), j) -ϕ(X t -, Y t -, I t -)] +λ I t -ϕ(X t --ζ t , Y t -+ ζ t , I t -) -ϕ(X t -, Y t -, I t -) dt -e -ρθ δ1 {θ<1} ≤ ϕ(x, ȳ, ī) + E θ∧1 0 -εe -ρt dt -e -ρθ δ1 {θ<1}
where we applied Itô's formula in the second equality, and used (B.3) in the last inequality. This means that

-ε 1 -e -ρ 2ρ ≤ E θ∧1 0 -εe -ρt dt -e -ρθ δ1 {θ<1} = E - ε ρ + ε ρ e -ρ(θ∧1) -e -ρθ δ1 {θ<1} ≤ - ε ρ (1 -e -ρ ),
since ε/ρ ≤ δ, and we get the required contradiction. ✷

Let us now prove comparison principle for our dynamic programming system. As usual, it is convenient to formulate an equivalent definition for viscosity solutions to (4.2) in terms of semi-jets. We shall use the notation X = (x, y) for R + × R + -valued vectors. Given w = (w i ) i∈I d a d-tuple of continuous functions on R 2 + , the second-order superjet of w i at X ∈ R 2 + is defined by:

P 2,+ w i (X) = (p, A) ∈ R 2 × S 2 s.t. w i (X ′ ) ≤ w i (X) + p, X ′ -X + 1 2 A(X ′ -X), X ′ -X + o X ′ -X 2 as X ′ → X ,
and its closure P 2,+ w i (X) as the set of elements (p, A) ∈ R 2 × S 2 for which there ex-

ists a sequence (X m , p m , A m ) m of R 2 + × P 2,+ w i (X m ) satisfying (X m , p m , A m ) → (X, p, A).
We also define the second-order subjet P 2,-w i (X) = -P 2,+ (-w i )(X), and P 2,-w i (X) = -P 2,+ (-w i )(X). By standard arguments (see e.g. [START_REF] Arisawa | A remark on the definitions of viscosity solutions for the integro-differential equations with Lévy operators[END_REF] for equations with nonlocal terms), one has an equivalent definition of viscosity solutions in terms of semijets:

A d-tuple w = (w i ) i∈I d of continuous functions on R 2 + is a viscosity supersolution (resp. subsolution) of (4.2) if and only if for all (i, x, y) ∈ I d × (0, ∞) × R + , and all (p, A) ∈ P 2,-w i (x, y) (resp. P 2,+ w i (x, y)):

F i (x, y, w i (x, y), p, A) + G i (x, y, w) ≥ 0, (resp. ≤ 0).

We then prove the following comparison theorem.

Theorem B.1 Let V = (V i ) i∈I d (resp. W = (W i ) i∈I d
) be a viscosity subsolution (resp. supersolution) of (4.2), satisfying the growth condition (3.4), and the boundary conditions

V i (0, 0) ≤ 0 (B.4) V i (0, y) ≤ E i VI i τ 1 y S τ 1 S 0 , ∀y > 0, (B.5) (resp. ≥ for W ). Then V ≤ W .
Proof.

Step 1: Take p ′ > p such that k(p ′ ) < ρ, and define ψ i (x, y) = (x + y) p ′ , i ∈ I d . Let us check that W n = W + 1 n ψ is still a supersolution of (E). Notice that P 2,-W n i = P 2,-W i + 1 n (Dψ i , D 2 ψ i ), and we have for all (p, A) ∈ P In the next step, our aim is to show that for all n ≥ 1, V ≤ W n , which would imply that V ≤ W . We shall argue by contradiction.

Step 2: Assume that there exists some n ≥ 1 s.t. Note that by (B.4), (x, y) = (0, 0). We then have two possible cases:

M := sup

• Case 1 : x = 0. Notice that the boundary condition (B.5) implies the viscosity subsolution property for V i also at X = (0, ȳ):

F i ( X, V i ( X), p, A) + G i ( X, V ) ≤ 0, ∀(p, A) ∈ P 2,+ V i ( X)

However the viscosity supersolution property fot W n does not hold at (0, ȳ). Let (X k ) k = (x k , y k ) k be a sequence converging to X, with x k > 0, and ε k := X k -X . We then the function

Φ k (X, X ′ ) = V i (X) -W n i (X ′ ) -ψ k (X, X ′ ), ψ k (x, y, x ′ , y ′ ) = x 4 + (y -y) 4 + |X -X ′ | 2 2ε k + x ′ x k -1 3 -
Since Φ k is continuous, there exists ( X k , X ′ k ) ∈ C 2 s.t.

M k := sup C 2 Φ k = Φ k ( X k , X ′ k ),
and a subsequence, still denoted ( X k , X ′ k ), converging to some ( X, X ′ ) as k goes to ∞. By writing that Φ k (X, X k ) ≤ Φ k ( X k , X ′ k ), we have :

V i (X) -W n i (X k ) - X -X k 2 (B.9) ≤ V i ( X k ) -W n i ( X ′ k ) -(x 4 k + (ŷ k -y) 4 ) -R k (B.10) ≤ V i ( X k ) -W n i ( X ′ k ) -(x 4 k + (ŷ k -y) 4 ), (B.11)
where we set

R k = X k -X ′ k 2 2ε k + x′ k x k -1 3 -
Since V i and W n i are bounded on C, we deduce by inequality (B.10) the boundedness of the sequence (R k ) k≥0 , which implies X = X ′ . Then by sending k to infinity in (B.9) and (B.11), with the continuity of V i and W n i , we obtain M = V i (X) -W n i (X) ≤ V i ( X) -W n i ( X) -(x 4 k + (ŷ ky) 4 ), and by definition of M this shows X = X ′ = X (B.12)

Sending again k to infinity in (B.9)-(B.10)-(B.11), we obtain M ≤ Mlim sup k R k ≤ M , and so

X k -X ′ k 2 2ε k + x ′ k x k -1 3 - → 0, (B.13)
as k goes to infinity. In particular for k large enough x′ k ≥ x k 2 > 0. We can then apply Ishii's lemma (see Theorem 3.2 in [START_REF] Crandall | User's Guide to Viscosity Solutions of Second Order Partial Differential Equations[END_REF]) to obtain A, A ′ ∈ S 2 s.t.

(p, A) ∈ P 2,+ V i ( X k ), p ′ , A ′ ∈ P 2,-W n i ( X ′ k ) (B.14)

A 0 0 -A ′ ≤ D + ε k D 2 , (B .15)
where

p = D X ψ k ( X k , X ′ k ), p ′ = D X ′ ψ k ( X k , X ′ k ), D = D 2 X,X ′ ψ k ( X k , X ′ k ).
Now, we write

ρM ≤ ρM k ≤ ρ(V i ( Xk ) -W n i ( X ′ k )) = F i X k , V i ( X k ), p, A -F i X k , W n i ( X ′ k ), p, A = F i X k , V i ( X k ), p, A + G i ( X k , V ) (B.16) -F i X ′ k , W n i ( X ′ k ), p ′ , A ′ -G i ( X ′ k , W n ) + G i ( X ′ k , W n ) -G i ( X k , V ) + F i X ′ k , W n i ( X ′ k ), p ′ , A ′ -F i X k , W n i ( X ′ k ), p, A
From the viscosity subsolution property for V at Xk , and the viscosity supersolution property for W n at X′ k , the first two lines in the r.h.s. of (B.16) are nonpositive. For the third line, by sending k to infinity, we have:

G i ( X ′ k , W n ) -G i ( X k , V ) → G i (X, W n ) -G i (X, V ) = j =i q ij (V j -W n j ) x, y(1 -γ ij ) -(V i -W n i )(x, y)
+λ i Vi -Ŵ n i (x + y) -(V i -W n i )(x, y) ≤ 0 by (B.8). For the fourth line of (B.16), we have where we used again (B.12) and (B.13), and the boundedness of ( y k , y ′ k ).

F i X ′ k , W n i ( X ′ k ), p ′ , A ′ -F i X k , W n i ( X ′ k ), p, A = b i (ŷ k p 2 -ŷ′ k p ′ 2 ) + Ũ (p 1 ) -Ũ (p ′ 1 ) + σ 2 i 2 ŷ2 k a 22 -( y ′ k ) 2 a ′ 22 Now ŷk p 2 -ŷ′ k p ′ 2 = y k 4(ŷ k -y) 3 + ŷk -ŷ′ k ε k -ŷ′ k ŷk -ŷ′ k ε k ≤ 4ŷ k (ŷ k -y) 3 + X k -x′ k 2 ε k → 0, as k → ∞,
ε k 0 -1 ε k -1 ε k 0 1 ε k + 6 x 2 k x ′ x k -1 - 0 0 -1 ε k 0 -1 ε k       ,
Finally by letting k go to infinity in (B. [START_REF] Protter | Stochastic Integration and Differential Equations[END_REF]) we obtain ρM ≤ 0, which is the required contradiction.

• Case 2 : x > 0. This is the easier case, and we can obtain a contradiction similarly as in the first case, by considering for instance the function

Φ k (X, X ′ ) = V i (X) -W n i (X ′ ) -(x -x) 4 -(y -y) 4 -k |X -X ′ | 2 2 .
✷

Proposition 3. 1

 1

Proposition 4 . 1 (

 41 Dynamic programming principle) For all (x, y, i) ∈ R 2 + × I d , and any stopping time τ , we have

Theorem 4 . 1

 41 The value function v = (v i ) i∈I d is the unique viscosity solution to (4.2) satisfying the boundary condition (3.8), and the growth condition (3.4).

Lemma 5 . 1

 51 For any i ∈ I d , let us define:

θ 1

 1 ∧1 c,ζ from Lemma 3.1, we obtain the relation (5.26).

1 :

 1 Value function ϕ(z) (left) and optimal consumption rate c * (z)(right) for different values of λ

Figure 2 :

 2 Figure 2: ϕ i and c * i for different values of (λ 1 , λ 2 )

  and f i,k c , f i,k ζ associated to (c i,k , ζ i,k ) by Lemma A.2. Then for each (c, ζ) ∈ A i (x, y), let us define c, ζ by :ct = c t when t < τ f i,k c (tτ, W (. ∧ (tτ )), Ĩ(. ∧ (tτ )), Ñ (. ∧ (tτ ))) when t ≥ τ, I τ = i, (X τ , Y τ ) ∈ U k .

  y), letting f c ′ and f ζ ′ being associated to c ′ and ζ ′ by Lemmas A.1 and A.2, and defining (almost surely) c t = f c ′ (t, W, I, N ), ζ t = f ζ ′ (t, W, I, N ), by the same arguments as in the Proof of Proposition A.1, U := (Ω, F, P, F, W, I, N, c, ζ) ∈ A w i (x, y), and J(U ) = J(U ′ ). Hence sup

  three lines in the r.h.s. of (B.6) are nonnegative: the first one since W is a supersolution, the second one by k(p ′ ) < ρ, and the last one since Ũ is nonincreasing.Moreover, by the growth condition (3.4) on V and W , we have:lim r→∞ max i∈I d ( Vi -Ŵ n i )(r) = -∞. (B.7)

i∈I d ,(x,y)∈R 2 +

 2 (V i -W n i )(x, y) > 0.By (B.7), there exists i ∈ I d , some compact subset C of R 2 + , and X = (x, y) ∈ C such thatM = max C (V i -W n i ) = (V i -W n i )(x, y). (B.8)

D 2

 2 by (B.12) and (B.13). Moreover,Ũ (p 1 ) -Ũ (p ′ 1 ) = Ũ xk -x′ k ψ k (x, y, x ′ , y ′ ) = y) 2 + 1

  -ŷ′ k ) 2 -12(ŷ ky) 2 ŷk ŷ′ k + 36(ŷ ky) 2 + ε k 12(ŷ ky) 2 ŷ2 k → 0, as k → ∞,

Table 1 :

 1 Cost of liquidity P (1) as a function of

	λ Discrete observation Continuous observation
	1	0.275	0.153
	5	0.121	0.016
	40	0.054	0.001

Table 2 :

 2 Cost of liquidity P i (1) as a function of (λ 1 , λ 2 ).

	λ P 1 (1) P 2 (1)
	1 0.153 0.087
	5 0.015 0.042
	10 0.004 0.024

Table 3 :

 3 Cost of liquidity P i (1) for the single-regime case.

			ϕ 1 (z)						ϕ 2 (z)
	1.9
	1.7
	1.5
	1.3
			c * 1 (z)
	0.4
	0.3
	0.2
	0.1
	0.0
	0	0.2	0.4	0.6	0.8	1	0	0.2	0.4	0.6	0.8	1

  2,-W i (x, y):F i x, y, W n i (x, y), p + 1 n Dψ i , A + 1 n D 2 ψ i + G i (x, y, W n ) = F i x, y, W i (x, y), p, A) + G i (x, y, W )

	+	1 n	(x + y) p ′ ρ -p ′ b i	y x + y	+ p ′ (1 -p ′ )	σ 2 i 2	y x + y

Appendix A: Dynamic Programming Principle

We introduce the weak formulation of the control problem.

Definition A.1 Given (i, x, y) ∈ I d × R + × R + , a control U is a 9-tuple (Ω, F, P, F = (F t ) t≥0 , W, I, N, c, ζ), where :

1. (Ω, F, P, F) is a filtered probability space satisfying the usual conditions.

2. I is a Markov chain with space state I d and generator Q, I 0 = i a.s., N is a Cox process with intensity (λ It ), and W is an F-Brownian motion independent of (I, N ).

3.

where N is the collection of all P-null sets of F.

We say that U is admissible, (writing

∞ 0 e -ρs U (c s )ds , and the value function

Proposition A.1 For every finite stopping time τ and initial conditions i, x, y,

Before proving this proposition we state some technical lemmas.

Lemma A.1 Given (Ω, F, P, F = (F t ), W, I, N ) satisfying the conditions of Definition A.1, define F 0 = (F 0 t ) t≥0 , where F 0 t = σ(W s , I s , N s ; s ≤ t). Then if (c t ) is F-progressively measurable (resp. predictable), there exists c 1 F 0 -progressively measurable (resp. predictable) such that c = c 1 dP ⊗ dt a.e.. Proof. We only give a sketch as the arguments is standard. We first use Lemma 3.2.4 page 133 in [START_REF] Karatzas | Brownian motion and stochastic calculus[END_REF] to find, for each n ∈ N, an approximating F t -simple process c n converging to c in the L 2 (dt ⊗ dP) norm. Then, using Lemma 1.25 page 13 in [START_REF] Kallenberg | Foundations of modern probability[END_REF], we can change every c n on a null-set and find a sequence of F t,0 s -simple process c n 1 (t) that again converges to c in the L 2 (dt ⊗ dP) norm. We now extract a subsequence (denoted again by n 1 ) such that c n 1 → c a.e. and we define c 1 := lim inf n→+∞ c n 1 . This is F t,0 s -progressively measurable and c = c 1 , dt ⊗ dP a.e. on [0, +∞) × Ω. This concludes the proof. ✷ Remark A.1 With the notations of the previous lemma, it is easy to check that (

Hence without loss of generality we can assume that c is F 0progressively measurable and ζ is F 0 -predictable.

Appendix B: Viscosity characterization

We first prove the viscosity property of the value function to its dynamic programming system (4.2), written as:

for any i ∈ I d , where F i is the local operator defined by:

Proof. Viscosity supersolution:

), and v ≥ ϕ. Take some arbitrary e ∈ (-ȳ, x), and c ∈ R + . Since x > 0, there exists a strictly positive stopping time τ > 0 a.s. such that the control process ( ζ, c) defined by: ζt = e1 t≤τ , ct = c1 t≤τ , t ≥ 0, (B.1) with associated state process ( X, Ȳ , I) starting from (x, y, i) at time 0, satisfies Xt ≥ 0, Ȳt ≥ 0, for all t. Thus, ( ζ, c) ∈ A i (x, y). Let V be a compact neighbourhood of (x, y, i)