\section{Introduction}\label{sec:iar}
This paper concerns  the ruin probabilities
in the context of regime switching environment. The risk theory is
substantial for insurance mathematics and has been subject
of many interest since Lundberg. There is a good deal of work related
with this theory and there are many great books describing it; see e.g.
\citet{asm_ruin, rolskibook, AndreasGerberShiu}. The understanding of so-called Markov modulated risk process is
also deep; see Chap. VII of \citet{asm_ruin}.
The need of Markov modulation is not questionable nowadays. It can model
the state of the roads in the case of car insurance, economic environments
or insurance claims with a higher degree of complexity insofar as claim frequencies and/or
severities are concerned; see e.g. \citet{Dawid} and references therein.

Still, we believe that there is a need of the short survey related with these results
and with few additional new facts that have not been proved yet.
In particular, we give counterpart of Arfwedson Theorem for the Markov modulated
risk process. We also give a subexponential asymptotics of the Parisian probability of ruin.
This is our first goal.
Second main goal is the ordering of few key results with the unified use of so-called scale matrices introduced
by \citet{ivanovs_palmowski}. This part of the paper can be then treated as a Markov modulated version of
some facts presented in \citet{AndreasGerberShiu}. Due to Markov modulation, some additional care is required here though.

The paper is organized as follows. In the next section we formally introduce the risk process that we work with.
In Section \ref{sec:prel} we give few main facts concerning the scale matrices.
In Section \ref{Ger:sec} we present the key compensation formula and
related representations of Gerber-Shiu function. Section \ref{sec:diff}
gives the ordinary differential equation that Gerber-Shiu function solves.
In Sections \ref{sec:Cram} and \ref{sec:subexpnentialasruinprob} we present the Cram\'er
and subexponential asymptotics, respectively. In Sections \ref{sec:seg} and \ref{sec:Hog}
we  focus on Segerdahl's and H\"{o}glund's approximations of the finite-time ruin probability.
The last section is dedicated to Parisian ruin probability.

\section{Gerber-Shiu function}
The goal of this paper is to analyse various ruin probabilities
of a Markov modulated risk process.
To describe this process properly we start from introducing a random environment that is
given by a continuous time Markov chain $J_t$ living on the state space $E=\{1, 2, \ldots N\}$.
Let $T_k$ denote successive jump epochs of the Markov chain $J_t$.
Then the risk process under consideration is given by
\begin{equation}\label{riskMM3}
X_t=x+\int_0^tp_{J_u}\mathrm d u -\sum_{k=1}^{N_t} C_k^{(J_t)} -\sum_{T_k\leq t} C_k^{(J_{T_k-}, J_{T_k})}.
\end{equation}
Above, $x$ describes an initial capital, $N_t$ is a Markov modulated Poisson process with an arrival intensity $\lambda_i$ at time $t$
when $J_t=i$ determining the arrival of i.i.d. claims $\{C_k^{(i)}\}$ which are conditionally independent of $N_t$ and having distribution
$F^{(i)}_C$
depending on the state $i\in E$ of the environmental Markov chain $J$ at time $t$.
Apart of it we have possible claims $C_k^{(ij)}$, $i,j\in E$, appearing when the environmental Markov chain changes its state.
The vector $(p_1, p_2, \ldots, p_N)$ is a vector of premium intensities.
In the following we assume that the processes $X$ and $J$ are defined on a common
filtered probability space $(\Omega, \mathcal{F}, \{\mathcal{F}_t\}_{t\ge 0}, \mathbb P)$
and we use $\mathbb P_{x,i}$ to denote the law of $(X,J)$ given
$\{X_0=x, J_0=i\}$ and by $\mathbb P_i$ and $\mathbb P_x$ we denote the law of $(X,J)$ given
$\{X_0=0, J_0=i\}$ and $\{X_0=x\}$, respectively.
The appropriate expectations we will denote by  ${\mathbb E}_{x,i}$, ${\mathbb E}_i$ and ${\mathbb E}_x$.
We also write ${\mathbb E}[Z;J_t]$, where $Z$ is some random
variable, to denote the $N\times N$ matrix with entries
${\mathbb E}_i[Z;J_t=j]={\mathbb E}_i[Z\ind{J_t=j}].$ Finally, we denote $\mathbb P(\cdot)=\mathbb P_0(\cdot)$ and ${\mathbb E}[\cdot]={\mathbb E}_0[\cdot]$.

We will assume throughout of this work the following net profit condition
\begin{equation}\label{netprofit}
{\mathbb E}_{i}X_1>0,\qquad \text{for all $i\in E,$}
\end{equation}
under which risk process $X$ tends to infinity a.s.

Observe that $X_t$ is a spectrally negative Markov Additive Process (MAP) with the matrix exponent
\begin{equation}\label{Fforriskprocess}
F(\a)=
\mathrm {diag} \left(p_i\a +\lambda_i ({\mathbb E} e^{-C^{(i)}\a}-1)\right)_{\{i\in E\}} +(q_{ij}{\mathbb E} e^{-C^{(ij)}\a})_{\{i,j\in E\}},
\end{equation}
where $\alpha \ge 0$, $C^{(i)}$ and $C^{(ij)}$ are generic random variables representing
claims $C^{(i)}_k$ and $C^{(ij)}_k$, respectively, and $Q=(q_{ij})_{\{i,j\in E\}}$ is an intensity matrix of $J$.
In other words,
\[{\mathbb E}[e^{\a X_t};J_t]=e^{F(\a)t}.\]

The main object of the study is expected discounted penalty function (EDPF)
called a Gerber-Shiu function as well and defined by
\begin{equation}\label{GerberShiuFunction}
\phi_{w,ij}^{(q)}(x)={\mathbb E}_{x,i} [e^{-q\tau_0^-}w(X_{\tau_0^--}, |X_{\tau_0^-}|); J_{\tau_0^-}=j, \tau_0^-<\infty]
\end{equation}
for the ruin time
\begin{equation}\label{ruintime}
\tau_0^-=\inf\{t\ge 0: X_t<0\}.\end{equation}
Above, $q\ge 0$ is a discounting factor and $w$ is a bivariate non-negative penalty function. This function describes the penalty that is paid at the moment of ruin.
It depends on the position prior ruin  $X_{\tau_0^--}$ and the deficit $|X_{\tau_0^-}|$ at the ruin moment.
If $w\equiv 1$ then Gerber-Shiu function is a discounted ruin probability:
\begin{equation}\label{ruinprobability}
\phi_{1,ij}^{(q)}={\mathbb E}_{x,i} [e^{-q\tau_0^-}; J_{\tau_0^-}=j, \tau_0^-<\infty].\end{equation}
The most common case is when $q=0$ and then
\begin{equation}\label{ruinprobdef}
\phi_{ij}(x)=\phi_{1,ij}^{(0)}(x)=\mathbb P_{x,i}(\tau_0^-<\infty, J_{\tau_0^-}=j)\end{equation}
 is the ruin probability.
We will write $\phi_{w,i}^{(q)}(x)=\sum_{j\in E}\phi_{w,ij}^{(q)}(x)$, $\phi_{1,i}^{(q)}(x)=\sum_{j\in E}\phi_{1,ij}^{(q)}(x)$
and
\begin{equation}\label{ruinprobdef2}
\phi_{i}(x)=\sum_{j\in E}\phi_{ij}(x)=\mathbb P_{x,i}(\tau_0^-<\infty).
\end{equation}
In most of the cases $C^{(ij)}\equiv 0$ for any $i,j\in E$, that is, when
Markov chain changes its state there are no additional claims appearing in reserve process.
In this case
\begin{equation}\label{riskMM2}
X_t=x+\int_0^tp_{J_u}\mathrm d u -\sum_{k=1}^{N_t} C_k^{(J_t)},
\end{equation}

There is a huge amount of literature devoted to the Gerber-Shiu
functions and ruin theory. For more detailed discussions, we can refer
to \citet{asm_ruin, rolskibook, AndreasGerberShiu}.

\section{Prelimiaries}\label{sec:prel}
We follow here mainly~\citet{ivanovs_palmowski}.
Define an $N\times N$ matrix-valued function
$W^{(q)}(x)$ which is continuous for $x\ge 0$ and is identified by the
following Laplace transform:
\begin{equation}\label{Wq}
\int_0^\infty e^{-\a x}W^{(q)}(x)\mathrm d x=(F(\a)-q\mathbb{I})^{-1},\qquad \a>\max\{\Re(\lambda):\det (F(\lambda)-\lambda q\mathbb{I})=0\},\end{equation}
where $\mathbb{I}$ is the identity matrix.
The matrix $W^{(q)}(x)$ is invertible for $x>0$ and satisfies
\begin{align}
&{\mathbb E}_x[e^{-q\tau_a^+}; \tau_x^+<\tau_{0}^-,J_{\tau_a^+}]=W^{(q)}(x)W^{(q)}(a)^{-1}\label{eq:two-sidedq}
\end{align}
for $0\le x\le a$,
where
$$\tau_a^+=\inf\{t\ge 0: X_t>a\}.$$
In the case of $N=1$ this results corresponds to~\citet[Thm.~1]{kyprianoupalmowski}.

We also define
\[Z^{(q)}(\a,x)=e^{\a x}\left(\mathbb{I}-\int_0^xe^{-\a y}W^{(q)}(y)\mathrm d y(F(\a)-q\mathbb{I})\right)\text{ for }\a,q,x\ge 0\]
and when $\a=0$ we denote
\begin{equation}\label{secsc}
Z^{(q)}(x)=\mathbb{I}-\int_0^xW^{(q)}(y)\mathrm d y(F(0)-q\mathbb{I})=\mathbb{I}-\int_0^xW^{(q)}(y)\mathrm d y(Q-q\mathbb{I}).
\end{equation}
It is so-called second scale matrix.
We will also need a matrix $R$
being a \emph{left solution} of $$F(-R^{(q)})=q\mathbb{I}.$$
In case when $N=1$ we have
$R=-\Phi(q)$
where $\Phi(q)$ is a right-inverse of the Laplace exponent $\psi(\alpha)=F(\alpha)$ of spectrally negative L\'evy process $X$
(hence $\psi(\Phi(q))=q$).
Then for all $x,\a\ge 0$ and $q>0$
\begin{equation}\label{2sideddown}{\mathbb E}_x[e^{-q\tau_0^-+\a X_{\tau_0^-}};\tau_0^-<\tau_a^+,J_{\tau_0^-}]=Z^{(q)}(\a,x)-W^{(q)}(x)W^{(q)}(a)^{-1}Z^{(q)}(\a,a).\end{equation}
Hence by taking $a \rightarrow+\infty$ and assuming that $R^{(q)} +\a\mathbb{I}$ is
non-singular, it holds that
\begin{equation*}
{\mathbb E}_x[e^{-q\tau_0^-+\a X_{\tau_0^-}};J_{\tau_0^-}]=Z^{(q)}(\a,x)-W^{(q)}(x)(R^{(q)}+\a\mathbb{I})^{-1}(F(\a)-q\mathbb{I}).\end{equation*}
Above result can be extended to $q=0$ by taking
the limits as $q\downarrow 0$. Moreover, it is noted that
$(R^{(q)}+\a)^{-1}(F(\a)-q\mathbb{I})$ reduces to
$(\psi(\a)-q)/(\a-\Phi^{(q)})$ in the L\'{e}vy  case. This leads to the
known identity with $\a=0$ for a L\'{e}vy  process,
see~\citet[Thm.~8.1]{kyprianou}.

We can consider process $X$ killed on exiting positive half-line
and the corresponding potential measure (a matrix of measures)
\begin{align}\label{eq:potential}
 &U^{(q)}(x,A)=\int_0^\infty e^{-qt}\mathbb P_x[X_t\in A; t>\tau_0^-, J_t]\mathrm d t,
\end{align}
where $A$ is a Borel set.
It turns out that the measure $U^{(q)}(x,A)$ has a matrix density $u^{(q)}(x,z)$ on $(0,+\infty)$ with respect to Lebesgue measure
and by \citet{ivanovs_potential} it is given by
\begin{equation}\label{thm:13}
u^{(q)}(x,z)=W^{(q)}(x)e^{R^{(q)}z}-W^{(q)}(x-z).\end{equation}

\section{Compensation formula and Gerber-Shiu function}\label{Ger:sec}
Our first goal is to give various key representations of Gerber-Shiu function.
We start from describing so-called compensation formula in the context of
regime switching ruin probabilities.

We define (non-homogeneous) marked Poisson measure
\[N_C([0,t)\times A)=\sum_{k=1}^{N_t}\delta_{C_k^{(J_{T^N_k})}}(A) + \sum_{T_k\leq t}\delta_{C_k^{(J_{T_k-}, J_{T_k})}}(A),\]
where $T^N_k$ are jumps epochs of the Poisson process $N_t$, $\delta_x$ is the Dirac measure at $x$ and $A$ is a Borel set.
From \citet[Def. II.1.20 and Prop. II.1.21]{JacodShiryaev} and \citet{Cinlar1} it follows that
\begin{equation}\label{nu}
\nu^{(J_{s-}, J_s)}(\mathrm d y)=\lambda_{J_s}F^{(J_s)}_C(\mathrm d y) + q_{J_{s-}, J_s} F_C^{(J_{s-}, J_s)}(\mathrm d y)
\end{equation}
is a compensator of $N_C$, that is, for any measurable and bounded $g$ we have
\[{\mathbb E}_{i} \int_0^t g(s,y, J_{s-}, J_s) N_C(\mathrm d s, \mathrm d y)={\mathbb E}_{i} \int_0^t g(s,y, J_{s-}, J_s)
\nu^{(J_{s-}, J_s)}(\mathrm d y)\mathrm d s.\]
We denote by $T_n^C$ the jump epoch of the risk process \eqref{riskMM3}. This means
that $T_n^C$  is either $T^N_k$ (the jump epoch of the Poisson process)
or $T_n$ (the moment when Markov chain $J$ changes a state).
This gives the following compensation formula.
\begin{theorem}\label{compformula}
For any measurable and bounded function $f: [0,+\infty)^2\times\mathbb{R}\times E^2\rightarrow \mathbb{R}$ we have
\begin{eqnarray*}
\lefteqn{{\mathbb E}_{x,i}\left[\sum_{T_k^C\leq t} f(T_k^C, X_{T^C_k-}, X_{T^C_k}, J_{T^C_k-}, J_{T^C_k})\right]}\\
&&=\sum_{k,j\in E}\int_0^\infty{\mathbb E}_{x,i}\int_0^t f(s, X_{s}, X_{s}-y, k, j
\mathrm d s\; \nu^{(k,j)}(\mathrm d y).\end{eqnarray*}
\end{theorem}
\begin{proof}
Note that
\begin{align*}
&{\mathbb E}_{x,i}\left[\sum_{T^C_k\leq t} f(T^C_k, X_{T^C_k-}, X_{T^C_k}, J_{T^C_k-}, J_{T^C_k})\right]\\
&={\mathbb E}_{x,i}\left[\sum_{T^C_k\leq t} f(T^C_k, X_{T^C_k-}, X_{T^C_k-}
-C_k^{(J_{T_k^C})}\ind{J_{T_k^C-}=J_{T_k^C}}-C_k^{(J_{T_k^C-}, J_{T_k^C})}\ind{J_{T_k^C-}\neq J_{T_k^C}}, J_{T^C_k-}, J_{T^C_k})\right]\\
&={\mathbb E}_{x,i} \int_0^t f(s, X_{s-}, X_{s-}-y, J_{s-}, J_s)N_C(\mathrm d s, \mathrm d y)\\&
=\sum_{k,j\in E}\int_0^\infty{\mathbb E}_{x,i}\int_0^t f(s, X_{s}, X_{s}-y, k, j
\mathrm d s\; \nu^{(k,j)}(\mathrm d y)
\end{align*}
which completes the proof.
\end{proof}
\begin{cor}\label{compensationGB1}
We have
\[\phi_{w,ij}^{(q)}(x)=\sum_{k\in E} \int_0^\infty \int_0^y w(z,y-z)u^{(q)}_{ik}(x,z) \mathrm d z\; \nu^{(k,j)}(\mathrm d y),\]
where $i,j\in E$ and $u^{(q)}(x, z)$ is a $q$-potential density of the process $X$ starting at $x$ and killed on exiting from $[0,+\infty)$.
\end{cor}
\begin{proof}
Observe that ruin can happen only at the moments of claim arrivals. Hence
from Theorem \ref{compformula},
\begin{eqnarray*}
\lefteqn{\phi_{w,ij}^{(q)}(x)={\mathbb E}_{x,i}\left[\sum_{k=1}^\infty e^{-q T^C_k}w(X_{T_k^C-},|X_{T_k^C}|)\ind{X_{T_k^C-}\ge 0, X_{T_k^C}<0, J_{T_k^C}=j}\right]}\\
&&\sum_{k\in E} \int_0^\infty \left(
{\mathbb E}_{x,i} \left[\int_0^\infty \int_0^y e^{-q s}w(z,y-z)\ind{X_{s-}\in \mathrm d z, \tau_0^->s}\ind{J_{s-}=k, J_s=j}\mathrm d s\right]
\right)
\nu^{(k,j)}(\mathrm d y)\\
&&=\sum_{k\in E} \int_0^\infty \left(
\left[\int_0^\infty \int_0^y e^{-q s}w(z,y-z)\mathbb P_{x,i}(X_{s-}\in \mathrm d z, \tau_0^->s, J_{s-}=k)
\mathrm d s\right]
\right)
\nu^{(k,j)}(\mathrm d y).
\end{eqnarray*}
This completes the proof.
\end{proof}

Writing $\mathbf{\phi}_{w}^{(q)}(x)=(\phi_{w,1}^{(q)}(x), \ldots, \phi_{w,N}^{(q)}(x))^T$ and using Fubbini theorem
we can conclude that Corollary \ref{compensationGB1} can be rewritten in the matrix notation as follows:
\begin{align}\label{compstarting}
\mathbf{\phi}_{w}^{(q)}(x)&= \int_0^\infty \int_0^y w(z,y-z)u^{(q)}(x,z)\mathrm d z\; \nu (\mathrm d y)\nonumber\\
&=\int_0^\infty \int_0^\infty w(z,y)u^{(q)}(x,z)\; \nu (z+\mathrm d y)\mathrm d z
\end{align}
where the measure $\nu$ is defined formally in \eqref{nu}.

\begin{remark}
\rm For above considerations the downward jumps are not crucial and
above corollary could be easily adopted for the general direction of jumps
of the process $X$.
\end{remark}

Similar result was derived by \citet{SalahMorales} and \citet[Thm. V.5.5]{AndreasGerberShiu} in the context of spectrally negative
L\'evy processes.
From Corollary \ref{compensationGB1} and \eqref{thm:13}
we have the first main result of this section.
\begin{theorem}[Compensation representation]\label{compensationrepresentation}
We have
\[\mathbf{\phi}_{w}^{(q)}(x)=\int_0^\infty \int_0^\infty w(z,y)u^{(q)}(x,z)\; \nu (z+\mathrm d y)\mathrm d z,\]
where $u^{(q)}(x,z)$ is given in \eqref{thm:13}.
\end{theorem}

We recall that the matrix $\mathbf{\phi}_1^{(q)}(x)=(\mathbf{\phi}_{1,ij} ^{(q)}(x))_{\{i,j\in E\}}$
describes the Laplace transform of the ruin time on the event when ruin happens and it is
defined formally in \eqref{ruinprobability}.
From \eqref{2sideddown} by taking $\alpha=0$ and $a\rightarrow +\infty$
the following its representation holds true (compare with \citet[Thm. IV.4.3]{AndreasGerberShiu}).
\begin{theorem}[Discounted ruin probability]\label{scaleruinproabilitydiscounted}
We have,
\begin{equation}\label{LTruintime}
\mathbf{\phi}_1^{(q)}(x)
=Z^{(q)}(x)- W^{(q)}(x)\mathbf{C}_{W(\infty)^{-1}Z(\infty)},
\end{equation}
for
\begin{equation*}
 \mathbf{C}_{W(\infty)^{-1}Z(\infty)}=

 \lim_{a \to \infty} W^{(q)}(a)^{-1}Z^{(q)}(a)<\infty.
\end{equation*}
\end{theorem}

Observe that $\mathbf{C}_{W(\infty)^{-1}Z(\infty)}$ is well-defined since
$\mathbf{\phi}_1^{(q)}(x)$ as a limit is well-defined.
Note that identity \eqref{LTruintime} gives the Laplace transform of the finite-time ruin time as well, that is,
\[\mathbf{\phi}_1^{(q)}(x)=\int_0^\infty e^{-q t}\mathrm d \mathbb P_{x} (\tau^-_0\leq t).
\]
In other words inverting \eqref{LTruintime} gives the finite-time ruin probability
\begin{equation}\label{finitetimeruinprob}
\mathbf{\phi}(x,t)=\mathbb P_{x} (\tau^-_0\le t).
\end{equation}

Multiplying by ${\bs 1}$ from the right and taking $q\downarrow 0$ in \eqref{LTruintime} gives also the representation of the ruin probability
$\phi_i(x)$ defined in \eqref{ruinprobdef2}.
Indeed, recalling that $\phi(x) =(\phi_{ij}(x))_{\{i,j\in E\}}$ is defined in \eqref{ruinprobdef}, note that
\begin{align*}
&\phi_i(x)=(\phi(x){\bs 1})_i=
\mathbb P_{x,i}(\tau_0^-<\infty)\\&
=(\mathbb{I} {\bs 1}-\int_0^xW(y)\mathrm d y F(0){\bs 1} - W(x)\mathbf{C}_{W(\infty)^{-1}Z(\infty)}{\bs 1})_i=
1-(W(x)\mathbf{C}_{W(\infty)^{-1}Z(\infty)}){\bs 1})_i.\end{align*}
Above we have used the definition of the second scale matrix
$Z^{(q)}(x)$ given in \eqref{secsc} and fact that $F(0){\bs 1}=Q{\bs 1}=0$.
We introduce now the survival probability
\[\overline{\phi}_i(x)=1-\phi_i(x).\]
Using fact that matrix $\mathbf{C}_{W(\infty)^{-1}Z(\infty)}$  is well-defined
we can conclude the following representation of survival probability.
\begin{theorem}[Survival probability]\label{scaleruinproability}
Under net profit condition \eqref{netprofit} we have
\begin{equation}\label{ruintimeprob}
\overline{\phi}_i(x)=(W(x)\mathbf{C}_{W(\infty)^{-1}Z(\infty)}{\bs 1})_i, \qquad i\in E.
\end{equation}
\end{theorem}

Let now $N=1$. Then $Q=0$.
Recall that
\[\int_0^\infty e^{-\a x}W(x)\mathrm d x=F(\a)^{-1}.\]
In our case by \eqref{Fforriskprocess},
\begin{align*}F(\a)^{-1}=&
\frac{1}{p_1\a } \frac{1}{1-\lambda_1{\mathbb E} C^{(1)}_1\int_0^\infty e^{-\a y}\overline{F}_C^{(1)}(y)/{\mathbb E} C^{(1)}_1\mathrm d y}
\\
&
\frac{1}{p_1\a } \sum_{k=1}^\infty \rho_1^k \left(\int_0^\infty e^{-\a y} F_C^{I,(1)}(\mathrm d y)\right)^k
\end{align*}
where \[\rho_1=\frac{\lambda_1{\mathbb E} C^{(1)}_1}{p_1},\]
\[F^{I,(1)}_C(x)=\frac{1}{{\mathbb E} C^{(1)}_1}\int_0^x\overline{F}_C^{(1)}(y)\mathrm d y,\]
for
\[\overline{F}_C^{(1)}(x)=1-F_C^{(1)}(x).\]
Thus
\[W(x)
\sum_{k=1}^\infty \rho_1^k (F^{I,(1)}_C)^{*k}(x)
,\]
where $(F^{I,(1)}_C)^{*k}$ denotes the $k$th convolution of distribution
$F^{I,(1)}_C$.
To sum up,
\[\overline{\phi}_1(x)=A_1\sum_{k=1}^\infty \rho_1^k (F^{I,(1)}_C)^{*k}(x)\]
for some constant $A_1$.
From the fact that $\lim_{x\to+\infty}\overline{\phi}_1(x)=1$
we can get identify constant $A_1$ and derive the seminal Pollaczek-Khintchine formula for the survival probability.
\begin{theorem}[Pollaczek-Khintchine formula] If $N=1$ then
\[\overline{\phi}_1(x)=(1-\rho_1)\sum_{k=1}^\infty \rho_1^k (F^{I,(1)}_C)^{*k}(x).\]
\end{theorem}

We denote by
\[\xi_k=X_{T^C_{k-1}}-X_{T^C_{k}}\]
the negative of the increments of the risk process between consecutive jumps.
Note that, conditionally on $J_{T_l^C}$, random variables
$\xi_k$ are independent on each other. Moreover, conditionally on
$\{J_{T_k^C}=j, J_{T_{k-1}^C}=i\}$, $-\xi_k$ has the same law
as
\begin{equation}\label{jumprepresentationdistribution}
p_i{\rm Exp}(\lambda_i-q_{ii})- \frac{\lambda_i}{\lambda_i-q_{ii}}C^{(i)}_k-
\frac{q_{ij}}{\lambda_i-q_{ii}}C^{(ij)}_k\end{equation}
because waiting time for next jump has exponential law ${\rm Exp}(\lambda_i-q_{ii})$ with parameter
$q_{ij}+\lambda_i$. Then we have to take into account which jump is first: the one coming from Markov modulated Poisson process
$N$ or the one that Markov chain change of the state brings.
In the first scenario Markov chain $J_t$ remains in the state $i$.
Note that the law of $\xi_k$ depends on the states $J^C_{k-1}$ and $J_k^C$ of the discrete-time Markov chain
\[J_0^C=J_0,\qquad J^C_k=J_{T_k^C}, \qquad k=1,2,\ldots\]
with the transition matrix
\begin{equation}\label{transition}
\mathscr{P}=(p_{ij})\quad \text{with}\quad p_{ii}=\frac{\lambda_i}{\lambda_i-q_{ii}}\quad\text{and}
\quad p_{ij}=\frac{q_{ij}}{\lambda_i-q_{ii}}\quad\text{for $i\neq j$.}
\end{equation}
We define the following discrete-time Markov modulated random random walk:
\begin{equation}\label{MMRW}
S_0=0, \qquad S_n=\sum_{k=1}^n \xi_k.
\end{equation}

We recall the key observation that ruin of the risk process
\eqref{riskMM2} only at the claim arrivals. By shifting a generic trajectory
of $X_t$ by $x$ units downward and then reflecting it across the horizontal
axis, we can observe that the risk process $X$ gets below zero level if and only if
$S_k$ will ever cross level $x$. Moreover, the net profit condition \eqref{netprofit}
is equivalent to the requirements that $S_n\rightarrow+\infty$ a.s.
This gives us the last representation.
\begin{theorem}[Maximum random walk]\label{MMRW}
We have
\begin{equation}\label{maxMMRW}
\phi_i(x)=\mathbb P_i\left(\max_{k\ge 0} S_k>x\right)<1.\end{equation}
\end{theorem}
\begin{remark}\label{Markovmodulatedrandomwalkremarkassump}\rm
Note that
by enriching the state space to the pairs $(i,j)\in E^2$ and by taking the Markov chain
$\tilde{J}_t=(J_{t-},J_t)$, we can assume without loss of
generality that the distribution of generic increment $\xi$, depends only on the state
of the Markov chain just prior jump. In this case $X$ becomes so-called non-anticipative MAP.
In other words, without loss of generality we can assume
the distribution of $\xi$ (being the negative of r.v. given in \eqref{jumprepresentationdistribution})
can be indexed by
$F_\xi^{(i)}(x)$.
To simplify this analysis we will assume from now on that this condition holds whenever we work with random walk $S_n$.
In this case, denoting
\[a_i=\int_{\mathbb{R}} x F_\xi^{(i)}(\mathrm d x)\]
which we assume to be finite,
the net profit condition \eqref{netprofit} is equivalent to
\begin{equation}\label{driftMMRW}
\overline{a}=-\sum_{i=1}^N \pi_ia_i>0.
\end{equation}
\end{remark}

\begin{remark}\rm
The representation \eqref{maxMMRW} of the ruin probability via maximum random walk remains
true even if the generic time between arrivals of the claims
has a general distribution possibly depending on the discrete time Markov chain $J^C$.
\end{remark}

\section{Ordinary differential equation}\label{sec:diff}
In this section we derive ordinary differential equation for Gerber-Shiu
functions.
We start from proving some crucial martingale
property.
\begin{theorem}\label{scalemartingales}
For each $i\in E$, the processes:
\[e^{-qt\wedge \tau_0^-\wedge \tau_a^+}W^{(q)}_{iJ_{t\wedge \tau_0^-\wedge \tau_a^+}}(X_{t\wedge \tau_0^-\wedge \tau_a^+}),\qquad e^{-qt\wedge \tau_0^-\wedge \tau_a^+}Z^{(q)}_{iJ_{t\wedge \tau_0^-\wedge \tau_a^+}}(X_{t\wedge \tau_0^-\wedge \tau_a^+})\]
are uniformly integrable  martingales with respect of the natural filtration
$\mathcal{F}_t$ of MAP $(X,J)$.
\end{theorem}
\begin{proof}
From \eqref{eq:two-sidedq} and the strong Markov property it follows that
\begin{eqnarray*}
\lefteqn{{\mathbb E}_{x,i}\left[e^{-q\tau_a^+}\ind{\tau_a^+<\tau_0^-, J_{\tau_a^+}=j}|\mathcal{F}_{t\wedge \tau_0^-\wedge \tau_a^+}\right]}
\\&&= e^{-qt\wedge \tau_0^-\wedge \tau_a^+}W^{(q)}_{iJ_{t\wedge \tau_0^-\wedge \tau_a^+}}(X_{t\wedge \tau_0^-\wedge \tau_a^+})[W^{(q)}(a)^{-1}]_{J_{t\wedge \tau_0^-\wedge \tau_a^+}j},\end{eqnarray*}
where we used the fact that $W^{(q)}(X_{\tau_0^-})=0$ and $W^{(q)}(X_{\tau_a^+})W^{(q)}(a)^{-1}=\mathbb{I}$.
This completes of the proof of the first martingale property since $[W^{(q)}(a)^{-1}]_{J_{t\wedge \tau_0^-\wedge \tau_a^+}j}$
is $\mathcal{F}_{t\wedge \tau_0^-\wedge \tau_a^+}$-measurable.

Similarly, from \eqref{2sideddown}
we have
\begin{eqnarray*}
\lefteqn{{\mathbb E}_{x,i}\left[e^{-q\tau_0^-}\ind{\tau_0^-<\infty, J_{\tau_0^-}=j}|\mathcal{F}_{t\wedge \tau_0^-\wedge \tau_a^+}\right]}
\\&&= e^{-qt\wedge \tau_0^-\wedge \tau_a^+}\left(Z^{(q)}_{iJ_{t\wedge \tau_0^-\wedge \tau_a^+}}(X_{t\wedge \tau_0^-\wedge \tau_a^+})
-W^{(q)}_{iJ_{t\wedge \tau_0^-\wedge \tau_a^+}}(X_{t\wedge \tau_0^-\wedge \tau_a^+})A_{J_{t\wedge \tau_0^-\wedge \tau_a^+}j}\right)
\end{eqnarray*}
for some matrix $A$. Using similar arguments as above we derive the martingale property of the second process.
\end{proof}

From the compensation representation of the Gerber-Shiu function given in Theorem
\ref{compensationrepresentation} we can conclude that
\begin{equation}\label{martgerbere}
e^{-qt\wedge \tau_0^-\wedge \tau_a^+}\phi^{(q)}_{w,i,J_{t\wedge \tau_0^-\wedge \tau_a^+}}(X_{t\wedge \tau_0^-\wedge \tau_a^+})\end{equation}
is a martingale as well.

Moreover, from Theorem 5 of \citet{ivanovs_palmowski} (see remark just after this theorem as well)
and by Lemma 2.4 of \citet{KKR}
we know that
if $F_C^{(i)}$ and $F_C^{(ij)}$ ($i,j\in E$) are absolutely continuous, then
$W^{(q)}\in \mathcal{C}^{1}(0,\infty)$.
Which means from Theorem \ref{compensationrepresentation}
that $\phi_w\in \mathcal{C}^{1}(0,\infty)$.
Thus $\phi_w$ is sufficiently smooth
to apply infinitesimal generator.
\begin{theorem}\label{ODEGerberShiu}
Assume that for each $i,j\in E$ the distribution functions
$F_C^{(i)}$ and $F_C^{(ij)}$ have continuous densities $f_C^{(i)}$ and $f_C^{(ij)}$.
Then
the Gerber-Shiu function $\phi_w^{(q)}$ is in $\mathcal{C}^{1}(0,\infty)$
and for $x\ge 0$ it satisfies the following differential equation
\begin{eqnarray}
\lefteqn{p_i\left(\phi_{w,i}^{(q)}\right)^\prime(x)
+\int_0^\infty(\phi_{w,i}(x-y)-\phi_{w,i}(x))f_C^{(i)}(y) \mathrm d y}\nonumber\\&&
+\sum_{k\in E \atop k\neq i} q_{ik}
\int_0^\infty(\phi_{w,i}^{(q)}(x-y)-\phi^{(q)}_{w,i}(x))f_C^{(ik)}(y) \mathrm d y - q \phi^{(q)}_{w,i}(x)=0\label{diff1}
\end{eqnarray}
with the boundary conditions
\begin{align*}
\phi_w^{(q)}(x)&=w(x)\quad\text{for $x<0$,}\\
\lim_{x\to+\infty}\phi_w^{(q)}(x)&=0.\end{align*}
\end{theorem}
\begin{proof}
Since $a>0$ in \eqref{martgerbere} is general then \eqref{diff1} follows straightforward
from \eqref{martgerbere} and Dynkin formula since it is equivalent to the requirement that
\[\mathcal{A} \phi_{w,i}^{(q)}(x)-q\phi_{w,i}^{(q)}(x)=0,\qquad i\in E,\]
where $\mathcal{A}$ is the infinitesimal generator of $X$ with the domain included in $\mathcal{C}^{1}(0,\infty)$.
It suffices to prove now only the boundary conditions.
The first one follows straightforward from definition
of the Gerber-Shiu function.
The second one is a consequence of net-profit condition \eqref{netprofit}.
\end{proof}

The equation given in Theorem \ref{ODEGerberShiu}
is well-known for classical risk process; see e.g. \citet{AndreasGerberShiu} and references therein.
In the context of Markov modulated risk process it appears
e.g. in \citet{asmu, Jacobsen, NgYang, BadescuDavid, CheungDavid}.

\section{Cram\'er asymptotics}\label{sec:Cram}
We will follow \citet{asm_ruin} and \citet{asmu}.

We recall that for $\a\ge 0$ the matrix $F(\a)$ has a real simple eigenvalue
$k(\a)$, which is larger than the real part of any other
eigenvalue. The corresponding left-eigenvector ${\bs v}(\a)$ and
right-eigenvector ${\bs h}(\a)$ can be chosen so that $v_i(\a)>0$ and
$h_i(\a)>0$ for all $i$. The normalization requirement
\begin{align*}&{\bs \pi}{\bs h}(\a)=1,&{\bs v}(\a){\bs h}(\a)=1\end{align*}
results in the unique choice of ${\bs v}(\a)$ and ${\bs h}(\a)$, where
${\bs \pi}=(\pi_1, \pi_2, \ldots, \pi_N)$ is a stationary distribution of $J$.
Observe that $k(0)=0$, ${\bs h}(0)={\bs 1}$ and ${\bs v}(0)={\bs \pi}$.

We assume in this section that there exists solution $\gamma >0$ of so-called Cram\'er-Lundberg equation
\begin{equation}\label{cramerlundbergequation}
k(-\gamma)=0.
\end{equation}
Note that a necessary condition for this existence
is that $\int_0^\infty e^{\gamma x} \mathbb P(C^{(i)}\in \mathrm d x)<+\infty$
and that $\int_0^\infty e^{\gamma x} \mathbb P(C^{(ij)}\in \mathrm d x)<+\infty$, hence both
$C^{(i)}$ and $C^{(ij)}$ must be light-tailed.
This solution $\gamma$ is called an adjustment coefficient.

We consider now the exponential change of measure
\begin{equation}\label{expomeasureruin}
\frac{\mathrm d \tilde{\mathbb P}_{|\mathcal{F}_t}}{\mathrm d\mathbb P_{|\mathcal{F}_t}}=e^{-\gamma (X_t-x)-k(-\gamma)t}
\frac{h_{J_t}(\gamma)}{h_{J_0}(\gamma)}
=e^{-\gamma (X_t-x)}
\frac{h_{J_t}(\gamma)}{h_{J_0}(\gamma)}.\end{equation}
From \citet{jabernoulli} it follows that our risk process $(X,J)$
under $\tilde{\mathbb P}$ is again MAP with
the matrix exponent
\[\tilde{F}(\a)=\Delta_{{\bs h}(-\gamma)}^{-1}F(\a -\gamma)\Delta_{{\bs h}(-\gamma)}. \]
Thus the largest eigenvalue under $\tilde{\mathbb P}$ equals
$\tilde{k}(\a)=k(\a-\gamma)$ and hence
$\tilde{k}^\prime(0)=k^\prime(-\gamma)$.
Moreover, from the martingale property of the density process used in the above change of measure  we can conclude that
\[{\mathbb E}_i\left[e^{\a X_t}\frac{1}{h_{J_t}(\a)}\right]=
e^{k(\a)t}\frac{1}{h_{i}(\a)}.\]
By twice differentiation, we derive
\[ {\rm Var}_{{\boldsymbol \pi}} X_1=k^{''}(0)\ge 0\]
(see e.g. \citet[Cor. 2.6]{APQ}), where
${\rm Var}_{{\boldsymbol \pi}}$ is a variance taken with respect of ${\mathbb E}_{{\boldsymbol \pi}}:
=\sum_{i=1}^N \pi_i {\mathbb E}_i$. Thus
the function $\beta \rightarrow k(\beta)$ is convex.
We have
\begin{align}\label{eq:kappa} k'(0)
={\mathbb E}_{\bs \pi} X_{1}.\end{align}

By net profit condition \eqref{netprofit} we have $k^\prime(0)>0$ and therefore
this means that $\tilde{k}^\prime(0)=k^\prime(-\gamma)<0$.
From \eqref{eq:kappa} we know that $\tilde{k}^\prime(0)$
equals the asymptotic drift of $X$ under $\tilde{\mathbb P}$ which is negative,
that is, $\lim_{t\to+\infty} X_t=-\infty$ $\tilde{\mathbb P}$-a.s.
In other words, under new measure the ruin is certain:
\begin{equation}\label{changedrift}
\tilde{\mathbb P}(\tau_0^-<\infty)=1.
\end{equation}
This allows us to prove the main theorem of this section.
\begin{theorem}\label{Crameasymptotics}
\[\lim_{x\to+\infty}\frac{\phi_i(x)}{e^{-\gamma x}}=C_i\]
for some finite constant $C_i>0$ and $i\in E$.
\end{theorem}
 \begin{proof}
Denoting by $\tilde{{\mathbb E}}$ the expectation with respect of $\tilde{P}$
note that by Optional Stopping Theorem we have
\[\phi_i(x)=e^{-\gamma x}\tilde{{\mathbb E}}_{x,i}\left[e^{\gamma X_{\tau_0^-}}\frac{h_{i}(\gamma)}{h_{J_{\tau_0^-}}(\gamma)};\tau_0^-<\infty\right]=
e^{-\gamma x}\tilde{{\mathbb E}}_{x,i}\left[e^{\gamma X_{\tau_0^-}}\frac{h_{i}(\gamma)}{h_{J_{\tau_0^-}}(\gamma)}\right]\]
where the last equality follows from \eqref{changedrift}.
Moreover, using dual process $\hat{X}=-X$,
we have
\[\frac{\phi_i(x)}{e^{-\gamma x}}=\tilde{{\mathbb E}}_{0,i}\left[e^{\gamma (\hat{X}_{\hat{\tau}_x^+}-x)}\frac{h_{i}(\gamma)}{h_{J_{\hat{\tau}_x^+}}(\gamma)}\right],\]
where $$\hat{\tau}_x^+=\inf\{t\ge 0: \hat{X}_t>x\}.$$
 From the Renewal Theorem 28 of
 \citet{dereich2015real} (see also \citet{Athreyarenewal},
\citet{lalley}, \citet{kesten2} and \citet{Alsmeyer})
 we can conclude that
 right hand side of above identity tends to constant.
\end{proof}

\begin{remark}\rm
In the context of general L\'evy processes above Cram\'er asymptotics was proved by \citet{BerDonCramer}.
\end{remark}

\section{Subexponential asymptotics}\label{sec:subexpnentialasruinprob}
We recall that by Theorem \ref{MMRW} the ruin probability $\phi_i(x)$ defined formally in \eqref{ruinprobdef}
equals the tail of the distribution of the
maximum \[M=\sup_{k\ge 0} S_k\]
of a Markov modulatated random walk
\begin{equation}\label{Sk}S_k=\sum_{l=1}^k \xi_k\end{equation}
with negative drift defined in \eqref{MMRW}
where the distribution $F_\xi^{(i)}(x)$ of $\xi$ is determined by the random variable
\eqref{jumprepresentationdistribution} and discrete time Markov chain with the transition matrix \eqref{transition}.
This section deals with the study of the asymptotic distribution of the tail of the distribution of $M$
when the increments $\xi_k$ have heavy-tailed
distributions, that is, when solution of Cram\'er-Lundberg equation \eqref{cramerlundbergequation} does not exist.
By a \emph{heavy-tailed}
distribution we mean a distribution (function) $G$ on $\mathbb R$
possessing no exponential moments: $\int_0^\infty e^{sy}G(\mathrm d y)=\infty$
for all $s > 0$.
We will use the {\em principle of a single big jump},
which says that the maximum of the random
walk is essentially due to a single very large jump.
More precisely, in this section we will
model the claim size by a subexponential distribution.
This family of distributions is used to model many catastrophic events like earthquakes, storms, terrorist attacks
etc. Additionally, insurance companies use e.g. the lognormal distribution (which is subexponential) to model car claims.

For any distribution function $G$ on $\mathbb R$, we set
$\oo{G}(x)={}1-G(x)$ and denote by
$G^{*n}$ the $n$-fold convolution of $G$ by itself.
A distribution $G$ on $\mathbb R_+$ belongs to the class~$\mathcal{S}$ of
\emph{subexponential} distributions if and only if, for all $n\ge2$,
we have
\[\lim_{x\to\infty}\oo{G^{*n}}(x)/\oo{G}(x)=n.\]
It is sufficient to verify this condition in the case~$n=2$ - see \citet{CHIST}.
This statement is easily shown to be equivalent to the
condition that, if $\xi_1,\dots,\xi_n$ are i.i.d.\ random variables with
common distribution $G$, then
\begin{displaymath}
  \mathbb P(\xi_1+\cdots+\xi_n > x) \sim \mathbb P(\max(\xi_1,\ldots,\xi_n) > x),
\end{displaymath}
a statement which already exemplifies the principle of a single big
jump. Here for any two functions $f$, $g$ on $\mathbb R$, by
$f(x)\sim{}g(x)$ as $x\to\infty$ we mean
$\lim_{x\to\infty}f(x)/g(x)=1$; we also say that $f$ and $g$ are
\emph{tail-equivalent}. The class~$\mathcal{S}$
includes all the heavy-tailed distributions commonly found in
applications, in particular regularly-varying, lognormal and Weibull
distributions.
For any distribution~$G$ on $\mathbb R$ with finite mean, we define the
integrated (or second) tail distribution (function)~$G^{\text{\tiny \rm I}}$ by
\begin{displaymath}
  \oo{G^{\text{\tiny \rm I}}}(x) = 1-G^{\text{\tiny \rm I}}(x)
  = \min\left(1,\int_x^\infty\oo{G}(z)\,\mathrm d z\right).
\end{displaymath}
Good surveys of the basic properties of heavy-tailed
distributions, in particular long-tailed and subexponential
distributions, may be found in \citet{FDZ}, \citet{EKM} and in \citet{asm_ruin}.

In this section
we assume that there exists some \emph{reference}
distribution~$F$ with finite mean and some constants $c_i\ge 0$ $(i\in E$) such that
\begin{flalign*}
  \text{(D1)} & \quad
  \oo{F_\xi^{(i)}}(x)  \le \oo{F}(x),
  \quad \text{ for all } x \in \mathbb R, \qquad i\in E, &\\
  \text{(D2)} & \quad
  \oo{F^{(i)\text{\tiny \rm I}}_\xi}(x)  \sim c_i \oo{F^{\text{\tiny \rm I}}}(x)
  \quad \text{ as } x \to \infty, \qquad i\in E,&\\
  \text{(D3)} & \quad F^{\text{\tiny \rm I}}\in\mathcal{S}.

\end{flalign*}

The condition (D1) is no less restrictive than the condition
\[
\limsup_{x\to\infty} \max_{i\in E} \frac{\oo{F^{(i)}_\xi}(x)}{\oo{F}(x)} < \infty,
  \]
in which case it is straightforward to redefine $F$, and then $c$,
so that (D1) and (D2) hold as above.
Further, the condition  ${(D3)}$ holds for example when integrated tail distribution of claim size
at some state $i\in E$ is subexponential, that is there exists $i\in E$ such that
\[F_C^{(i)I}\in \mathcal{S}.\]

Define \begin{equation}
  \label{eq:3}
  C_S = \sum_{i\in E} c_i\pi_i.
\end{equation}
In \citet{FKZ} the following result is proved.
\begin{theorem}
  \label{simple}
  Suppose that (D1)--(D3) hold.
  Then
\begin{displaymath}
  \lim_{x\to\infty}\frac{\phi_i(x)}{\oo{F^{\text{\tiny \rm I}}}(x)}
 =\lim_{x\to\infty}\frac{\mathbb P_i(M>x)}{\oo{F^{\text{\tiny \rm I}}}(x)}
  = \frac{C_S}{\overline{a}},
\end{displaymath}
where $\overline{a}$ is given in \eqref{driftMMRW} and $i\in E$.
\end{theorem}

Most of the papers concern simple random walk hence the case when $N=1$
and there are no Markov modulation.
Then this problem has been very well understood. In this context
taking $\overline{a}=-E\xi_1>0$ and assuming that $F^{\text{\tiny \rm I}}\in\mathcal{S}$
for distribution function $F$ of $\xi_1$ from Theorem \ref{simple} we derive
classical the Pakes-Veraverbeke's Theorem:
\begin{equation}
  \label{eq:105}
  \mathbb P(M>x) \sim \frac{1}{\overline{a}}\overline{F^{\text{\tiny \rm I}}}(x)
  \qquad\text{as $x\to\infty$};
\end{equation}
see e.g. \citet{PAKES, EV}.
The intuitive idea underlying this result is the
following: the maximum $M$ will exceed a large value $x$ if the
random walk and modulating Markov chain
follow the typical behaviour specified by the law of large
numbers and stationary law ${\boldsymbol \pi}$, respectively, except that at some time $n$ a jump
occurs of size greater than $x+n\overline{a}$; this has
probability~$\oo{F}_i(x+n\overline{a})$ if Markov chain is in a state $i$;
replacing the sum over all $n$ of these
probabilities by an integral yields \eqref{eq:105}. That is,
informally, $\mathbb P(M>x)$ is equivalent (for large initial capital $x$) to the following sum
\begin{align*}
\mathbb P(M>x)&\sim \sum_{n\ge 1} \sum_{i=1}^N \pi_i\mathbb P_i(\xi_n>x+\overline{a}n, \max_{k\le n-1}S_k<x,\\&
S_{n-1}\in ((\overline{a}-\epsilon)(n-1),
(\overline{a}+\epsilon)(n-1)) \sim \sum_{n\ge 1} \sum_{i=1}^N \pi_i\mathbb P_i(\xi_n>x+\overline{a}n)\\& \sim
\sum_{i=1}^N\pi_i\int_0^\infty \overline{F}_i(x+\overline{a}t)\mathrm d t
\sim \sum_{i=1}^N\pi_ic_i\int_0^\infty \overline{F}(x+\overline{a}t)\mathrm d t
=\frac{C_S}{\overline{a}}\overline{F^{\text{\tiny \rm I}}}(x)
\end{align*}
for the random walk $S_n$ defined in \eqref{Sk} and $\epsilon >0$.
This again is the
principle of a single big jump.  See \citet{ZACH} for a short proof
of \eqref{eq:105} based on this idea (see also \citet{FZ02}).

\section{Segerdahl's approximation of finite-time ruin probability}\label{sec:seg}
Our goal in this section is generalizing the seminal result of \citet{Segerdahl} to Markov modulated risk process,
that is, to get the asymptotics of the finite time ruin probability $\mathbf{\phi}(x,t)$ introduced in \eqref{finitetimeruinprob}
when time horizon $t$ is of order $x/m+yc\sqrt{x}/m$ for
\begin{equation}\label{mcdef}
m=\tilde{{\mathbb E}}_{{\boldsymbol \pi}}\hat{X}_1=- \tilde{{\mathbb E}}_{{\boldsymbol \pi}}X_1>0\quad\text{and}\quad c^2=\widetilde{{\rm Var}}_{{\boldsymbol \pi}}\hat{X}_1=\widetilde{{\rm Var}}_{{\boldsymbol \pi}}X_1.
\end{equation}
Above $\widetilde{{\rm Var}}_{{\boldsymbol \pi}}$ denotes the variance calculated under $\tilde{\mathbb P}$
defined in \eqref{expomeasureruin} where $J_0$ starts at stationary distribution ${\boldsymbol \pi}$.
Let $\Phi_N$ be a cumulant distribution function of a standard gaussian random variable.
\begin{theorem}\label{thm:seger}
We have
\[\lim_{x\to+\infty}\frac{\phi_i(x, x/m+yc\sqrt{x}/m^{3/2})}{e^{-\gamma x}}= C_i\Phi_N(y),\]
where constant $C_i$ and the adjustment coefficient $\gamma>0$ are given in \eqref{cramerlundbergequation}
\end{theorem}
\begin{proof}
Using the same arguments like in the proof of Theorem \ref{Crameasymptotics} we have
\begin{equation}\label{finiteruinchangemeasure}
\phi_i(x,t)=e^{-\gamma x}\tilde{{\mathbb E}}_{0,i}\left[e^{\gamma (\hat{X}_{\hat{\tau}_x^+}-x)}; \hat{\tau}_x^+<t\right].\end{equation}
Using Markov modulated random walk
Central Limit Theorem of \citet{Keilson} we have the following result.
\begin{lemma}
Under $\tilde{\mathbb P}$,
$\frac{\hat{X}_s-ms}{c\sqrt{s}}$ converges weakly to standard gaussian random variable $N(0,1)$ as $s\rightarrow+\infty$.
\end{lemma}
From Anscombe’s theorem it follows that
$\frac{\hat{X}_ {\hat{\tau}_x^+}-m \hat{\tau}_x^+}{c\sqrt{\hat{\tau}_x^+}}$ converges weakly to $N(0,1)$ as well.
Moreover, similarly by the Law of Large Numbers and Anscombe’s theorem
we get
\[\frac{x}{\hat{\tau}_x^+}\rightarrow m\qquad \tilde{\mathbb P}-\;{\rm a.s.\quad as}\quad x\rightarrow+\infty.\]
Further, by Renewal Theorem 28 of
 \citet{dereich2015real} the overshoot $\hat{X}_ {\hat{\tau}_x^+}-x$ converges weakly to some random variable
and hence
\[\frac{ \hat{\tau}_x^+-x/m}{c\sqrt{x}/m^{3/2}}\]
converges weakly to $N(0,1)$ as well.
The following Stam's lemma states that ruin time and deficit are asymptotically independent.
Its proof is the same as the proof of  Proposition 4.4, p.
130 of \citet{asm_ruin}.
\begin{lemma}
For bounded and continuous functions $f$ on $[0,\infty)$ and $g$ on $\mathbb{R}$ for $x>0$, we have that
\begin{equation}\label{stam}
\tilde{{\mathbb E}}_i\left(f(\xi(x))g\left(\frac{\hat{\tau}_x^+-\frac{x}{m}}{c\sqrt{x}/m^{3/2}}\right)\right)\sim\tilde{{\mathbb E}}_i f(\xi(\infty))\tilde{{\mathbb E}} g(N(0,1)),
\end{equation}
where $\xi(x)=\hat{X}_{\hat{\tau}_x^+}-x$.
\end{lemma}
\begin{comment}
\begin{proof}
Let $x'=x-x^{\frac{1}{4}}$, then we have:
\begin{eqnarray*}
\tilde{\mathbb{E}}_i\left( \hat{\tau}_x^+ - \hat{\tau}_{x'}^+ \right)&=&
\tilde{\mathbb{E}}_i\left( \hat{\tau}_x^+ - \hat{\tau}_{x'}^+;\ \xi(x')\le x^{\frac{1}{4}} \right) \\
&\le&\tilde{\mathbb{E}}\left( \hat{\tau}_{x-x'}^+;\ \xi(x') \le x^{\frac{1}{4}} \right) \le \tilde{\mathbb{E}}\left( \hat{\tau}_{x^{\frac{1}{4}}} \right)=
O(x^{\frac{1}{4}}).
\end{eqnarray*}
Hence in (\ref{stam}) we can replace $\hat{\tau}_x^+$ by $\hat{\tau}_{x'}^+.$
Because $\xi(x)\Longrightarrow\xi(\infty)$ (by Theorem 28 of
 \citet{dereich2015real}) we have ${\mathbb E} f(\xi(x))\to{\mathbb E} f(\xi(\infty))$
and we get that
\begin{eqnarray*}
\lefteqn{\tilde{{\mathbb E}}_i \left[ f(\xi(x))|\mathcal{F}_{\hat{\tau}_{x'}^+}\right]}\\ &=&\tilde{{\mathbb E}}_i \left[ f(\xi(x));\ \xi(x')>x^{\frac{1}{4}}|\mathcal{F}_{\hat{\tau}_{x'}^+}\right]+
\tilde{{\mathbb E}}_i \left[ f(\xi(x));\ \xi(x')\le x^{\frac{1}{4}};\ \hat{\tau}_{x'}^+\le \varrho|\mathcal{F}_{\hat{\tau}_{x'}^+}\right]\\
&&+\tilde{{\mathbb E}}_i \left[ f(\xi(x));\ \xi(x')\le x^{\frac{1}{4}};\ \hat{\tau}_{x'}^+> \varrho|\mathcal{F}_{\hat{\tau}_{x'}^+}\right]
\end{eqnarray*}
converges in probability
to $\tilde{{\mathbb E}}_i f(\xi(\infty))$
which is the consequence of the fact that
$\tilde{{\mathbb E}}_i \left[ f(\xi(x));\ \xi(x')\le x^{\frac{1}{4}};\ \hat{\tau}_{x'}^+> \varrho|\mathcal{F}_{\hat{\tau}_{x'}^+}\right]$
converges to $\tilde{{\mathbb E}}_i  f(\xi(\infty))$ in probability as first $x\to+\infty$ and then $\varrho\rightarrow +\infty$.
Finally we get:
\begin{eqnarray*}
\lefteqn{\tilde{\mathbb{E}}_i \left( f \left( \xi \left( x \right) \right)
g \left( \frac{\hat{\tau}_x^+-\frac{x}{m}}{c\sqrt{x}/m^{3/2}} \right) \right)}\\
&&
\sim
\tilde{\mathbb{E}}_i \left( f \left( \xi \left( x \right) \right)
g \left( \frac{\hat{\tau}_{x'}^+-\frac{x}{m}}{c\sqrt{x'}/m^{3/2}} \right) \right)
= \tilde{\mathbb{E}}_i \left(  \tilde{\mathbb{E}}_i \left( f \left( \xi \left( x \right) \right) \mid
\mathcal{F}_{\hat{\tau}_{x'}^+}  \right) g \left( \frac{\hat{\tau}_{x'}^+-\frac{x}{m}}{c\sqrt{x'}/m^{3/2}} \right) \right)\\
&&= \tilde{\mathbb{E}}_i \left( f \left( \xi \left( x \right) \right) \mid
\mathcal{F}_{\hat{\tau}_{x'}^+}  \right) \tilde{\mathbb{E}}_i \left(  g \left( \frac{\hat{\tau}_{x'}^+-\frac{x'}{m}}{c\sqrt{x'}/m^{3/2}} \right) \right)
\sim
 \tilde{\mathbb{E}}_if(\xi(\infty))\tilde{\mathbb{E}}g(N(0,1)).
\end{eqnarray*}
\end{proof}
\end{comment}
Now, from \eqref{finiteruinchangemeasure} we get
\begin{eqnarray*}
\lefteqn{\phi_i(x,x/m+yc\sqrt{x}/m^{3/2})=e^{-\gamma x}\tilde{{\mathbb E}}_{0,i}\left[e^{\gamma (\hat{X}_{\hat{\tau}_x^+}-x)}; \hat{\tau}_x^+<x/m+yc\sqrt{x}/m^{3/2}\right]}\\
&&\sim e^{-\gamma x} \tilde{{\mathbb E}}_{i}\left[e^{\gamma\xi(\infty)}\right] \tilde{\mathbb P}\left(\frac{\hat{\tau}_{x}^+-\frac{x}{m}}{c\sqrt{x}/m^{3/2}}\le y\right)
\sim C_i e^{-\gamma x}\Phi_N(y)
\end{eqnarray*}
which completes the proof of Theorem \ref{thm:seger}.
\end{proof}
\section{H\"{o}glund's asymptotics of Markov modulated renewal function and finite-time ruin probability}\label{sec:Hog}
Recall that $E=\{1,2,\ldots,N\}$. In this section we will consider
the solution
\begin{equation}\label{renewalsolution}
U*f(x)=\sum_{n=0}^\infty \Upsilon^{*n}*f(x),\qquad x\in\mathbb R^d,\quad d\in \mathbb{N}
\end{equation}
of the renewal equation
$U-\Upsilon*U=f$
where $\Upsilon=(\Upsilon_{ij})_{\{i,j\in E\}}$ is matrix of a positive measures and $f$ is a vector of measurable functions for which series \eqref{renewalsolution} converges.
Moreover, $*$ denotes convolution in the Markov modulation set-up, that is,
\[(\Upsilon^{*k}f(x))_i=\sum_{i_1,i_2,\ldots, i_{k-1}, i_k\in E}\int f_{i_k}(x-y_1-y_2-\ldots-y_k)\Upsilon_{ii_1}(\mathrm d y_1)\Upsilon_{i_1i_2}(\mathrm d y_2)\ldots \Upsilon_{i_{k-1}i_k}(\mathrm d y_k). \]
We assume that support of each measure $\Upsilon_{ij}$ is $d$-dimensional.
Let $\lambda_{\mathbb R^d}$ denotes the Lebesgue measure in $\mathbb R^d$ and by $<\cdot,\cdot>$ we denote the scalar product in $\mathbb R^d$.
Finally, let ${\boldsymbol \pi}^\Upsilon=(\pi^\Upsilon_1, \ldots,\pi^\Upsilon_N)$ be a stationary distribution of the discrete-time
Markov chain with the transition matrix $\{\Upsilon_{ij}(\mathbb R^d)\}_{\{i,j\in E\}}$.
We denote
\begin{align*}
\Theta&=\left\{\theta\in \mathbb R^d: \int_{\mathbb R^d}|x|^2e^{<\theta,x>}\Upsilon_{ij}(\mathrm d x)<\infty,\quad i,j\in E\right\}
\end{align*}
and let for $\theta=(\theta_1, \ldots, \theta_d)\in \Theta$ the function
$\varphi(\theta)$ be a Perron-Frobenius eigenvalue of the matrix $(\int_{\mathbb R^d} e^{<\theta,x>}\Upsilon_{ij}(\mathrm d x))_{\{i,j\in E\}}$.
We also define
\begin{align*}
\varphi^\prime(\theta)=\left(\frac{\partial}{\partial \theta_1}\varphi(\theta), \ldots, \frac{\partial}{\partial \theta_d}\varphi(\theta)\right),
&\qquad \varphi^{\prime\prime}(\theta) =\left\{\frac{\partial^2}{\partial \theta_i\partial \theta_j}\varphi(\theta)\right\}_{\{i,j\in E\}},\\
\beta=\max\left\{2,\frac{d-1}{2}\right\},&
\qquad C=\varphi^\prime(\theta)(\varphi^{\prime\prime}(\theta))^{-1}\varphi^\prime(\theta){\rm det}\varphi^{\prime\prime}(\theta),\\
\end{align*}
\begin{align*}
\varpi=x(\varphi^{\prime\prime}(\theta))^{-1}\varphi^\prime(\theta)/\varphi^\prime(\theta)(\varphi^{\prime\prime}(\theta))^{-1}\varphi^\prime(\theta).
\end{align*}
We will look for the solution of the equation
\begin{equation}\label{CLequationHog}
\varphi(\theta)=1.
\end{equation}
If this solution exists, we have either $\varphi^{\prime}(\theta)\neq 0$ for all $\theta$ or
it is one-point set otherwise (compare with \citet[Lem. 1]{Hoglund1}).
We recall that  function $g$ is directly Riemann integrable
if $\int \overline{g}_h-\int \underline{g}_h$ tends to $0$ as $|h|\rightarrow 0$
for $\overline{g}_h(x)=\sup_{y\in (nh, (n+1)h]}g(x)$ and $\underline{g}_h(x)=\inf_{y\in (nh, (n+1)h]}g(x)$
for $x\in (nh, (n+1)h]$.

\begin{theorem}\label{Hoglund}
Assume that $\varphi^{\prime}(\theta)\neq 0$
and $\theta$ satisfies \eqref{CLequationHog}. Let $\varpi\ge 0$.
Suppose that $\int (|x|^2+|<c,x>|^\beta)e^{<\theta,x>}\Upsilon_{ij}(\mathrm d x)$ and $\int (1+|<c,x>|^\beta)e^{<\theta,x>}|f(x)|\lambda_{\mathbb R^d}(\mathrm d x)$ are finite for all $i,j\in E$
and that integrand in the last integral is directly Riemann integrable for some $0\neq c\in \mathbb R^d$.
In addition, we assume that $<c,\varphi(\theta)>\neq 0$ if $d=2$. Then
\begin{eqnarray*}
&&e^{<\theta,x>}(U*f(x){\bs 1})_i=\left(2\pi \varpi\right)^{-(d-1)/2}C^{-1/2}\exp\{-(x-\varpi\varphi^\prime(\theta))(\varphi^{\prime\prime}(\theta))^{-1}(x-\varpi\varphi^\prime(\theta))\}\\
&&\qquad\times \int e^{<\theta,y>}{\boldsymbol \pi}^\Upsilon f(y)\lambda_{\mathbb R^d} (\mathrm d y)+{\rm o}((1+|<c,x>|)^{-(d-1)/2})
\end{eqnarray*}
uniformly in $x$, as $|x|\rightarrow +\infty$.
In particular, if
$\varphi^\prime(\theta)/|\varphi^\prime(\theta)|=x/|x|$ we have
\begin{equation}\label{CLasHog1}
\lim_{|x|\to+\infty}\frac{(U*f(x){\bs 1})_i}{e^{-<\theta,x>}}=\left(2\pi \varpi\right)^{-(d-1)/2}C^{-1/2}\int e^{<\theta,y>}{\boldsymbol \pi}^\Upsilon f(y)\lambda_{\mathbb R^d} (\mathrm d y).
\end{equation}
\end{theorem}
\begin{proof}
Basically the proof is the same as the proof of \citet[Thm. 1.2 and Thm. 1.4]{Hoglund1}.
There are some minor differences though.
In any estimate one has to take all algebraic operations entrywise for matrices and
then maximum of minimum should be applied over $E$ should be applied.
The crucial difference is in the proof of equations (2.43) where Central Limit Theorem
is applied to a random walk associated with measure $\Upsilon$.
In this place one has to use \citet[p. 552]{Keilson} instead.
\end{proof}
To identify the finite time ruin probability at the beginning we follow
\citet[Prop. 3.2]{Hoglund2}.

Let $S=(S^1,S^2)= \{(S^1_n,S^2_n), n=1,2,\ldots\}$ be a (possibly killed)
Markov modulated random walk starting from $(0,0)$ whose components $S^1$ and
$S^2$ have non-negative increments.
Let $J^\Upsilon$ be a Markov chain modulating this random walk living in the state space $E=\{1,2,\ldots,N\}$.
Consider the crossing
probabilities
\begin{eqnarray}
G_{a,b,i}(x,y,i) &=& \mathbb P(N(x)<\infty, S^1_{N(x)} > x + a, S^2_{N(x)} \le x+b|J^\Upsilon_0=i),  \label{gab}\\
K_{a,b,i}(x,y,i) &=& \mathbb P(N(x)<\infty, S^1_{N(x)} > x + a, S^2_{N(x)} \ge x+b|J^\Upsilon_0=i),\nonumber
\end{eqnarray}
where $a\ge 0, b\in\mathbb R$ and
\begin{equation}\label{Nx}
N(x) = \min\{n: S_n^1  > x\}.
\end{equation}
Let ${\boldsymbol \pi}^\Upsilon$ be the stationary distribution of environmental
Markov chain $J^\Upsilon$
and
let $$V(\zeta)={\mathbb E}^\zeta_{{\mathbf \pi}}[(S^2_1{\mathbb E}^\zeta_{{\mathbf \pi}}[S^1_1] - S_1^1
{\mathbb E}^\zeta_{{\mathbf \pi}}[S^2_1])^2]/ {\mathbb E}^{\zeta}_{{\mathbf \pi}}[S_1^1]^3$$ for $\zeta=(\eta_1,\eta_2)$ where
${\mathbb E}^\zeta_{{\mathbf \pi}}$ denotes the expectation w.r.t. $$\mathbb P^\zeta_{{\mathbf \pi}}(\cdot)=
\sum_{i,j=1}^N \pi^\Upsilon_i{\mathbb E}[e^{<S_1, \zeta>}, S_1\in \cdot, J_1^\Upsilon=j|J^\Upsilon_0=i].$$
For our purposes it will suffice to consider
random walks that satisfy the following
assumption (the analogue of the non-lattice
assumption in one dimension):
\begin{equation*}
\tag*{(G)}
\text{The additive group spanned by the support of $F^\zeta$ contains $\mathbb R^2_+$.}
\end{equation*}
Now observe that $G_{a,b,i}(x,y)$ and $K_{a,b,i}(x,y)$ are of the form
$(\sum_{n=0}^\infty \Upsilon^{*n}*f(x){\bs 1})_i$
with $d=2$,
\[\Upsilon(\mathrm d x, \mathrm d y)=\mathbb P(S_1^1\in \mathrm d x, S^2_1\in \mathrm d y)\]
and $f(x,y)=\Upsilon((x+a,+\infty), (-\infty, x+b]){\bs 1}$
or $f(x,y)=\Upsilon((x+a,+\infty), [x+b, +\infty)){\bs 1}$, respectively.
For $\theta=(\theta_1, \theta_2)\in \Theta^\circ$ let $\varphi(\theta)$ be a Perron-Frobenius eigenvalue of the matrix
$(\int_{\mathbb R^2} e^{\theta_1 x+\theta_2 y}\Upsilon_{ij}(\mathrm d x, \mathrm d y))_{\{i,j\in E\}}$.
One can easily check that all moments and direct Riemann integrability conditions
of Theorem \ref{Hoglund} are satisfied.
We will also write $f\asymp g$ if $\lim_{x,y\to\infty, x=vy+{\rm o}(y^{1/2})} f(x,y)/g(x,y) =
1$.
Applying \eqref{CLasHog1} produces the following key proposition (see Theorem 2.1 of \citet{Hoglund2}
and Cor. 2.7, p. 313 of \citet{APQ}).
\begin{prop}\label{hog}
Assume that $(G)$ holds, and that there exists a
$\zeta=(\eta_1, \eta_2)$ with $\varphi(\zeta)=1$ such that $v =
{\mathbb E}^\zeta_{{\mathbf \pi}}[S_1^1]/{\mathbb E}^\zeta_{{\mathbf \pi}}[S_1^2]$, where $\varphi$ is finite in a
neighbourhood of $\zeta$ and $(0,\eta_2)$. If $x,y$ tend to infinity
such that $x=vy+{\rm o}(y^{1/2})>0$ then it holds that
\begin{eqnarray*}
G_{a,b,i}(x,y) &\asymp & D(a,b) x^{-1/2}\te{x\eta_1+y\eta_2}
\quad \text{if\, $\eta_2>0$},\\
K_{a,b,i}(x,y) &\asymp & D(a,b) x^{-1/2}\te{x\eta_1+y\eta_2} \quad \text{if\,
$\eta_2<0$},
\end{eqnarray*}
for $a\ge 0, b\in\mathbb R$, where $D(a,b) = C(a,b) \cdot (2\pi
V(\zeta))^{-1/2} $, with $V(\zeta)>0$ and
$$
C(a,b) = \frac{1}{|\eta_2| {\mathbb E}^\zeta_{{\mathbf \pi}}[S_1^1]} e^{b\eta_2}\int_a^\infty
\mathbb P^\zeta_{{\mathbf \pi}}(S_1^1 \ge x)e^{\eta_1 x}\mathrm d x.
$$
\end{prop}

In the last step we follow \citet{PalmowskiPistoriusexplev}
and prove the following main result satisfied for general MAP $\hat{X}_t=-X_t$.
The result below concerns the asymptotics of the finite time ruin
probability
$$\phi_i(x)=\mathbb P(\hat{\tau}_x^+\le t)$$
when $x,t$ jointly tend to infinity
in fixed proportion. For a given proportion $v$ the rate of decay
is either equal to $\gamma v t$ or to $k^*(v)t$, where $k^*$
is the convex conjugate of the Perron-Frobenius eigenvalue $\hat{k}$ of the
matrix exponent $\hat{F}$ of the dual MAP $\hat{X}=-X$:
$$\hat{k}^*(x) = \sup_{\alpha\in\mathbb R}(\alpha x - \hat{k}(\alpha)).
$$
We restrict ourselves to the risk process in the regime switching environment satisfying the
following condition
\begin{equation}
\tag*{(H)} \text{
$\nu^{(ij)}$ defined in \eqref{nu} are non-lattice for all $i,j\in E$.}
\end{equation}
Recall that a measure is called non-lattice if its support is not
contained in a set of the form $\{a + bh, h\in\mathbb Z\}$, for
some $a,b>0$.

To present the main result we need few additional notations.

Let $\underline{L}_t$ be a local time of $X_t-\inf_{s\le t} X_s$ which in our case increases only
at epochs $\tau_k$ defined via $\tau_0=0$, $\tau_k=\inf\{t>\tau_{k-1}: X_t-\inf_{s\le t} X_s=0\}$.
Let $\underline{L}^{-1}_t$ be the inverse local time and as usual let $\underline{\boldsymbol L}^{-1}_t$ denote the vector of total times spent in different phases up to
$\underline{L}^{-1}_t$.
Observe that the ladder process $((\underline{H}_t,\underline{\boldsymbol L}^{-1}_t),J_{\underline{L}^{-1}_t})$
for $\underline{H}_t=X_{\underline{L}^{-1}_t}$
is a bivariate Markov additive process.
Thus for  $\a\ge 0$ and ${\bs b}=(\beta_1, \ldots, \beta_N)$ with $\b_i\ge 0$ there exists matrix valued function $\underline K({\bs b},\a)$ such that
\begin{equation}\label{K}
{\mathbb E}[{\mathrm e}^{\a \underline{H}_t-\langle{\bs b},\underline{\boldsymbol L}^{-1}_t\rangle};J_{ \underline{L}^{-1}_t}]={\mathrm e}^{\underline K({\bs b}, \a)t},\end{equation}
because $\underline{L}^{-1}_0=0$.
Let  \[((\overline{\hat{H}}_t,{\overline{\hat{\boldsymbol L}}}^{-1}_t),\overline{J}_t)=
((\underline{H}_t,{\underline{{\boldsymbol L}}}^{-1}_t),\underline{J}_t)\]
with
\[\underline{J}_t=J_{{\overline{\hat{L}}}^{-1}_t}\]
be a ladder process
related with supremum of the dual risk process $\hat{X}=-X$ and $\overline{\hat{K}}(\alpha, {\bs b})$ is its matrix Laplace exponent.
Note that $((\underline{H}_t,{\underline{{\boldsymbol L}}}^{-1}_t),\underline{J}_t)$ is the bivariate MAP.
We denote by $\overline{{\boldsymbol \pi}}$ the stationary distribution of $\underline{J}_t$.
The assumption (H) and Vigon's formula (see \citet[Thm. 6.22 and Sec. 6..6.2]{kyprianou}) implies that
the jump measures associated to $\overline{\hat{H}}$ is non-lattice as well.
To simplify notation we will write in this section
\[(\underline{H}_t,{\underline{{\boldsymbol L}}}^{-1}_t{\bs 1})=(H_t, L_t^{-1}).\]
Let $$\Theta_{<\infty}=\{\theta\in\mathbb R: \hat{k}(\theta)=k(-\theta)<\infty\}$$
and $\Theta^\circ_{<\infty}$ be its interior.

\begin{theorem}\label{thm}
Assume that $(H)$ holds. Suppose that $0<\hat{k}^\prime(\gamma)=k^\prime(-\gamma)<\infty$ and
that there exists a $\Gamma(v)\in\Theta^\circ_{<\infty}$ such that
$\hat{k}'(\Gamma(v))=v$. If $x$ and $t$ tend to infinity such that $x=
vt+{\rm o}(t^{1/2})$ then
$$
\phi_i(x)=\mathbb P_i(\hat{\tau}_x^+\le t) \asymp \begin{cases} C_i e^{-\gamma x},
& \text{if $0< v < \hat{k}'(\gamma)$,}\\
D_v t^{-1/2}e^{-\hat{k}^*(v)t}, & \text{if $ v > \hat{k}'(\gamma)$,}
\end{cases}
$$
with $C_i$ given in Theorem \ref{Crameasymptotics} and
\begin{align*}
D_v &= \frac{1}%
{\eta_v {\mathbb E}_{\overline{{\boldsymbol \pi}}}[e^{\Gamma(v) H_1-\eta_v L_1^{-1}}H_1\ind{L_1^{-1}<\infty}]} \times \frac{v}{\Gamma(v)
\sqrt{2\pi\hat{k}''(\Gamma(v))}}\\&\qquad\times \overline{{\boldsymbol \pi}}\kappa(\hat{k}(\Gamma(v)),0)(q\mathbb{I}+\kappa(\hat{k}(\Gamma(v)),0))^{-1}{\bs 1},
\end{align*}
where $\eta_v = \hat{k}(\Gamma(v))$.
\end{theorem}

\begin{remark}\label{uwaga1}\rm
In the case of risk process \eqref{riskMM3} with $N=1$
(there is no Marov modulation)
we can find that
$$
D_v = \frac{\Gamma(v) + \tilde\Gamma(v)}{\Gamma(v)\tilde\Gamma(v)}
\frac{1}{\sqrt{2\pi\hat{k}''(\Gamma(v))}}, \quad C_1 =
\frac{\hat{k}'(0)}{\hat{k}'(\gamma)},
$$
where $\tilde\Gamma(v) = \sup\{\theta:\hat{k}(-\theta) = \hat{k}(\Gamma(v))\}$,
recovering formulas that can be found in \citet{Arfwedson} and
\citet{feller} respectively, for the case of a classical risk
process.
\end{remark}

\begin{remark}\rm
Note that asymptotics given in Theorem \ref{thm} works for different range
of time horizons than Segerdahl's approximation identified in Theorem
\ref{thm:seger}.
\end{remark}

\begin{proof}
At the beginning we will use the exponential change of measure \eqref{expomeasureruin} defining $\tilde{\mathbb P}_i$.
In the case $0<v<\hat{k}'(\gamma)$, the asymptotics in Theorem
\ref{thm} are a consequence of the law of large numbers. To see
why this is the case, note that $e^{\gamma x}\mathbb P_i(\hat{\tau}_x^+\le t) =
e^{\gamma x}\mathbb P_i(\hat{\tau}_x^+ < \infty) - e^{\gamma x}\mathbb P_i(t<\hat{\tau}_x^+ < \infty)$,
where the first term tends to $C_i$ in view of Theorem \ref{Crameasymptotics},
while for the second term the Markov property
imply that
\begin{eqnarray*}
\lefteqn{e^{\gamma x}\mathbb P_i(t<\hat{\tau}_x^+ < \infty)}\\&&\le\sum_{j\in E}\int_{-\infty}^x
\mathbb P_i(\hat{\tau}_x^+>t, \hat{X}_t\in \mathrm d y)e^{\gamma y}e^{\gamma (x-y)}\mathbb P_j(\hat{\tau}_{x-y}^+<\infty)\\
&&\le \int_{-\infty}^x \mathbb P_i(\hat{X}_t\in \mathrm d y)e^{\gamma
y}=\tilde{\mathbb P}_i(\hat{X}_t\le x),
\end{eqnarray*}
which tends to $0$ as $t$ tends to infinity in view of the law of
large numbers since $\tilde{{\mathbb E}}[\hat{X}_t]=t\hat{k}'(\gamma)>x=vt+{\rm o}(t^{1/2})$.
We will now consider the case of $v>\hat{k}'(\gamma)$.

We start from construction of the embedded Markov modulated random walk
at Poisson epochs.
Denote by $e_1, e_2, \ldots$ a sequence of independent identically exponentially distributed with
parameter $q$ random variables and by $\sigma_n=\sum_{i=1}^n e_i$, with
$\sigma_0=0$, the corresponding partial sums. Consider the
two-dimensional (killed) Markov modulated random walk $\{(S_n^1,S_n^2), n=1,2\ldots\}$
starting from $(0,0)$ with step-sizes distributed according to
$$
\Upsilon^{(q)}(\mathrm d x, \mathrm d t) =
\mathbb P(S_1^1\in \mathrm d x, S_1^2\in \mathrm d t)= \mathbb P(
H_{\sigma_{1}}\in \mathrm d x, L^{-1}_{\sigma_{1}}\in\mathrm d t),
$$
and write $G^{(q)}$ for the corresponding crossing probability
$$
G^{(q)}(x,t) = G_{0,0,i}(x,t) = \mathbb P_i(N(x)<\infty, S^2_{N(x)}
\le t)
$$
for $N(x)$ defined in \eqref{Nx} and $G_{a,b,i}(x,y)$ defined in \eqref{gab}.
Note that
\begin{equation}\label{phikappalink}
\iint e^{-ux-vt} \mathbb P(S_1^1\in \mathrm d x, S_1^2\in \mathrm d t)  = q(q\mathbb{I}
- \kappa(v,u))^{-1},
\end{equation}
where
\begin{equation}\label{kappa}
\kappa(v,u)=\overline{\hat{K}}(v{\bs 1}^T, u),
\end{equation}
and $\overline{\hat{K}}$ is a matrix Laplace exponent of
a ladder process related with supremum of the dual risk
$\hat{X}=-X$ defined formally below \eqref{K}.

The key step in the proof is to derive bounds for $\mathbb P(\hat{\tau}_x^+\le
t)$ in terms of crossing probabilities involving the random walk
$(S^1,S^2)$.
\begin{lemma}\label{lem:est} Let $M,q>0$. For $x,t>0$ it holds that
\begin{equation}\label{star}
G^{(q)}(x,t) \le \mathbb P_i(\hat{\tau}_x^+\le t) \le G^{(q)}(x,t+M)/\min_{i\in E} h_i(0-, M),
\end{equation}
where $h(0-,M) = \lim_{x\uparrow 0} h(x,M)$, with $h(x,t) =
\mathbb P(H_{\sigma_1} > x, L^{-1}_{\sigma_1} \le t){\bs 1}$.
\end{lemma}

\begin{proof}
Let $T(x) = \inf\{t\ge0: H_t > x\}$ and note that
$\hat{\tau}_x^+ = L^{-1}_{T(x)}$. By applying the Markov property it
follows that
\begin{eqnarray}
 \mathbb P_i(\hat{\tau}_x^+\le t
 &=& \mathbb P_i(T(x) < \infty, L^{-1}_{T(x)} \le t)\\
  &=& \sum_{n=1}^\infty \mathbb P(\sigma_{n-1} \le T(x) < \sigma_n, L^{-1}_{T(x)} \le
  t)\nonumber\\
  &=& \sum_{n=1}^\infty \mathbb P(H_{\sigma_{n-1}}\le x, H_{\sigma_n} > x,
L^{-1}_{T(x)} \le
  t)\nonumber\\
  &=& \sum_{n=1}^\infty\int  \mathbb P_i(H_{\sigma_{n-1}}\in \mathrm d y,
  L^{-1}_{\sigma_{n-1}}\in\mathrm d s) \\&& \quad \quad \times\ \mathbb P(H_{\sigma_1} > x - y, L^{-1}_{T(x-y)} \le
  t-s)\nonumber\\
  &=& \left(\sum_{n=0}^\infty (\Upsilon^{(q)})^{\star n} \star f(x,t)\right)_i = ((U \star
  f)(x,t))_i,\label{eq:u*f}
\end{eqnarray}
where $U=\sum_{n=0}^\infty (\Upsilon^{(q)})^{\star n}$, $f(x,t) = \mathbb P(H_{\sigma_1}
> x, L^{-1}_{T(x)} \le t){\bs 1}$ and $\star$ denotes convolution.
Following a similar reasoning it can be
checked that \begin{equation}\label{eq:u*h}G^{(q)}(x,t) = (U\star
h(x,t){\bs 1})_i.\end{equation} In view of \eqref{eq:u*f} and
\eqref{eq:u*h}, the lower bound in \eqref{star} follows since $$f(x,t) \ge h(x,t),$$ taking note of the fact that $H_{\sigma_1}> x$
precisely if $T(x) < \sigma_1$,
while the upper bound in \eqref{star} follows by observing that
for fixed $M>0$,
\begin{eqnarray*}
\nonumber  h(x,t+M) &\ge& \mathbb P(H_{\sigma_1} > x, L^{-1}_{T(x)}
\le t, L^{-1}_{\sigma_1} - L^{-1}_{T(x)} \le M){\bs 1}\\
\nonumber &=& \mathbb P(H_{\sigma_1} > x, L^{-1}_{T(x)} \le t) \mathbb P(L^{-1}_{\sigma_1} \le
M){\bs 1}\\ &\ge& f(x,t)\min_{i\in E} h_i(0-,M),
\end{eqnarray*}
where we used the strong Markov property of $L^{-1}$ and the lack
of memory property of $\sigma_1$. \end{proof}

\medskip

\noindent
Applying H\"oglund's asymptotics in Proposition \ref{hog} yields
the following result.

\begin{lemma}\label{hog2}
Let the assumptions of Proposition \ref{hog} hold true. If
$x,t\to\infty$ such that for $v > \hat{k}'(\gamma)$ we have $x=vt+{\rm o}(t^{1/2})$ then
$$
G^{(q)}(x,t+M) \sim D_{q,M}t^{-1/2}e^{-\hat{k}^*(v)t}, \quad M\ge 0,
$$
where $D_{q,M} = \frac{v}{\sqrt{2\pi\hat{k}''(\Gamma(v))}} C_{q,M}$ with
$$
C_{q,M} =
\frac{q e^{\hat{k}(\Gamma(v))M}}{c_v\hat{k}(\Gamma(v))\Gamma(v)}\overline{{\boldsymbol \pi}}\kappa(\hat{k}(\Gamma(v)),0)(q\mathbb{I}+\kappa(\hat{k}(\Gamma(v)),0))^{-1}{\bs 1},
$$
where $c_v={\mathbb E}_{\overline{{\boldsymbol \pi}}}[e^{\Gamma(v) H_{1} - \hat{k}(\Gamma(v))L^{-1}_{1}}H_{1} \ind{L^{-1}_{1}<\infty}]$
and $\kappa$ is defined in \eqref{kappa}.
\end{lemma}

For $u>\gamma$ and $u\in\Theta^\circ_{<\infty}$ we denote by $\mathbb P^{(u)}$ the measure
\begin{equation}\label{expomeasureruinb}
\frac{\mathrm d \mathbb P^{(u)}_{|\mathcal{F}_t}}{\mathrm d\mathbb P_{|\mathcal{F}_t}}=e^{u (X_t-x)-k(u)t}
\frac{h_{J_t}(u)}{h_{J_0}(u)}.\end{equation}
Let ${\mathbb E}^{(u)}$ be the expectation with respect of $\mathbb P^{(u)}$.
Lemma \ref{hog2} is a consequence of the following auxiliary
identities given in \citet{PalmowskiPistoriusexplev}:
\begin{eqnarray}
\label{eq:a}\varphi(z,-u)&=&1 \quad \text{iff  $\kappa(z,-u)=0$ iff
$\hat{k}(u)=z$},
\\
\label{eq:b} \hat{k}'(u) &=&
{\mathbb E}^{(u)}_{\overline{{\boldsymbol \pi}}}[\hat{X}_1]={\mathbb E}^{(u)}_{\overline{{\boldsymbol \pi}}}[H_{\sigma_1}]\cdot({\mathbb E}^{(u)}_{\overline{{\boldsymbol \pi}}}[L^{-1}_{\sigma_1}])^{-1},\\
\nonumber  \hat{k}''(u)& =& {\mathbb E}^{(u)}_{\overline{{\boldsymbol \pi}}}[(H_{\sigma_1} -
\hat{k}'(u)L^{-1}_{\sigma_1})^2]\cdot({\mathbb E}^{(u)}_{\overline{{\boldsymbol \pi}}}[L^{-1}_{\sigma_1}])^{-1},\\
\label{eq:c} &=&\hat{k}'(u){\mathbb E}^{(u)}_{\overline{{\boldsymbol \pi}}}[(H_{\sigma_1} -
\hat{k}'(u)L^{-1}_{\sigma_1})^2]\cdot({\mathbb E}^{(u)}_{\overline{{\boldsymbol \pi}}}[H_{\sigma_1}])^{-1},\\
\label{eq:d} \hat{k}^*(v) &=& v\Gamma(v) - \hat{k}(\Gamma(v))\quad
\text{for $v>0$ with $\Gamma(v)\in\Theta^\circ_{<\infty}$.}
\end{eqnarray}
In particular, the first identity follows from \eqref{phikappalink}, \eqref{kappa} and
Wiener-Hopf factorization given in Theorem 26 of \citet{dereich2015real}.

\begin{proof}[Proof of Lemma \ref{hog2}] The proof follows by an
application of Prop. \ref{hog} to $G^{(q)}(x,t+M)$ with
$$(S_1^1, S_1^2)
= (H_{\sigma_1},L^{-1}_{\sigma_1})\quad \text{ and }\quad
\zeta=(-\Gamma(v),\eta_v).$$ Note that, by \eqref{eq:a} with
$u=\Gamma(v)$, $\varphi(\zeta)=1$, and that $\eta_v = \hat{k}(\Gamma(v))>0$
if $v > \hat{k}'(\gamma)$. For this choice of the parameters,
${\mathbb E}^\zeta_{{\boldsymbol \pi}}[S_1^1]={\mathbb E}^{(\Gamma(v))}_{\overline{{\boldsymbol \pi}}}[H_{\sigma_1}]=c_v/q$, and Equations
\eqref{eq:b},\eqref{eq:c} \eqref{eq:d} imply that  $\xi x+\eta
t=-\hat{k}^*(v)t$ and
$$V(\zeta)=
\hat{k}''(\Gamma(v))/\hat{k}'(\Gamma(v))=\hat{k}''(\Gamma(v))/v.$$ To
complete the proof we are left to verify
 the form of the constants. The calculation of the
$C_{q,M}=C(0,0)e^{\eta_v M}$ goes as follows:
\begin{eqnarray*}
C_{q,M} &=&
\frac{qe^{\hat{k}(\Gamma(v))M}}{\hat{k}(\Gamma(v))c_v}\left(\int_0^\infty
e^{-\Gamma(v)x}{\mathbb E}_{\overline{{\boldsymbol \pi}}}[e^{\Gamma(v) H_{\sigma_1} - \hat{k}(\Gamma(v))L^{-1}_{\sigma_1}}
\ind{(x\le H_{\sigma_1} < \infty)}]\mathrm d x \right)\\
&=& \frac{qe^{\hat{k}(\Gamma(v))M}}{\hat{k}(\Gamma(v))\Gamma(v)c_v}
\left(1 - {\mathbb E}_{\overline{{\boldsymbol \pi}}}[e^{-\hat{k}(\Gamma(v))L^{-1}_{\sigma_1}}\ind{(L^{-1}_{\sigma_1} < \infty)}]\right)\\
&=& \frac{qe^{\hat{k}(\Gamma(v))M}}{\hat{k}(\Gamma(v))\Gamma(v)c_v}\left(1 -
q\overline{{\boldsymbol \pi}}(q\mathbb{I}+\kappa(\hat{k}(\Gamma(v)),0))^{-1}{\bs 1}\right).\\
&=& \frac{qe^{\hat{k}(\Gamma(v))M}}{\hat{k}(\Gamma(v))\Gamma(v)c_v}
\overline{{\boldsymbol \pi}}\kappa(\hat{k}(\Gamma(v)),0)(q\mathbb{I}+\kappa(\hat{k}(\Gamma(v)),0))^{-1}{\bs 1},
\end{eqnarray*}
Combining all
results completes the proof.\end{proof}

\begin{comment}

As final preparation for the proof of Theorem \ref{thm}
we show that the non-lattice condition holds:
\begin{lemma}
Suppose that $(H)$ holds true. Then $F^{(q)}$ satisfies (G).
\end{lemma}

\begin{proof} The assertion is a consequence of the following
identity between measures on $(0,\i)^2$ (which is itself a
consequence of the Wiener-Hopf factorisation, see e.g. Bertoin
\cite[Cor VI.10]{B})
\begin{equation}\label{eq:wh}
\mathbb P(X_t\in\mathrm d x)\mathrm d t = t\int_0^\infty \mathbb P(L^{-1}_u\in\mathrm d t, H_u\in\mathrm d x)
u^{-1}\mathrm d u.
\end{equation}
Fix $(y,v)\in (0,\i)^2$ in the support of $\mu_X(\mathrm d t,\mathrm d x) =
\mathbb P(X_t\in\mathrm d x)\mathrm d t$ and let $B$ be an arbitrary open ball around
$(y,v)$. Then $\mu_X(B)>0$; in view of the identity \eqref{eq:wh}
it follows that there exists a set $A$ with positive Lebesgue
measure such that $\mathbb P((L^{-1}_u, H_u)\in B) > 0$ for all $u\in A$
and thus $\mathbb P((L^{-1}_{\sigma_1}, H_{\sigma_1})\in B) > 0$. Since $B$ was
arbitrary we conclude that $(y,v)$ lies in the support of
$F^{(q)}$. To complete the proof we next verify that if a L\'{e}vy
process $X$ satisfies (H) then $\mu_X$ satisfies (G). To this end,
let $X$ satisfy (H). Suppose first that its L\'{e}vy measure $\nu$
has infinite mass or $\sigma>0$. Then $\mathbb P(X_t=x)=0$ for any $t>0$
and $x\in\mathbb R$, according to Sato \cite[Thm. 27.4 ]{Sato}. Thus, the
support of $\mathbb P(X_t\in\mathrm d x)$ is uncountable for any $t>0$, so that
$\mu_X$ satisfies (G). If $\nu$ has finite mass then it is
straightforward to verify that $\mathbb P(X_t\in\mathrm d x)$ is non-lattice for
any $t>0$ if $\nu$ is, and that then $\mu_X$ satisfies (G).
\end{proof}
\bigskip
\end{comment}

Now we can complete the proof of Theorem \ref{thm}.
Writing $l(t,x) = t^{1/2}e^{\hat{k}^*(v)t}\mathbb P(\hat{\tau}_x^+\le t)$, Lemmas
\ref{lem:est} and \ref{hog2} imply that
\begin{eqnarray*}
s &=& \limsup_{x,t\to\infty, x=tv+{\rm o}(t^{1/2})} l(t,x) \le D_{q,M}/\min_{i\in E} h_i(0-,M),\\
i &=& \liminf_{x,t\to\infty, x=tv+{\rm o}(t^{1/2})} l(t,x) \ge D_{q,0}.
\end{eqnarray*}
By definition of $h$ and $D_{q,M}$ it directly follows that, as
$q\to\infty$,
$$D_{q,0} \to D_v,\ D_{q,M} \to D_v e^{\hat{k}(\Gamma(v))M}\text{ and }
h(0-,M)=\mathbb P(L^{-1}_{\sigma_1}\le M){\bs 1}\to {\bs 1}.$$ Letting $M\downarrow 0$
yields that $s=i = D_v$, and the proof is complete.
\end{proof}

\section{Parisian ruin}\label{sec:Par}
In this section we follow \citet{CzarnaPalmowski, Loeffenetalpar, DassWu1}
considering so-called Parisian ruin probability,
that occurs if the risk process $X$ defined in \eqref{riskMM3} stays below zero for a longer period than a fixed $\zeta>0$.
Formally, we define
Parisian time of ruin by:
$$\tau^{\zeta}=\inf\{t>0: t-\sup\{s<t: X_s \ge 0\}\ge \zeta, X_t<0 \}$$
and Parisian ruin probability is then given by:
$$\mathbb P_{x,i}(\tau^\zeta<\infty).$$
The case $\zeta=0$ corresponds to classical ruin problem and we do not deal with this case in this section.
The name for this problem is borrowed from the Parisian option. Depending on type of such option the prices
are activated or canceled if
underlying asset stays above or below barrier long enough in a row.
It is a common belief that Parisian ruin probability is a better measure of risk
than classical ruin probability in many situations
giving possibility for insurance company to get solvency.
We consider here the fixed delay $\zeta$. In other
papers the deterministic and fixed delay $\zeta$ is replaced by an
independent exponential random variable; see e.g. \citet{Land2, EriketalGerrberpar}.
In this case, as pointed in \citet{Jevsstriking, Gordonetal}, the ruin probability
is closely related with Poisson observed ruin probability.
The paper that deal with this probability in the context of MAP risk processes is \citet{Chineeseparisian}.

We give in next theorem different main representation of the Parisian survival probability though.
Recall that by
\[\tau_x^+=\inf\{t\ge 0:X_t>x\}\]
we denote the first passage time over a level $x\ge 0$
and observe that $X_{\tau_x^+}=x$ a.s., because of absence of positive jumps.
The Markov additive property applied at $\tau_x^+$ implies that $J_{\tau_x^+}$, the phase observed at the first passage times, is a Markov chain indexed by the level~$x\ge 0$.
Hence there is an identity:
\begin{align}
\label{eq:Gdef_cont}
 {\mathbb E}[e^{-q\tau_x^+}, J_{\tau_{x}^+}]=e^{G^{(q)} x}, \quad x\ge 0
\end{align}
for some \emph{transition rate} matrix~$G^{(q)}$ which is of size $N\times N$.
Moreover, by \citet{ivanovs_palmowski} the matrix $G^{(q)}$ is a \emph{right solution} of
$$F(-G^{(q)})=q\mathbb{I}.$$
\begin{theorem}\label{ThmMainpar}
Parisian survival probability for a MAP risk process equals:
\begin{eqnarray} \label{PRE}
\lefteqn{\mathbb P_{x,i}(\tau^\zeta=+\infty)=
\mathbb P_{x,i}(\tau_0^-=+\infty)}\\\nonumber&&+
\int_0^\infty \mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\in \mathrm d z)\mathbb P(\tau_z^+\le \zeta)\mathbb P(\tau^\zeta=+\infty),
\end{eqnarray}
where $\mathbb P_{x,i}(\tau_0^-=+\infty)=\overline{\phi}_i(x)=(W(x)W(\infty)^{-1}{\bs 1})_i$ by \eqref{ruintimeprob},
and the vector $\mathbb P(\tau^\zeta=+\infty)=(\mathbb P_i(\tau^\zeta=+\infty))_{\{i\in E\}}$ solves the following system of equations
\begin{eqnarray} \label{PRE2}
&&\qquad\mathbb P_{i}(\tau^\zeta=+\infty)=
\mathbb P_{i}(\tau_0^-=+\infty)\\\nonumber&&+
\sum_{j,k\in E}\int_0^\infty \mathbb P_{i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\in \mathrm d z, J_{\tau_0^-}=k)\mathbb P_k(\tau_z^+\le \zeta, J_{\tau_z^+}=j)\mathbb P_j(\tau^\zeta=+\infty).
\end{eqnarray}
Moreover,
\begin{eqnarray}\label{ltxuj}
\lefteqn{\int_0^{\infty}e^{-\theta s}\,\mathrm d s\int_0^\infty
\mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\in \mathrm d z) \mathbb P(\tau_z^+\le s)}
\\ \label{ltx}
&& =\frac{1}{\theta}\int_0^\infty \int_0^\infty u^{(0)}(x,z)\; \nu (z+\mathrm d y)\mathrm d ze^{G^{(\theta)}y},
\end{eqnarray}
where
\[u^{(0)}(x,z)=W(x)e^{R z}-W(x-z).\]
\end{theorem}
\begin{proof}
On the event $\{\tau^\zeta=\infty\}$ we decompose possible trajectory that goes below zero into two parts. The first one starts at the undershoot of $0$ of size, say, $-z<0$ visiting zero
in continuous way because of the spectral negativity of $X$ in a shorter period than $\zeta$. The second part
starts at $0$ after this excursion below $0$.
Using the strong Markov property it will produce:
\begin{eqnarray*}
\lefteqn{\mathbb P_{x,i}(\tau^\zeta=\infty)=
\mathbb P_{x,i}(\tau_0^-=\infty)}\\\nonumber&&+
\int_0^\infty \mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\in \mathrm d z)\mathbb P(\tau_z^+\le \zeta)
\mathbb P(\tau^\zeta=\infty).
\end{eqnarray*}
This justifies the equation (\ref{PRE}). System of equations \eqref{PRE2}
follows straightforward from (\ref{PRE}) by taking $x=0$ there.
Finally, note that by \eqref{eq:Gdef_cont},
\begin{equation}\label{LapXeq}\int_0^{\infty}e^{-\theta s}\mathbb P(\tau_z^+\le s)\,\mathrm d s = \frac{1}{\theta}{\mathbb E}_{x,i}\left(e^{-\theta\tau_z^+},\tau_z^+<\infty\right)
=\frac{1}{\theta}e^{G^{(\theta)}z}.
\end{equation}
Further, from the compensation formula \eqref{compformula} and \eqref{compensationrepresentation}
we have
\begin{eqnarray}\lefteqn{\int_0^{\infty}e^{-\theta s}\,\mathrm d s\int_0^\infty
\mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\in \mathrm d z)\mathbb P(\tau_z^+\le s)}\nonumber\\&&=
\frac{1}{\theta}\int_0^\infty \mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\in \mathrm d y)e^{G^{(\theta)}y}
\nonumber\\&&=
\frac{1}{\theta}\int_0^\infty \int_0^\infty u^{(0)}(x,z)\; \nu (z+\mathrm d y)\mathrm d ze^{G^{(\theta)}y}
\label{waznarep}
\end{eqnarray}
which completes the proof.
\end{proof}

We will derive now the Cram\'er's estimate of the Parisian ruin probability.
\begin{theorem}\label{Crameasymptoticspar}
Under Cram\'{e}r condition \eqref{cramerlundbergequation},
\[\lim_{x\to+\infty}\frac{\mathbb P_{x,i}(\tau^\zeta<+\infty)}{e^{-\gamma x}}=C^\zeta\]
for some finite constant $C^\zeta>0$.
\end{theorem}
 \begin{proof}
We follow the same idea like in the proof of Theorem \ref{Crameasymptotics}.
That is, from \eqref{PRE}
\begin{eqnarray} \label{PREx}
&&\qquad\mathbb P_{x,i}(\tau^\zeta<+\infty)=
\mathbb P_{x,i}(\tau_0^-<+\infty)\\\nonumber&&-
\int_0^\infty \mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\in \mathrm d z)\mathbb P(\tau_z^+\le \zeta)\mathbb P(\tau^\zeta=+\infty)\\
&&\qquad=e^{-\gamma x}\tilde{{\mathbb E}}_{0,i}\left[e^{\gamma (\hat{X}_{\hat{\tau}_x^+}-x)}\frac{h_{i}(\gamma)}{h_{J_{\hat{\tau}_x^+}}(\gamma)}\right]
\\\nonumber&&-
e^{-\gamma x}\int_0^\infty
\tilde{{\mathbb E}}_{0,i}\left[e^{\gamma (\hat{X}_{\hat{\tau}_x^+}-x)}\frac{h_{i}(\gamma)}{h_{J_{\hat{\tau}_x^+}}(\gamma)}, (\hat{X}_{\hat{\tau}_x^+}-x)\in \mathrm d z\right]
\mathbb P(\tau_z^+\le \zeta)\mathbb P(\tau^\zeta=+\infty).
\end{eqnarray}
Using Renewal Theorem 28 of
 \citet{dereich2015real} and Tonelli theorem complete the proof.
\end{proof}

We will  move now to MAP risk process considered in Section
\ref{sec:subexpnentialasruinprob} in which
$X$ is a Markov modulated drift minus compound Poisson process
and claim size are subexponential.

\begin{theorem}\label{Thmconveq}
Under assumptions of Theorem \ref{simple} we have
\begin{displaymath}
  \lim_{x\to\infty}\frac{\mathbb P_{y,i}(\tau^\zeta<+\infty)}{\oo{F^{\text{\tiny \rm I}}}(x)}
  = \frac{C}{\overline{a}}
\end{displaymath}
for $C$ and $\overline{a}$ given in \eqref{eq:3} and \eqref{driftMMRW}, respectively.
\end{theorem}
\begin{proof}
Note that from definition of Parisian ruin time if follows that
\[\mathbb P_{x,i}(\tau^\zeta<+\infty)\le \mathbb P_{x,i}(\tau_0^-<+\infty).\]
Moreover, conditioned that risk process $X$ got ruined, the deficit cannot be larger that
$p=\max_{i\in E}p_i \zeta$, otherwise it will not manage to return to zero.
Thus by Theorem \ref{ThmMainpar}
\begin{eqnarray*}
\lefteqn{\mathbb P_{x,i}(\tau^\zeta=+\infty)=
\mathbb P_{x,i}(\tau_0^-=+\infty)}\\\nonumber&&+
\int_0^p \mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\in \mathrm d z)\mathbb P(\tau_z^+\le \zeta)\mathbb P(\tau^\zeta=+\infty)
\end{eqnarray*}
and hence
\begin{eqnarray*}
\lefteqn{\mathbb P_{x,i}(\tau^\zeta<+\infty)\ge
\mathbb P_{x,i}(\tau_0^-<+\infty)}\\\nonumber&&-
\mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\le p).
\end{eqnarray*}
Further,
\begin{align*}
\mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\le p)
&= \mathbb P_{x,i}(\tau^{-}_0<\infty)-\mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}> p)\\&
\le\mathbb P_i(M>x)\\&-\sum_{n=1}^\infty\mathbb P_i(\max_{k\le n-1}S_k<x, S_{n-1}\ge -a_{n-1}, \xi_n>x+a_{n-1}+p),
\end{align*}
where $S_k$ is defined in \eqref{Sk} and $a_n=a_0+(\overline{a}+\epsilon)n$ for some $a_0, \epsilon>0$.
Now using principle of one big jump (see inequalities (110)-(114) of  \citet{FKZ})
and fact that any subexponential distribution is long-tailed
one get that
\[\sum_{n=1}^\infty\mathbb P_i(\max_{k\le n-1}S_k<x, S_{n-1}\ge -a_{n-1}, \xi_n>x+a_{n-1}+p)
\ge (1+{\rm o}(1))\frac{C}{\overline{a}}\oo{F^{\text{\tiny \rm I}}}(x).\]
Thus
\[\mathbb P_{x,i}(\tau^{-}_0<\infty, -X_{\tau^{-}_0}\le p)={\rm o}(\oo{F^{\text{\tiny \rm I}}}(x))\]
and this gives the assertion of the theorem.
\end{proof}

\bibliographystyle{plainnat}