Proofs
1.1 The optimal process
Following Carpenter (2000), the optimal strategy can be computed for any \(t\in [0,T]\) as
$$\begin{aligned} X^*(t) =X^*(t,r(t),\zeta (t)) = \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}I(\lambda \zeta (T))\right] . \end{aligned}$$
where I is the inverse function of \(U^\prime \) [U being the function introduced in (14)] and \(\lambda \) solves \(\mathbb {E}[\zeta (T) I(\lambda \zeta (T))]=X_0\). Since U is not differentiable in \(x=K\), \(U^\prime \) denotes the set-valued first derivative of U given in Eq. (18). Let us also use the notation
$$\begin{aligned} i(z):=(u')^{-1}(z)=z^{\frac{1}{\gamma -1}}. \end{aligned}$$
Consequently,
$$\begin{aligned} I(z)={\left\{ \begin{array}{ll} \frac{1}{\alpha } i\left( \frac{z}{\alpha }\right) -\frac{H}{\alpha }, \quad z<U_{\scriptscriptstyle +}^\prime (K)\\ K, \qquad U_{\scriptscriptstyle +}^\prime (K) \le z \le U_{\scriptscriptstyle -}^\prime (K)\\ \frac{1}{\alpha +1} i\left( \frac{z}{\alpha +1}\right) + \frac{K-H}{\alpha +1}, \quad z> U_{\scriptscriptstyle -}^\prime (K). \end{array}\right. } \end{aligned}$$
(33)
Taking into account (33), the optimal process then becomes
$$\begin{aligned} X^*(t)= & {} \frac{1}{\alpha } \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} i\left( \frac{\lambda \zeta (T)}{\alpha }\right) \mathbf{{1}}_{\lambda \zeta (T)<U_{\scriptscriptstyle +}^\prime (K)} \right] - \frac{H}{\alpha } \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} \mathbf{{1}}_{\lambda \zeta (T)<U_{\scriptscriptstyle +}^\prime (K)} \right] \nonumber \\&+ K\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}{} \mathbf{{1}}_{ U_{\scriptscriptstyle +}^\prime (K)<\lambda \zeta (T)<U_{\scriptscriptstyle -}^\prime (K)}\right] + \frac{1}{\alpha +1} \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}i\left( \frac{\lambda \zeta (T)}{\alpha +1}\right) \mathbf{{1}}_{ \lambda \zeta (T)>U_{\scriptscriptstyle -}^\prime (K)} \right] \nonumber \\&+ \frac{K-H}{\alpha +1} \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}{} \mathbf{{1}}_{ \lambda \zeta (T)>U_{\scriptscriptstyle -}^\prime (K)} \right] . \end{aligned}$$
(34)
Concerning the first term, we have
$$\begin{aligned} \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} i\left( \frac{\lambda \zeta (T)}{\alpha }\right) \mathbf{{1}}_{\lambda \zeta (T)<U_{\scriptscriptstyle +}^\prime (K)} \right] = \left( \frac{\lambda \zeta (t)}{\alpha }\right) ^{\frac{1}{\gamma -1}} \mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^{\frac{\gamma }{\gamma -1}} \mathbf{{1}}_{\frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle +}^\prime (K)}{\lambda \zeta (t)}}\right] .\nonumber \\ \end{aligned}$$
(35)
For the second term, we have
$$\begin{aligned} \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} \mathbf{{1}}_{\lambda \zeta (T)<U_{\scriptscriptstyle +}^\prime (K)} \right] = \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} \mathbf{{1}}_{ \frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle +}^\prime (K)}{\lambda \zeta (t)}} \right] \end{aligned}$$
(36)
For the third term, we have
$$\begin{aligned} \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}{} \mathbf{{1}}_{ U_{\scriptscriptstyle +}^\prime (K)<\lambda \zeta (T)<U_{\scriptscriptstyle -}^\prime (K)}\right] = \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} \mathbf{{1}}_{\frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle -}^\prime (K)}{\lambda \zeta (t)}}\right] - \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} \mathbf{{1}}_{\frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle +}^\prime (K)}{\lambda \zeta (t)}}\right] .\nonumber \\ \end{aligned}$$
(37)
Concerning the fourth term, we have
$$\begin{aligned}&\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} i\left( \frac{\lambda \zeta (T)}{\alpha +1}\right) \mathbf{{1}}_{\lambda \zeta (T)>U_{\scriptscriptstyle -}^\prime (K)} \right] = \left( \frac{\lambda \zeta (t)}{\alpha +1}\right) ^{\frac{1}{\gamma -1}} \mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^{\frac{\gamma }{\gamma -1}} \mathbf{{1}}_{\frac{\zeta (T)}{\zeta (t)}>\frac{U_{\scriptscriptstyle -}^\prime (K)}{\lambda \zeta (t)}}\right] \nonumber \\&\quad = \left( \frac{\lambda \zeta (t)}{\alpha +1}\right) ^{\frac{1}{\gamma -1}} \left( \mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^{\frac{\gamma }{\gamma -1}} \right] - \mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^{\frac{\gamma }{\gamma -1}} \mathbf{{1}}_{\frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle -}^\prime (K)}{\lambda \zeta (t)}}\right] \right) . \end{aligned}$$
(38)
Concerning the last term we have
$$\begin{aligned}&\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}{} \mathbf{{1}}_{ \lambda \zeta (T)>U_{\scriptscriptstyle -}^\prime (K)} \right] = \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}\right] -\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}{} \mathbf{{1}}_{ \frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle -}^\prime (K)}{\lambda \zeta (t)}} \right] . \end{aligned}$$
(39)
We then proceed through the estimation of
$$\begin{aligned} \mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^\Gamma \right] \quad \text {and} \quad \mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^\Gamma \mathbf{{1}}_{ \frac{\zeta (T)}{\zeta (t)}<\Lambda } \right] , \end{aligned}$$
for \(\Gamma ,\Lambda \in \mathbb {R}\) (in our case \(\Gamma \) will be 1 or \(\gamma /(\gamma -1)\) and \(\Lambda \) will be \(\frac{U_{\scriptscriptstyle -}^\prime (K)}{\lambda \zeta (t)}\) or \(\frac{U_{\scriptscriptstyle +}^\prime (K)}{\lambda \zeta (t)})\).
1.1.1 Stochastic interest rate
Notice that r is stochastic and it is given by the Vasicek dynamics the state price density becomes
$$\begin{aligned} \frac{\zeta (T)}{\zeta (t)}= \exp \left\{ - \frac{1}{2}\left( \theta _1^2 + \theta _2^2 \eta \right) (T-t) - \int _t^T r(s) \mathrm{d}s -\int _t^T \theta _1 \mathrm{d}z(s) - \int _t^T \theta _2 \sqrt{\eta } \mathrm{d}z_r(s)\right\} \nonumber \\ \end{aligned}$$
(40)
where r(t) satisfies the SDE
$$\begin{aligned} \mathrm{d}r(t)= (a-br(t))\mathrm{d}t- \sqrt{\eta } \mathrm{d}z_r(t). \end{aligned}$$
Following the lines of Deelstra et al. (2003, Proof of Lemma 5), we substitute \(\sqrt{\eta } \mathrm{d}z_r(t)\) in Eq. (40) by
$$\begin{aligned} \sqrt{\eta } \mathrm{d}z_r(t) = (a-br(t))\mathrm{d}t- \mathrm{d}r(t) \end{aligned}$$
to obtain
$$\begin{aligned} \frac{\zeta (T)}{\zeta (t)}=&\exp \left\{ - \frac{1}{2}\left( \theta _1^2 + \theta _2^2 \eta \right) (T-t)\right\} \exp \Bigg \{ -\int _t^T a \theta _2 \mathrm{d}s - \int _t^T (1-b\theta _2) r(s) \mathrm{d}s \\&-\theta _1 (z(T)-z(t)) + \theta _2 (r(T)-r(t))\Bigg \} \\ =&\exp \left\{ -\left( \frac{1}{2}\left( \theta _1^2 + \theta _2^2 \eta \right) +\theta _2 a\right) (T-t)-\theta _2 r(t)\right\} \\&\exp \left\{ -\int _t^T (1-b\theta _2) r(s) \mathrm{d}s -\theta _1 (z(T)-z(t)) + \theta _2 r(T)\right\} \\ =&f(t) \exp \left\{ -V(t)\right\} , \end{aligned}$$
where
$$\begin{aligned} f(t)= \exp \left\{ -\left( \frac{1}{2}\left( \theta _1^2 + \theta _2^2 \eta \right) +\theta _2 a\right) (T-t)-\theta _2 r(t)\right\} , \end{aligned}$$
and
$$\begin{aligned} V(t)=\int _t^T (1-b\theta _2) r(s) \mathrm{d}s +\theta _1 (z(T)-z(t)) - \theta _2 r(T) . \end{aligned}$$
We thus have
$$\begin{aligned}&\mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^\Gamma \right] = f(t)^{\Gamma } \mathbb {E}_t\left[ e^{-\Gamma V(t)} \right] , \\&\mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^\Gamma \mathbf{{1}}_{ \frac{\zeta (T)}{\zeta (t)}<\Lambda } \right] = f(t)^{\Gamma }\mathbb {E}_t\left[ e^{-\Gamma V(t)} \mathbf{{1}}_{ e^{-V(t)}<\frac{\Lambda }{f(t)}} \right] , \end{aligned}$$
for any \(\Gamma ,\Lambda \in \mathbb {R}\).
We notice, as in Deelstra et al. (2003, Proof of Lemma 2), that V(t) is a Gaussian with mean
$$\begin{aligned} \mu= & {} \mathbb {E}_t \left[ V(t)\right] = (1-\theta _2 b) \left[ \left( \frac{1-e^{-b(T-t)}}{b}\right) r(t) + \frac{a}{b}(T-t)-\frac{a}{b^2}(1-e^{-b(T-t)})\right] \\&-\theta _2 e^{-b(T-t)} r(t) - \theta _2\frac{a}{b}(1-e^{-b(T-t)}), \end{aligned}$$
that is
$$\begin{aligned} \mu =\frac{1-\theta _2 b-e^{-b(T-t)}}{b}r (t) + \frac{a}{b}(T-t)(1-\theta _2b)- \frac{a}{b^2}(1-e^{-b(T-t)}) \end{aligned}$$
(41)
and variance
$$\begin{aligned} \begin{aligned} \sigma ^2 =\,&VAR(V(t))= (1-b\theta _2)^2 VAR\left( \int _t^T r(s)\mathrm{d}s\right) +\theta _1^2 (T-t) +\theta _2^2 VAR(r(T))\\&- 2(1-b\theta _2)\theta _2 COV\left( \int _t^T r(s)\mathrm{d}s,r(T)\right) \\ =\,&(1-b\theta _2)^2 \eta \int _t^T \left( \frac{1-e^{-b(T-s)}}{b}\right) ^2 \mathrm{d}s +\theta _1^2 (T-t)+ \theta _2^2\frac{\eta }{2b}\left( 1-e^{-2b(T-t)}\right) \\&- 2\theta _2 (1-b\theta _2) \eta \int _t^T e^{-b(T-s)}\left( \frac{1-e^{-b(T-s)}}{b}\right) \mathrm{d}s . \end{aligned} \end{aligned}$$
(42)
Consequently, we can write
$$\begin{aligned}&\mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^\Gamma \right] = f(t)^{\Gamma } \mathbb {E}_t\left[ e^{-\Gamma V(t)} \right] =f(t)^{\Gamma } e^{-\Gamma \mu +\frac{\Gamma ^2\sigma ^2}{2}}. \end{aligned}$$
Now we calculate
$$\begin{aligned} \mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^\Gamma \mathbf{{1}}_{ \frac{\zeta (T)}{\zeta (t)}<\Lambda } \right] = f(t)^{\Gamma } \mathbb {E}_t\left[ e^{-\Gamma V(t)} \mathbf{{1}}_{e^{-V(t)}<\frac{\Lambda }{f(t)}} \right] . \end{aligned}$$
With an abuse of notation we replace \(\Lambda /f(t)\) with \(\Lambda \) and we proceed by estimating
$$\begin{aligned} \mathbb {E}_t \left[ e^{-\Gamma V(t)} \mathbf{{1}}_{e^{-V(t)}<\Lambda }\right] . \end{aligned}$$
Taking into account that V(t) is Gaussian with mean \(\mu \) and variance \(\sigma \) as in (41) and (42), we have
$$\begin{aligned} \mathbb {E}_t \left[ e^{-\Gamma V(t)} \mathbf{{1}}_{e^{-V(t)}<\Lambda }\right]&= \mathbb {E}_t \left[ e^{-\Gamma V(t)} \mathbf{{1}}_{-V(t)< \ln (\Lambda ) }\right] = \mathbb {E}_t \left[ e^{-\Gamma V(t)} \mathbf{{1}}_{V(t)>-\ln (\Lambda ) }\right] \\&= \int _{-\ln (\Lambda ) }^{+\infty } \frac{1}{\sqrt{2\pi } \sigma } e^{-\Gamma v} e^{-\frac{1}{2}\left( \frac{v-\mu }{\sigma }\right) ^2 }\mathrm{d}v\\&= e^{-\Gamma \mu +\frac{\Gamma ^2\sigma ^2}{2}} \int _{-\ln (\Lambda )}^{+\infty } \frac{1}{\sqrt{2\pi } \sigma } e^{-\frac{1}{2}\left( \frac{v+(\Gamma \sigma ^2-\mu )}{\sigma }\right) ^2} \mathrm{d}v\\&= e^{-\Gamma \mu +\frac{\Gamma ^2\sigma ^2}{2}} \int _{\frac{-\ln (\Lambda ) -\mu }{\sigma } +\Gamma \sigma }^{+\infty } \frac{1}{\sqrt{2\pi }} e^{-\frac{1}{2}y^2 }\mathrm{d}v= e^{-\Gamma \mu +\frac{\Gamma ^2\sigma ^2}{2}} N(d- \Gamma \sigma ), \end{aligned}$$
where \(d= \frac{\ln (\Lambda )+\mu }{\sigma }\).
We are now able to determine the expectations (33)–(39) in the case Vasicek setting. Thanks to the calculation above, we have
$$\begin{aligned}&\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} i\left( \frac{\lambda \zeta (T)}{\alpha }\right) \mathbf{{1}}_{\lambda \zeta (T)<U_{\scriptscriptstyle +}^\prime (K)} \right] = \left( \frac{\lambda \zeta (t)}{\alpha }\right) ^{\frac{1}{\gamma -1}} \mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^{\frac{\gamma }{\gamma -1}} \mathbf{{1}}_{\frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle +}^\prime (K)}{\lambda \zeta (t)}}\right] \\&\qquad \qquad = \left( \frac{\lambda \zeta (t)f(t)}{\alpha }\right) ^{\frac{1}{\gamma -1}} f(t) e^{-\frac{\gamma }{\gamma -1}\mu + \frac{\gamma ^2}{2(\gamma -1)^2}\sigma ^2} N\left( d^{\scriptscriptstyle +} - \frac{\gamma }{\gamma -1}\sigma \right) , \end{aligned}$$
where
$$\begin{aligned} d^{\scriptscriptstyle +}:= \frac{\ln \frac{U_{\scriptscriptstyle +}^\prime (K)}{\lambda \zeta (t)f(t)} +\mu }{\sigma }. \end{aligned}$$
Concerning (36) we have
$$\begin{aligned}&\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}{} \mathbf{{1}}_{ \lambda \zeta (T)<U_{\scriptscriptstyle +}^\prime (K)} \right] = \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}{} \mathbf{{1}}_{ \frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle +}^\prime (K)}{\lambda \zeta (t)}} \right] \\&\quad \quad = f(t) e^{-\mu + \frac{\sigma ^2}{2}} N\left( d^{\scriptscriptstyle +}-\sigma \right) . \end{aligned}$$
For (37) we have
$$\begin{aligned}&\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}{} \mathbf{{1}}_{ U_{\scriptscriptstyle +}^\prime (K)<\lambda \zeta (T)<U_{\scriptscriptstyle -}^\prime (K)}\right] = \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} \mathbf{{1}}_{\frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle -}^\prime (K)}{\lambda \zeta (t)}}\right] - \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} \mathbf{{1}}_{\frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle +}^\prime (K)}{\lambda \zeta (t)}}\right] \\&\qquad \qquad = f(t) e^{-\mu +\frac{\sigma ^2}{2}} \left( N(d^{\scriptscriptstyle -} -\sigma ) - N(d^{\scriptscriptstyle +} - \sigma ) \right) , \end{aligned}$$
with \(d^{\scriptscriptstyle +}\) as above and
$$\begin{aligned} d^{\scriptscriptstyle -}= \frac{\ln \frac{U_{\scriptscriptstyle -}^\prime (K)}{\lambda \zeta (t)f(t)} +\mu }{\sigma }. \end{aligned}$$
Concerning (38), we have
$$\begin{aligned}&\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} i\left( \frac{\lambda \zeta (T)}{\alpha +1}\right) \mathbf{{1}}_{\lambda \zeta (T)>U_{\scriptscriptstyle -}^\prime (K)} \right] \\&\quad = \left( \frac{\lambda \zeta (t)}{\alpha +1}\right) ^{\frac{1}{\gamma -1}} \left( \mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^{\frac{\gamma }{\gamma -1}} \right] - \mathbb {E}_t\left[ \left( \frac{\zeta (T)}{\zeta (t)}\right) ^{\frac{\gamma }{\gamma -1}} \mathbf{{1}}_{\frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle -}^\prime (K)}{\lambda \zeta (t)}}\right] \right) \\&\quad = \left( \frac{\lambda \zeta (t)f(t)}{\alpha +1}\right) ^{\frac{1}{\gamma -1}} f(t) e^{-\frac{\gamma }{\gamma -1}\mu + \frac{\gamma ^2}{2(\gamma -1)^2}\sigma ^2} \left( 1- N\left( d^{\scriptscriptstyle -}-\frac{\gamma }{\gamma -1}\sigma \right) \right) . \end{aligned}$$
Concerning (39) we have
$$\begin{aligned}&\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}{} \mathbf{{1}}_{ \lambda \zeta (T)>U_{\scriptscriptstyle -}^\prime (K)} \right] = \mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}\right] -\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)}{} \mathbf{{1}}_{ \frac{\zeta (T)}{\zeta (t)}<\frac{U_{\scriptscriptstyle -}^\prime (K)}{\lambda \zeta (t)}} \right] \\&\quad = f(t) e^{-\mu + \frac{\sigma ^2}{2}} \left( 1- N\left( d^{\scriptscriptstyle -}-\sigma \right) \right) . \end{aligned}$$
Finally, we notice that
$$\begin{aligned} \frac{N^\prime (d^{\scriptscriptstyle +}-\sigma )}{N^\prime \left( d^{\scriptscriptstyle +}-\frac{\gamma }{\gamma -1}\sigma \right) } = \left( \frac{\lambda \zeta (t) f(t)}{U_{\scriptscriptstyle +}^\prime (K)} \right) ^{\frac{1}{\gamma -1}} e^{-\frac{\gamma }{\gamma -1}\mu + \frac{\gamma ^2}{2(\gamma -1)^2}\sigma ^2} e^{\mu - \frac{\sigma ^2}{2}}, \end{aligned}$$
or, equivalently,
$$\begin{aligned} (U_{\scriptscriptstyle +}^\prime (K))^{\frac{1}{\gamma -1}} e^{-\mu + \frac{\sigma ^2}{2}} \frac{N^\prime (d^{\scriptscriptstyle +}-\sigma )}{N^\prime \left( d^{\scriptscriptstyle +}-\frac{\gamma }{\gamma -1}\sigma \right) } = \left( \lambda \zeta (t) f(t) \right) ^{\frac{1}{\gamma -1}} e^{-\frac{\gamma }{\gamma -1}\mu + \frac{\gamma ^2}{2(\gamma -1)^2}\sigma ^2}, \end{aligned}$$
and, analogously,
$$\begin{aligned} (U_{\scriptscriptstyle -}^\prime (K))^{\frac{1}{\gamma -1}} e^{-\mu + \frac{\sigma ^2}{2}} \frac{N^\prime (d^{\scriptscriptstyle -}-\sigma )}{N^\prime \left( d^{\scriptscriptstyle -}-\frac{\gamma }{\gamma -1}\sigma \right) } = \left( \lambda \zeta (t) f(t) \right) ^{\frac{1}{\gamma -1}} e^{-\frac{\gamma }{\gamma -1}\mu + \frac{\gamma ^2}{2(\gamma -1)^2}\sigma ^2}. \end{aligned}$$
Hence, (35) and (38) become
$$\begin{aligned}&\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} i\left( \frac{\lambda \zeta (T)}{\alpha }\right) \mathbf{{1}}_{\lambda \zeta (T)<U_{\scriptscriptstyle +}^\prime (K)} \right] \\&\quad = \left( \frac{U_{\scriptscriptstyle +}^\prime (K))}{\alpha }\right) ^{\frac{1}{\gamma -1} } f(t)e^{-\mu + \frac{\sigma ^2}{2}} \frac{N^\prime (d^{\scriptscriptstyle +}-\sigma )}{N^\prime \left( d^{\scriptscriptstyle +}-\frac{\gamma }{\gamma -1}\sigma \right) } N\left( d^{\scriptscriptstyle +} - \frac{\gamma }{\gamma -1}\sigma \right) ,\\&\mathbb {E}_t\left[ \frac{\zeta (T)}{\zeta (t)} i\left( \frac{\lambda \zeta (T)}{\alpha +1}\right) \mathbf{{1}}_{\lambda \zeta (T)>U_{\scriptscriptstyle -}^\prime (K)} \right] \\&\quad = \left( \frac{U_{\scriptscriptstyle -}^\prime (K)}{\alpha +1}\right) ^{\frac{1}{\gamma -1}} f(t)e^{-\mu + \frac{\sigma ^2}{2}} \frac{N^\prime (d^{\scriptscriptstyle -}-\sigma )}{N^\prime \left( d^{\scriptscriptstyle -}-\frac{\gamma }{\gamma -1}\sigma \right) } \left( 1- N\left( d^{\scriptscriptstyle -}-\frac{\gamma }{\gamma -1}\sigma \right) \right) . \end{aligned}$$
Summing up, the optimal process is given by
$$\begin{aligned} \begin{aligned} X^*(t)=&f(t)e^{-\mu + \frac{\sigma ^2}{2}} \left( \frac{\alpha K+H}{\alpha }\frac{N^\prime (d^{\scriptscriptstyle +}-\sigma )}{N^\prime \left( d^{\scriptscriptstyle +}-\frac{\gamma }{\gamma -1}\sigma \right) } N\left( d^{\scriptscriptstyle +} - \frac{\gamma }{\gamma -1}\sigma \right) \right. \\&+K\left( N(d^{\scriptscriptstyle -} -\sigma ) - N(d^{\scriptscriptstyle +} - \sigma ) \right) \\&+ \left. \frac{\alpha K+H}{\alpha +1} \frac{N^\prime (d^{\scriptscriptstyle -}-\sigma )}{N^\prime \left( d^{\scriptscriptstyle -}-\frac{\gamma }{\gamma -1}\sigma \right) }\left( 1- N\left( d^{\scriptscriptstyle -}-\frac{\gamma }{\gamma -1}\sigma \right) \right) \right. \\&+\frac{K}{\alpha +1} (1-N(d^{\scriptscriptstyle -}-\sigma )) \\&\left. -H \left( \frac{1}{\alpha } N(d^{\scriptscriptstyle +}-\sigma ) + \frac{1}{\alpha +1} (1- N(d^{\scriptscriptstyle -}-\sigma ) )\right) \right) . \end{aligned} \end{aligned}$$
(43)
1.2 The optimal portfolio
Following Karatzas and Shreve (1998, Theorem 3.7.3), the optimal portfolio \(\varvec{\pi }=(\pi ^S,\pi ^B)^\top \) is given by
$$\begin{aligned} \Sigma ^\top \varvec{\pi }(t)= \frac{1}{X^*(t)\zeta (t)}\varvec{\psi }(t)+ \varvec{\theta }, \end{aligned}$$
(44)
where \(\Sigma \) has been introduced in (6) and \(\varvec{\psi }(\cdot )\) is such that
$$\begin{aligned} dM(t)=\varvec{\psi }^\top (t) \mathrm{d}\mathbf {z}(t), \end{aligned}$$
(45)
M being the martingale defined as
$$\begin{aligned} M(t):= \zeta (t) X^*(t). \end{aligned}$$
In order to apply this result we need to find the explicit expression of \(\varvec{\psi }\). By Itô formula, we have
$$\begin{aligned} \mathrm{d}M(t) =\mathrm{d}\zeta (t) X^*(t) +\zeta (t) \mathrm{d}X^*(t) + \mathrm{d}\zeta (t) \mathrm{d}X^*(t). \end{aligned}$$
(46)
Moreover, notice that \(\zeta (t)\) is of the form \(\zeta (t)=\exp \left[ -A(t) -\varvec{\theta }^\top \mathbf {z}(t)\right] \), while \(X^*(t)\) is of the form \(X^*(t)=X^*(t,r(t),\zeta (t))\). The dependence of \(X^*\) on r enters in the terms \(\mu \) and f, while the dependence on \(\zeta \) enters in \(d^{\scriptscriptstyle +}=d^{\small {+}}(\zeta ,r),d^{\scriptscriptstyle -}=d^{\scriptscriptstyle -}(\zeta ,r)\). Hence
$$\begin{aligned} \mathrm{d}\zeta (t)=[\cdots ] \mathrm{d}t -\zeta (t) \varvec{\theta }^\top \mathrm{d}\mathbf {z}(t), \end{aligned}$$
while
$$\begin{aligned} \mathrm{d}X^*(t) = [\cdots ] \mathrm{d}t + X_r^*(t,r(t),\zeta (t)) \mathrm{d}r(t) -\zeta (t) X_\zeta ^*(t,r(t),\zeta (t)) \varvec{\theta }^\top \mathrm{d}\mathbf {z}(t). \end{aligned}$$
Here \(X^*_r,X^*_\zeta \) denote the first order derivative of \(X^*\) wrt \(r,\zeta \). Finally, we notice that
$$\begin{aligned} \mathrm{d}\zeta (t)\mathrm{d}X^*(t) =[\cdots ] \mathrm{d}t. \end{aligned}$$
We recall that, being M a martingale, we did not study the drift terms in the above equations, since the sum of all the contributions in Eq. (46) will result in a null drift.
We thus have
$$\begin{aligned} \begin{aligned} \mathrm{d}M(t)&= [\cdot ] \mathrm{d}t-\zeta (t) X^*_r(t,r(t),\zeta (t)) \sqrt{\eta } \mathrm{d}z_r (t) \\&\quad -\zeta (t) [X^*(t) + \zeta (t) X^*_\zeta (t,r(t),\zeta (t)) ]\varvec{\theta }^\top \mathrm{d}\mathbf {z}(t). \end{aligned} \end{aligned}$$
(47)
We now compute the derivative \(X^*_\zeta \). First of all, we notice that
$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}\zeta } N(d^{\scriptscriptstyle \pm }- \sigma )&= \frac{\mathrm{d}d^{\scriptscriptstyle \pm }(\zeta )}{\mathrm{d}\zeta } N^\prime (d^{\scriptscriptstyle \pm }- \sigma ) = -\frac{1}{ \sigma \zeta } N^\prime (d^{\scriptscriptstyle \pm }- \sigma ) . \end{aligned}$$
Moreover, since \(N^{\prime \prime }(d)= -d N^\prime (d)\), we have
$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}\zeta } N^\prime (d^{\scriptscriptstyle \pm }- \sigma )&= \frac{d^{\scriptscriptstyle \pm }-\sigma }{\sigma \zeta } N^\prime (d^{\scriptscriptstyle \pm }- \sigma ),\\ \frac{\mathrm{d}}{\mathrm{d}\zeta } N^\prime \left( d^{\scriptscriptstyle \pm }- \frac{\gamma }{\gamma -1}\sigma \right)&= \frac{d^{\scriptscriptstyle \pm }- \frac{\gamma }{\gamma -1}\sigma }{\sigma \zeta } N^\prime \left( d^{\scriptscriptstyle \pm }- \frac{\gamma }{\gamma -1}\sigma \right) , \end{aligned}$$
while
$$\begin{aligned} \frac{\mathrm{d}}{\mathrm{d}\zeta }\frac{N^\prime (d^{\scriptscriptstyle \pm }-\sigma )}{N^\prime \left( d^{\scriptscriptstyle \pm }-\frac{\gamma }{\gamma -1}\sigma \right) }&=\frac{1}{\sigma \zeta } \frac{ (d^{\scriptscriptstyle \pm }-\sigma ) N^\prime (d^{\scriptscriptstyle \pm }-\sigma )}{N^\prime \left( d^{\scriptscriptstyle \pm }-\frac{\gamma }{\gamma -1}\sigma \right) }- \frac{1}{\sigma \zeta }\frac{ \left( d^{\scriptscriptstyle \pm }-\frac{\gamma }{\gamma -1}\sigma \right) N^\prime (d^{\scriptscriptstyle \pm }-\sigma )}{N^\prime \left( d^{\scriptscriptstyle \pm }-\frac{\gamma }{\gamma -1}\sigma \right) }\\&= \frac{1}{\zeta } \frac{1}{\gamma -1}\frac{ N^\prime (d^{\scriptscriptstyle \pm }-\sigma )}{N^\prime \left( d^{\scriptscriptstyle \pm }-\frac{\gamma }{\gamma -1}\sigma \right) }. \end{aligned}$$
Hence
$$\begin{aligned}&X^*_\zeta (t,r,\zeta )\\&\quad = \frac{1}{\zeta } \frac{1}{\gamma -1} f(t) e^{-\mu +\frac{\sigma ^2}{2}}\left[ \frac{\alpha K+H}{\alpha }\frac{ N^\prime (d^{+}-\sigma )}{N^\prime \left( d^{\scriptscriptstyle +}-\frac{\gamma }{\gamma -1}\sigma \right) } N\left( d^{\scriptscriptstyle +}-\frac{\gamma }{\gamma -1}\sigma \right) \right. \\&\qquad +\left. \frac{\alpha K+H}{\alpha +1}\frac{ N^\prime (d^{-}-\sigma )}{N^\prime \left( d^{\scriptscriptstyle -}-\frac{\gamma }{\gamma -1}\sigma \right) } \left( 1-N\left( d^{\scriptscriptstyle -}-\frac{\gamma }{\gamma -1}\sigma \right) \right) \right] \\&\quad =\frac{1}{\zeta }\frac{1}{\gamma -1}\left[ X^*(t,r,\zeta )+K f(t) e^{-\mu +\frac{\sigma ^2}{2}}\left( N(d^{\scriptscriptstyle +}-\sigma )-\frac{1}{\alpha +1}-\frac{\alpha }{\alpha +1}N(d^{\scriptscriptstyle -} -\sigma )\right) \right. \\&\qquad +\left. H f(t)e^{-\mu + \frac{\sigma ^2}{2}} \left( \frac{1}{\alpha } N(d^{\scriptscriptstyle +}-\sigma ) + \frac{1}{\alpha +1} (1- N(d^{\scriptscriptstyle -}-\sigma )) \right) \right] . \end{aligned}$$
Similarly \(X^*_r(t,r,\zeta )\) can be computed.
Considering now \(\mathrm{d}M(t)\) as in Eqs. (45) and (47) we obtain:
$$\begin{aligned} \varvec{\psi }(t)= \zeta (t) \begin{pmatrix} 0\\ -X^*_r(t,r(t),\zeta (t)) \sqrt{\eta } \end{pmatrix} -\zeta (t) \left[ X^*(t) + \zeta (t)X^*_\zeta (t,r(t),\zeta (t)) \right] \varvec{\theta }, \end{aligned}$$
and thus Eq. (44) implies
$$\begin{aligned} \Sigma ^T \varvec{\pi }(t)= \frac{1}{X^*(t)}\begin{pmatrix} 0 \\ -X^*_r(t,r(t),\zeta (t)) \sqrt{\eta } \end{pmatrix} - \zeta (t)\frac{X^*_\zeta (t,r(t),\zeta (t))}{X^*(t)} \varvec{\theta }. \end{aligned}$$
Remark 2
Since
$$\begin{aligned} (\Sigma ^\top )^{-1} \varvec{\theta }= \begin{pmatrix} \frac{\theta _1}{\sigma _1} \\ \frac{-\sigma _2\sqrt{\eta }}{\sigma _1\sigma _B(T-t)}\theta _1 + \frac{\theta _2\sqrt{\eta }}{\sigma _B(T-t)} \end{pmatrix}, \end{aligned}$$
from the above calculation we notice that the proportion invested into the stock is given by
$$\begin{aligned} ( \pi ^S)^*(t)=&\frac{\theta _1}{\sigma _1(1-\gamma )}\left[ 1+\frac{K}{X^*(t)} f(t) e^{-\mu +\frac{\sigma ^2}{2}}\left( N(d^{\scriptscriptstyle +}-\sigma )-\frac{1}{\alpha +1}-\frac{\alpha }{\alpha +1}N(d^{\scriptscriptstyle -} -\sigma )\right) \right. \\&+\left. \frac{H}{X^*(t)} f(t)e^{-\mu + \frac{\sigma ^2}{2}} \left( \frac{1}{\alpha } N(d^{\scriptscriptstyle +}-\sigma ) +\frac{1}{\alpha +1} (1- N(d^{\scriptscriptstyle -}-\sigma ) )\right) \right] . \end{aligned}$$