scieee AI-readable full text Open interactive document viewer

The continuous-time hidden Markovmodel based on discretization. Properties of estimators and applications

Gámiz Pérez, María Luz,Segovia García, María del Carmen

Abstract

Universidad de Granada/CBUA

Full text

Statistical Inference for Stochastic Processes https://doi.org/10.1007/s11203-023-09292-0 The continuous-time hidden Markov model based on discretization. Properties of estimators and applications María Luz Gámiz1·Nikolaos Limnios2·Mari Carmen Segovia-García1 Received: 28 October 2022 / Accepted: 16 May 2023 © The Author(s) 2023 Abstract In this paper we consider continuous-time hidden Markov processes (CTHMM). The model considered is a two-dimensional stochastic process (Xt,Yt), with Xtan unobserved (hidden) Markov chain defined by its generating matrix and Ytan observed process whose distribution law depends on Xtand is called the emission function. In general, we allow the process Yt to take values in a subset of the q-dimensional real space, for some q. The coupled process (Xt,Yt)is a continuous-time Markov chain whose generator is constructed from the generating matrix of Xand the emission distribution. We study the theoretical properties of this two-dimensional process using a formulation based on semi-Markov processes. Observations of the CTHMM are obtained by discretization considering two different scenarii. In the first case we consider that observations of the process Yare registered regularly in time, while in the second one, observations arrive at random. Maximum-likelihood estimators of the characteristics of the coupled process are obtained in both scenarii and the asymptotic properties of these estimators are shown, such as consistency and normality. To illustrate the model a real-data example and a simulation study are considered. Keywords Hidden Markov model ·Poisson process ·Maximun-likelihood estimation · Asymptotic properties María Luz Gámiz, Nikolaos Limnios and Mari Carmen Segovia-García have contributed equally to this work. BMaría Luz Gámiz [email protected] Nikolaos Limnios [email protected] Mari Carmen Segovia-García [email protected] 1Departamento de Estadística e I.O., Universidad de Granada, Granada, Spain 2Laboratoire de Mathématiques Appliquées de Compiègne, Université de Technologie de Compiègne, Compiègne, France 123 Statistical Inference for Stochastic Processes 1 Introduction Hidden Markov Models (HMM) appear in a large number of real-world estimation problems where a process with unobservable states produce observable outputs normally referred as signals. Mor et al. (2021) conduct a review of the published work on HMM during the last few decades, and the different application areas of these models, e.g., Pattern recognition, Bioinformatics, Economy and Finance, Network security, Meteorology, Reliability engineering, etc. The problem is presented as follows. Consider a coupled process, (X,Y), in discrete or continuous time, where Xis an unobserved process, a hidden process, and Yis the observed process. Based on the observations, the law of the coupled process has to be estimated. In general, the hidden process Xis a Markov chain, and Yis a process whose distribution depends on the value of Xt, i.e., P(Yt∈B|Ys,Xs;s≤t)=P(Yt∈B|Xt),orP(Yt∈ B|Ys,Xs;s≤t)=P(Yt∈B|Yt,Xt). In the first case we have an M1-M0 model and in the second an M1-M1 model, where M means Markov order 1 or 0. These are the most used orders, but in general we can consider more general orders. In the literature, the considered Markov chain is a finite-state space process with transition probability Pij being a function of a parameter θ(in general a vector). It is written as Pij(θ). Therefore, the estimation of the parameter vector θ, i.e.,  θ, gives us a plug-in estimator of the transition probability, i.e.,  Pij := Pij( θ). Basic theoretical results concerning HMM in discrete time are given in Baum and Petrie (1966), and Leroux (1992) where consistency of estimators is proven, as well as in Bickel et al. (1998) that prove asymptotic normality of the estimator for a stationary process. These results concerning discrete-time hidden Markov models (DTHMM) case are used in our CTHMM in order to provide asymptotic results for our estimators. Here, a continuous-time HMM (CTHMM) is considered, where Xis defined by its generating matrix Aand Yby its probability law, with conditional distribution G(i,B)given {Xt=i},andBa measurable set in Rq, i.e., P(Yt∈B|Xt=i)=G(i,B), so the considered model is an M1-M0. Our results concern the consistency and asymptotic normality of the estimator of the parameter θand applications to a real data set and simulated data. It is assumed that the generator Aof Xis a matrix depending on the parameter θ, i.e., A=A(θ) as well as the probability distribution of Y, i.e., G=Gθ. Let us denote gθthe density of Gθwith respect to some dominating measure μ. The methodology to tackle the problem is based on results in DTHMM, as Bickel et al. (1998), Baum and Petrie (1966), Leroux (1992) and also on our results in Gamiz et al. (2023). In the present paper the CTHMM is approached by discretization, so that previous results can be applied here, and the parameter θcan be estimated by the EM-algorithm. From the estimator  θwe obtain an estimator of the generating matrix  Aand prove the asymptotic properties of this estimator such as normality and consistency. We consider two different scenarii. 1.1 Scenario 1: Regular inspections in time The true state of the system at time t,Xtis non-observable. However, at regular intervals of length h,0<h<T, certain information related to the system is observed. Let us show an example of the type of problems that can be treated with this approach. Let us consider a continuous-time Markov chain (CTMC) {Xt,t>0}with generating matrix given by 123 Statistical Inference for Stochastic Processes A=⎛ ⎝−2λ2λ0 μ−(λ +μ) λ 02μ−2μ⎞ ⎠. This model is a typical description of the functioning of a system with two units identical and independent. The units fail at a constant rate equal to λ. Once a unit fails is sent for repair. The repair system has capacity for the two units and the repair rate is also constant and equal to μ. The state of the system is expressed as the number of units functioning, then the state space is E={0,1,2}. For assessing the system performance, we focus on certain functionals φ(A,t), such as the reliability of the system (the probability that the system has not suffered from failure before a given time), the availability function (the probability that the system is operative at a given time) or the expected hitting times (the expected time a particular class of states is reached by the system), among others. The usual procedure is to take a sample of identical systems that work under similar conditions and to estimate the unknown parameters λand μfrom the data. The main problem here is that we consider that the system is not directly observable and then we are not able to register information regarding the number of units that are functioning in the system at any given time. In contrast, at some regular times, t0=0, t1=h,t2=2h,...,tn=nh,..., we have access to certain indicators that provide useful, though partial, information about the state of the system. Let us denote by Ynthe accessible information about the system that we can observe at time tn, for n>0. We assume that {Y0,Y1,...,Yn}are (conditionally) independent and that for each nthe distribution of the random variable Ynis determined by a parameter that depends on the current state of the system, that is, at time tn=nh. Let us define Qh(i,j)=P(Xh=j|X0=i),fori,j∈E, and denote Qhthe corresponding matrix. Using basic properties of CTMC we have that Qh=I+Ah+o(h), with Ithe identity matrix and o(h)/h→0forh→0, then we can approximate Qh,forafixed small enough h, by the following Qh=⎛ ⎝ 1−2λh2λh0 μh1−(λ +μ)hλh 02μh1−2μh⎞ ⎠. In this situation, {Y0,Y1,...,Yn}can be seen as a sample from a DTHMM whose parameters can be written as a vector θthat includes λ,μand some other parameters that determine the distribution of Yngiven ˆ Xn=Xnh =i,fori∈E. In general, we define Ah=h−1(Qh−I).Ash→0, Ah→A, uniformly. As Q=Q(θ), then A=A(θ). We estimate  θnfrom observations of the hidden Markov model at times {tn=nh,n≥0}. Leroux (1992) showed the strong consistency of this estimator, that is  θn→θ, and in Bickel et al. (1998) the weak convergence of the estimator to a Normal law is proven, that is, √n( θn−θ) →N(0, 0), in the case of HMM. Subsequently, for the plug-in estimator of the transition matrix Qh,thatis Qh,n=Qh( θn), the strong consistency and asymptotic normality are proven. At the same time the strong consistency and the asymptotic normality of the plug-in estimator of Ah,thatis Ah,n= A( Qh,n), is also demonstrated in this paper. And as a consequence, for any functional within the following class H(t)=(A,t), Hh(t)=(Ah,t)is defined. Then the plug-in estimator for Hh(t), Hh,n, is shown to be strongly consistent and asymptotically normal. As an application of this result, the transition matrix function, H(t)=P(t)=eAt, can be considered, as well as other functions such as reliability, availability, etc. 123 Statistical Inference for Stochastic Processes 1.2 Scenario 2: Random inspections in time For a given interval length T, the true state of the system at time t,Xtis non-observable. Observations related to the underlying state are received at random times following an Homogenous Poisson Process (HPP), N(t), with intensity λ, unknown and estimated from the data. We consider the embedded Markov chain obtained from the visited states of Xat thesuccessivearrivaltimesoftheHPP.WedenoteQits transition probability matrix and Athe generating matrix of the CTMC. We assume that λ≥max{ai,i∈E}.Usingthe uniformization method, see, e.g., Kulkarni (2011), we define Q=(1/λ)A+I.Usingthe HMM, an estimator  Q,ofQis obtained, and subsequently the corresponding estimator of the generating matrix Ais obtained as  A= λ Q−I. It is demonstrated that these estimators  Qand  Aare strongly consistent and asymptotically normal. The model discussed in this scenario should not be confused with the so called Markovmodulated Poisson process, which consists of a Poisson process whose rate is controlled by a non-observable continuous-time Markov chain. In Freed and Shepp (1982) it is considered a switched Poisson process, i.e., with only two states for the hidden chain. The authors assume that the rate of one of the states is zero and derive a simple formula for the asymptotic likelihood ratio that allows to estimate the state at any time from a stream of past events. In our case, a Poisson process is assumed to deal with the number of signals registered by an external observer but it is not responsible for the number of signals emitted by the hidden source nor for the nature of such signals, as it is the case of the Poisson process involved in a Markov-modulated Poisson process. The results summarized here can be utilized in different areas, such as system reliability, biology, etc., e.g., in Wei et al. (2002) a CTHMM is proposed for evaluating network performance considering discrete time observations. Zhou et al. (2020) proposed as well a CTHMM where the observations can be collected regularly, irregularly or continuously. The number of states is unknown. They apply this model to bladder cancer data. In Verma et al. (2018) the authors develop a CTHMM under a generalized linear modeling framework to model the evolution of chronic obstructive pulmonary disease (COPD), again, the model considers discrete-time observations although they are irregularly-spaced observations. Similarly Hulme et al. (2021) proposed a CTHMM to estimate health conditions of patients that are monitored by wearable and mobile technology, the observations are as well irregularly-spaced. Finally, Liu et al. (2016) considers the use of CTHMM for modeling disease progression as well. This paper is organized as follows. In Sect.2the model and its main characteristics are defined. The generator of the two-dimensional process is defined and obtained in terms of the generating matrix Aand the emission distribution G. The basic properties of the model are obtained using a formulation based on semi-Markov processes. In Sect.3,maximumlikelihood estimators for the parameters of the model are obtained based on data observed under two different time discretization schemes. That is, scenario 1, where observations arrive at times regularly pre-specified; and, scenario 2, where observations arrive randomly according to a homogeneous Poisson process. Some applications and particular cases of the model are described in Sect.3.6.1. Some numerical examples are presented in Sect.5and the conclusions are given in Sect.6. 123 Statistical Inference for Stochastic Processes 2Themodel We follow the formulation of Bickel et al. (1998) and consider the “usual parametrization” of the model. Specifically, let {Xt;t≥0}be a continuous-time Markov chain with finite state space E={1,...,d}and generating matrix A=(aij,;i,j∈E).Let{Yt;t≥0} an Y-valued sequence such that given Xt=i,Ytis conditionally distributed with density g(i,y)with respect to some σ-finite measure μon Y,andfixedi∈E. All processes are defined on a complete probability space (, F,P), are right continuous and then progressively measurable. This will imply also a family of probabilities {Pi;i∈E}, where Pi(·)=P(·|X0=i), and expectations {E(i,y);i∈E,y∈Y},whereE(i,y)[·] = E[·|X0=i,Y0=y], which are defined with respect to a family of probabilities {P(i,y);i∈ E,y∈Y},whereP(i,y)(·)=P(·|X0=i,Y0=y). Both, the generating matrix Aas well as the family of densities {g(i,·);i∈E}, depend on a vector of parameters θ,thatisA(i,j)=aij(θ) and g(i,·)=gθ(i,·),foralli,j∈E. The set of possible values of the vector θis denoted ⊂Rk,andθhas to be estimated from a set of observations of the process {Yt}. The vector θusually includes the transition rates and also some parameters characterizing the densities g. As a particular case, it can be assumed that g(i,y)denotes a concrete parametric family of distributions with parameters β=(β1,β 2,...,β s), then we can write θ=(A∗,β), with A∗the matrix Awithout its principal diagonal, since the diagonal entries are functions of the off diagonal entries. In our previous example of a 3-state MC, if we have that g(i,·)is the Normal distribution N(κi,σ2 i),i∈E; the parameter vector θwill be: θ=(λ,μ,κ 1,σ2 1,κ 2,σ2 2,κ 3,σ2 3). In general Ycan be seen as a subset in Rqfor some q.IfYthas density function g(i,·), given that Xt=i,thenP(Yt∈B|Xt=i)=Bg(i,y)μ(dy),forB⊂Y, is the probability that the process Yttakes values in a subset Bgiven Xt=i,fori∈E. We also denote G(i,B)=P(Yt∈B|Xt=i). At some points of the paper we will discuss the simpler case that Yttakes values in a finite set, that is Y={y1,...,ys}and then the emission function will be a d×s-dimensional matrix G, with elements G(i,y)=G(i,{y})=P(Yt=y|Xt=i),foralli∈Eand y∈Y, and all t>0 (see Gamiz et al. 2023). For the rest of the paper we will consider the process (X,Y)defined as follows. Definition 1 Let X={Xt;t≥0}be an irreducible homogeneous Markov process in a finite set Eand with generating matrix A=(aij)i,j∈E,andY={Yt;t≥0}is a homogeneous process in a general set Y⊂Rq, with q≥1 such that, for t>0, the distribution of Ytis determined G(i,·), over the event Xt=i,fori∈E. Then we say that (X,Y)is a twodimensional process with dependence structure M1-M0. That is, if BYdenotes the set of Borel subsets of Y, then for any i,j∈E,y∈Yand B∈BY,andforalls,t>0, P(Xt+s=j,Yt+s∈B|Xu,Yu,0≤u≤s) =P(Xt+s=j,Yt+s∈B|Xs)(1) =P(Xt=j,Yt∈B|X0), where we also use homogeneity of the processes Xand Y. Moreover, for t>0, P(Xt=j,Yt∈B|X0=i,Y0=y)=Pij(t)G(j,B), and, for t=0, P(Xt=j,Yt∈B|X0=i,Y0=y)=1ifi=jand y∈B; and, 0 otherwise. 123 Statistical Inference for Stochastic Processes 2.1 Generators Let us focus on the two-dimensional process {(Xt,Yt);t≥0},where,asabove,Xis a continuous-time Markov chain taking values in the set E={1,2,...,d}, with generating matrix Aand initial law α;andYis a stochastic process taking values in a set Y⊂Rqwhose distribution depends on Xt. First we recall the concept of generator operator for a two-dimensional process with a general state space. Definition 2 (Generator of two-dimensional process with general state space) Let (X,Y)= {(Xt,Yt);t>0}a two-dimensional process, with Xtaking values in a set E⊂Rdand Y taking values in a set Y⊂Rqand let f∈C(E×Y),whereC(E×Y)denotes the set of all continuous bounded functions defined on E×Y. We define the generator  Aof (X,Y)as follows  Af(x,y)=lim t→0 1 tEx,y[f(Xt,Yt)−f(x,y)], for (x,y)∈E×Y. We consider that Xis a MC with finite state space E, while Yis a process taking values in a subset Y⊂Rq,forq≥1. Since Xis a CTMC then its generator is a matrix A= (aij;i,j∈E),whereaij ≥0, i= jand aii =−j=iaij for all i∈E. On the other hand, {Yt}is a sequence conditionally independent, where the law of Ytdepends on the value of Xt. Proposition 1 Let (X,Y)be a stochastic process where X is a CTMC with finite state space E and generating matrix A=(aij;i,j∈E), and let the transition probabilities of the process (X,Y)be given by (1). The generator of the two-dimensional MC (Xt,Yt)can be written as  Af(i,y)= j∈E\{i} aij Y G(j,du)[f(j,u)−f(i,y)] for all i ∈E and y ∈Y. Proof From definition 2we have, for i∈Eand y∈Y,  Af(i,y)=lim t→0 1 t j∈EY [f(j,u)−f(i,y)]P(Xt=j,Yt∈du|X0=i,Y0=y) From the expression in (1)weget  Af(i,y)=lim t→0 1 t j∈EY (f(j,u)−f(i,y))Pij(t)G(j,du) = j∈EY f(j,u)G(j,du)lim t→0 Pij(t)−δijδyu t =aii f(i,y)+ j=i aij Y f(j,u)G(j,du)  123 Statistical Inference for Stochastic Processes In particular, when Yis a finite set, the generator is given by a matrix  Aas we show next. The general expression in definition 2becomes  Af= i∈E y2∈Y f(j,y2)lim t→0 P(Xt=j,Yt=y2|X0=i,Y0=y1)−δijδy1y2 t We have that P(Xt=j,Yt=y2|X0=i,Y0=y1)=Pij(t)G(j,y2), and we assume that P(Xt=j,Yt=y2|X0=i,Y0=y1)→0ast→0wheny1= y2. We consider the following cases: •If i=j,y1=y2,(1/t)Pij(t)G(j,y2)−1→aii; •If i=j,y1= y2,(1/t)Pij(t)G(j,y2)→0; and, •If i= j,(1/t)Pij(t)G(j,y2)→aijG(j,y2) Then the generator can be written as a matrix whose elements are a((i,y1), ( j,y2)) =⎧ ⎨ ⎩ aii,i=j,y1=y2 0,i=j,y1= y2 aijG(j,y2), i= j (2) Moreover, we have  j∈E y2∈Ya((i,y1), ( j,y2)) =aii + j=i y2∈Y aijG(j,y2) =aii + j=i aij =0 Example 1 For illustrative purposes, let us construct the 2-dimensional generator for a simple case where E={1,2}and Y={y1,y2,y3}. Then, the state space of the coupled process is  E={(1,y1), (1,y2), (1,y3), (2,y1), (2,y2), (2,y3)}, and the corresponding generating matrix is  A= ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ a11 00a12G(2,y1)a12G(2,y2)a12G(2,y3) 0a11 0a12G(2,y1)a12G(2,y2)a12G(2,y3) 00a11 a12G(2,y1)a12G(2,y2)a12G(2,y3) a21G(1,y1)a21G(1,y2)a21G(1,y3)a22 00 a21G(1,y1)a21G(1,y2)a21G(1,y3)0a22 0 a21G(1,y1)a21G(1,y2)a21G(1,y3)00a22 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ where a·· denote the elements of the generating matrix Aof X,andG(·,·)denote the emission probabilities. From the generator in Proposition 1we obtain the semigroup P(t)=exp( At). (3) 2.2 Markov renewal equation for Markov processes The above semigroup is difficult to handle numerically. For this reason we will consider another equivalent formulation via semi-Markov processes (see for example Limnios and Oprisan 2001). In fact, Markov processes are particular cases of semi-Markov processes and we may use the Markov renewal equation in order to obtain the above formulation (3)ina much easier numerical scheme. 123 Statistical Inference for Stochastic Processes Let us define the semi-Markov kernel of the Markov process Xtin the following way. Let the process (X,Y)defined as in Definition 1. For i,j∈Eand B∈BY, we define the following functions •M(i,j,B,t)=G(i,B)e−aitδij, •L(i,j,t)=(aij/ai)(1−e−ait), and, • P(i,j,B,t)=Pi(Xt=j,Yt∈B), where Pi(Xt=j,Yt∈B)=P(Xt=j,Yt∈B|X0=i),andδij denotes the Kronecker delta and ai=−aii. Note that the function L(i,j,t)is the semi-Markov kernel of the Markov process {Xt}. In particular, when Yttakes values in a finite set of size s, we can define the matrix of transition functions of the process (X,Y), Ptwith dimension (d·s)×(d·s)and elements  Pt((i,y), ( j,y)) =Pij(t)G(j,y), i,j∈E,y,y∈Y,and t≥0.(4) In the same way we can construct matrices Mtand Ltwhose elements are given above. Given φa measurable function defined on E×R+we define its convolution by Las follows (L∗φ)(i,t)= j∈Et 0 L(i,j,ds)φ( j,t−s), i∈E,t≥0.(5) Proposition 2 (Markov renewal equation) The function  P(i,j,B,t)verifies the following Markov renewal equation  P(i,j,B,t)=M(i,j,B,t)+ k∈Et 0 L(i,k,ds) P(k,j,B,t−s), (6) where i,j∈E, B ∈BY, and t ≥0. Proof We have that Pi(Xt=j,Yt∈B)=G(i,B)e−aitδij + k∈Et 0 Pi(Xt=j,Yt∈B,J1=k,T1∈ds) where (J1,T1)describes the first jump of the Markov renewal process {(Jn,Tn), n>0} associated to the process X,thatisJ1=XT1. Then Pi(Xt=j,Yt∈B)=G(i,B)e−aitδij + k∈Et 0 Pi(Xt=j,Yt∈B|J1=k,T1=s)Pi(J1=k,T1∈ds) =G(i,B)e−aitδij + k∈Et 0 Pi(Xt−s=j,Yt−s∈B)aike−aisds =M(i,j,B,t)+ k∈Et 0 L(i,k,ds) P(k,j,B,t−s) =M(i,j,B,t)+(L∗ P)(i,j,B,t)  123 Statistical Inference for Stochastic Processes It has been proven that  P(i,j,B,t)=M(i,j,B,t)+(L∗ P)(i,j,B,t),where∗denotes the convolution operation defined in (5). For the case that Yttakes values in a finite set we can write Eq. (6)inmatrixnotationas follows  Pt=Mt+Lt∗ Pt Let us define the Markov renewal function of the process X,thatis(t)=n≥0L(n) t, where L(n) tdenotes the nth fold-convolution of Lt,thatis,the(i,j)-element given by L(n)(i,j,t)= k∈Et 0 L(i,k,ds)L(n−1)(k,j,t−s), i,j∈E,t>0, being L(0)(i,j,t)=δij1R+(t),andL(1)(i,j,t)=L(i,j,t). Then the solution of Eq. (6)isgivenby P(i,j,B,t)=( ∗M)(i,j,B,t),seefor example Limnios (2012). Using the Markov renewal theorem (MRE), see Shurenkov (1984), the stationary distribution of the process (X,Y)can be obtained in the following proposition. Proposition 3 (Stationarity) Under the conditions above and if X is irreducible, we have lim t→∞ P(i,j,B,t)=πjG(j,B), j∈E,B∈BY. So we have that the probability distribution πwhose elements are π(j,B)=πjG(j,B), for j ∈E, and B ∈BYis the limit distribution of the process (X,Y). Moreover, π(i,B)is the stationary distribution of the process (X,Y), that is, it verifies that π Af =0,f∈C(E×Y). Proof For the first part of the proposition, let ρdenote the stationary distribution of the embedded Markov chain Jnassociated to the MC Xt, with transition probabilities pij = aij(1−δij)/ai. Let πbe the row vector of stationary probabilities of the CTMC Xt, that is, verifying that πA=0. It is satisfied that πi=miρi/m, with mi=1/ai, the mean sojourn time in state i and m=j∈Emiρi. Then, by the irreducibility of Xand, as  P(i,j,B,t)=( ∗M)(i,j,B,t)by MRT, we have that lim t→∞( ∗M)(i,j,B,t)=1 m k∈E ρk∞ 0 M(k,j,B,t)dt =1 m k∈E ρk∞ 0 G(k,B)e−aktδkjdt =1 mρjG(j,B)1 aj=πjG(j,B) Then we define π(j,B)=πjG(j,B),for j∈Eand B∈BYthe stationary distribution of the coupled process (X,Y). For the second part, we can write π Af= j∈EYπ(j,dy) Af(j,y), 123 Statistical Inference for Stochastic Processes Proposition 9 (Asymptotic normality) Under assumptions A1, A3, A5, A6, given a sample of observations {N(T), ˆ Y0,ˆ Y1,..., ˆ YN(T)}, the random matrix √T A−Ais asymptotically Normal as T →+∞, with mean 0and variance-covariance matrix A=1+2, where 1=λ∇Q0∇Q, and 2= B B,whereB=√λ(Q−I)and  Bis a vector representation of the matrix B. Proof We can write √T A−A=√T λ QT−Q+√T λ−λ(Q−I). (10) To check the convergence to a Normal distribution we consider the two terms of expression (10) separately. First, we have √T λ QT−Q=N(T) TN(T) QT−Q,(11) whereweusethat λ=N(T)/T. From the results in Bickel et al. (1998) and the fact that N(T)→∞(a.s.)as T→∞, we have that N(T) QT−Qd −→ N(0, Q), as T→∞, with variance-covariance matrix Qobtained by the Delta method applied to the function Q(θ) =Q, similar to proposition 5. Using that N(T)/T→λ, almost surely, as T→+∞, we get that the first term of the sum converges to a Normal distribution, that is √T λ QT−Qd −→ N(0,λ 1), with 1=λQ, a matrix of dimension d2×d2. On the other hand, N(T)has Poisson distribution with mean λT, which can be approximated by a Normal distribution with both mean and variance equal to λT,thatis √T λT−λd −→ N(0, λ). Then, the second term in the sum is also asymptotically Normal with variance-covariance matrix 2= B B,whereB=√λ(Q−I),thatis √T(λT−λ)(Q−I)d −→ N(0, 2). Specifically  Bis a d2-dimensional vector obtained by stacking the columns of Binto a column vector, then 2is also a matrix of dimension d2×d2,andthen=1+2is well defined.  4 Applications 4.1 Reliability for CTHMM with discrete state space In this section we consider that Ytakes values in a finite set, that is Y={y1,...,ys},then the corresponding two-dimensional process (Xt,Yt)has a finite number of states. We can write the set of states for the two-dimensional process as  E=E×Y, with  E={(1,y1),...,(d,y1), (1,y2),...,(d,y2),...,(1,ys), (2,ys),...,(d,ys)}. 123 Statistical Inference for Stochastic Processes Then {(Xt,Yt);t>0}is a two-dimensional continuous-time Markov chain with statespace  E=E×Yand transition matrix  Pwith elements  Pt((i,y), ( j,y)) =Pij(t)G(j,y), for i,j∈Eand y,y∈Y. In matrix form, we have  P(t)=⎛ ⎜ ⎜ ⎝ B1(t)B2(t)···Bs(t) B1(t)B2(t)···Bs(t) ··· ··· ··· ··· B1(t)B2(t)···Bs(t) ⎞ ⎟ ⎟ ⎠ where for each k=1,...,s, the corresponding block is a d×dsub-matrix Bk(t)= P(t)·diag(Gk),wherediag(Gk)is a d-dimensional diagonal matrix with the kth column of the matrix G. The generator Ais a matrix of dimension (d·s)×(d·s)with elements a((i,y)( j,y)) as detailed in (2). Following similar arguments as in Gamiz et al. (2023), we consider that the state-space of the process Xis split into two subsets U:= {1,...,r}, the working states, and D:= {r+1,...,d}, the down states. Additionally, the system up states can be defined not only by U⊂Ebut also by some subset of Y. Then we consider also a partition in the set of possible observations, that is Y=Y1∪Y2,whereinY1we consider indicators of good performance of the system, and in Y2we consider the indicators warning of some serious problem in the system. Let us denote τthe first time the system visits the set of down states D, i.e., the hitting time of set D. Let us consider  U=U×Y1and  D= E\ U,being E=E×Y.Then τ=inf{t>0: X=(Xt,Yt)∈ D}. Therefore the reliability of the system can be defined as  R(t)=P(τ > t),fort≥0. Conditioning on the initial state (i,y)∈ U=U×Y1,we write  R(i,y)(t)=Pi(τ > t)=Pi(Xs∈U,Ys∈Y1,0<s≤t) =Pi((Xt,Yt)∈ U,0<s≤t), (12) and then  R(t)= (i,y)∈ U R(i,y)(t), for t>0. Using matrix notation, we can write  R(t)=αe A Ut1 U where  A Udenotes the sub-matrix of  Awith all transition rates among states of subset  U. 4.2 Reliability for CTHMM with a general state space When the Yprocess takes values in a finite set, the formula in (12) can be applied because the generator A Uis a matrix, but when Ytakes values in a subset of Rq,A Uis an operator and we can not make use of the formula in (12). In that case we propose to work by Markov renewal equations (in the semi-Markov way) in this section. Let us define H(i,t)=e−aitG(i,Y1), for i∈U,andletUbe the Markov renewal function corresponding to the sub semi-Markov kernel LU(i,j,t)=aij ai(1−e−ait),fori,j∈U. The following result can be proved similarly to Proposition 2. 123 Statistical Inference for Stochastic Processes Proposition 10 (Reliability) The conditional reliability function  R(i,y)(t)satisfies the Markov renewal equation (MRE)  R(i,t)=H(i,t)+ j∈Ut 0 R(k,t−s)L(i,k,ds) Therefore, the conditional reliability is given by the only solution of the above equation, i.e.,  R(i,t)=(U∗H)(i,t) 5 Numerical examples In this section we illustrate the two scenarii discussed in the rest of the paper. In the first example, a real dataset is considered whereas in the second example a simulation study is carried out. In both cases, we discretize the continous-time problem, and then estimate using our algorithms in Gamiz et al. (2023), and finally we establish estimator properties in continuous-time, our initial problem. 5.1 Scenario 1. Regular inspections in time As a illustration we consider a comparison study of the suicide-rate in the US and Japan during the period 1985–2015. The data have been taken from the data platform https://www. kaggle.com/. We focus on the following variables: the Suicide Rate, which is measured as the number of suicides/100kpopulation, and, the Gross Domestic Product per capita (GDP_per_capita). 5.1.1 Preliminary Although the data registry provides information from a total of 94 countries we limit ourselves to the US and Japan. We have chosen two of the most developed countries in the world with the aim of comparing them with respect to the number of suicides per year. In Fig.1we give a graphical description of the situation. On the top panel we describe the case of US while on the bottom panel we represent the information from Japan. Looking at the figure from left to right we have the following. The plots on the left display the suicide-rate per year for US (top) and Japan (bottom) from 1995 to 2015, respectively. The suicide-rate has been calculated as the number of suicides registered in the country every year per 100,000 inhabitants. In each graph it is shown the value calculated every year as well as a smoothed curve obtained from these values and that helps in visualizing the tendency of the suicide-rate along the period of observation. As we can see from the curves, not only suicides occur in Japan at a significantly higher rate than in US, also it is remarkable the existence of a high variability in the rate of suicides in Japan over the years, which is not appreciated in the case of US where the tendency is more steady. On the right-side panels, a scatterplot is given representing the GDP per capita from 1995 until 2015 in US (top) and Japan (bottom). What catches our attention is that again the situation in US seems to be more stable and suggests an increasing trend, with an almost constant slope, of the population standard of living in the US. We can see just one abrupt decay coinciding with the period of the economical crisis around 2008. However the GDP curve in 123 Statistical Inference for Stochastic Processes 1985 1995 2005 2015 15 20 25 Suicide rate year US ●●●●●●●●●●●●●● ●●●●●●●●●●●●●●●●● ● Raw data Smoothed curve 1985 1995 2005 2015 20000 40000 60000 GDP per capita year 1985 1995 2005 2015 15 20 25 Suicide rate year JAPAN ● ● ● ● ● ●● ●●●● ● ● ●● ● ●● ● ●●● ●●● ●● ●● ● ● ● Raw data Smoothed curve 1985 1995 2005 2015 20000 40000 60000 GDP per capita year Fig. 1 Overview of the situation in the US (top panel) and Japan (bottom panel) during the period 1995–2015 Japan, although suggests a slightly increasing tendency from 1995 onwards, it shows high variability at the same period of time when the highest suicide rate is seen in the corresponding plot (on the left panel). Figure2shows smooth density estimations of the rate of suicides all along the observation period for both countries, US on the left panel, and Japan on the right one. As we can see, the curves in both cases seem to suggest two different “regimes” (hidden or latent) in the country. These regimes could be the result of the interaction of the country’s wealth (measured in terms of the GDP) and possibly many other intrinsic factors which in conjunction can explain, to a certain extent, the observed rate of suicides at any particular time. With this in mind, we propose to study this phenomenon using a CTHMM with the following specifications. •{X(t);t>0}is the CTMC that represents the internal regime that is not directly observable. Let us assume that XtakesvaluesinE={1,2}; •{Y(t), t>0}is the observable process. We define Y(t)as the rate of suicides at time t. Considering the plots in Fig.2, we assume that Y(t)conditioned to the event {X(t)=i} follows a Normal distribution with mean μiand standard deviation σi,fori∈{1,2}; 123 Statistical Inference for Stochastic Processes 10 11 12 13 14 15 16 0.0 0.1 0.2 0.3 0.4 US N = 31 Bandwidth = 0.4111 Density 15 20 25 30 0.00 0.02 0.04 0.06 0.08 0.10 JAPAN N = 31 Bandwidth = 1.481 Density Fig. 2 Density curve of suicide rate in the US (left) and in Japan (right) We do not have a continuous-time follow-up of the process. We rather have annual observations, so we use the methodology presented in this paper and estimate the model considering Scenario 1 where observations arrive regularly in time, specifically with h=1. Regarding the DTHMM for each case study (US and Japan), the following parameters have to be estimated θ=(Qh(1,1), Qh(2,1), μ1,μ 2,σ 1,σ 2), where Qh(i,1)=P(Xh=1|X0=i),fori∈{1,2}. Then an estimator  Ahis obtained as explained in Sect.3.1. 5.1.2 Results We use the EM-Algorithm. The function Q(θ|θ(m))=Eθ(m)[ln f(ˆ X,ˆ Y|θ)]will give us by successive iterations an approximation of the estimate of θ,wherelnf(ˆ X,ˆ Y|θ) is the loglikelihood corresponding to the complete dataset, which would be obtained from the bivariate process (ˆ X,ˆ Y). Q(θ|θ(m))= N−1  n=1 i,j∈E Pθ(m)(ˆ Xn=i,ˆ Xn+1=j|ˆ Y)ln Pθ(i,j) + N  n=1 i∈E Pθ(m)(ˆ Xn=i|ˆ Y) K  k=1 ln g(ˆ Ykn;φi). (13) •E-Step For given θ(m), compute the probabilities: Pθ(m)(ˆ Xn=i,ˆ Xn+1=j|ˆ Y), n∈{1,...,N−1}; i,j∈E and Pθ(m)(ˆ Xn=i|ˆ Y), n∈{1,...,N}; i∈E. 123 Statistical Inference for Stochastic Processes Table 1 Estimated parameters of the hidden model United States (US) Japan  Qh=0.915 0.085 0.052 0.948  Qh=0.941 0.059 0.072 0.928  G(1,·)→N(μ1=11.90,σ1=0.437)G(1,·)→N(μ1=19.53,σ1=2.340) G(2,·)→N(μ2=13.41,σ2=0.556)G(2,·)→N(μ2=24.79,σ2=1.047) α=(1,0)α=(0,1)  A=−0.0854 0.0854 0.052 −0.052  A=−0.059 0.059 0.072 −0.072  π=(0.3789,0.6211)π=(0.5514,0.4486) To solve this step we use of the forward-backward probabilities defined as in Gamiz et al. (2023). •M-Step Update θ(m)to θ(m+1). The maximization step M is realized directly by  P(m+1)(i,j)=N n=1Pθ(m)(ˆ Xn=i,ˆ Xn+1=j|ˆ Y) N n=1Pθ(m)(ˆ Xn=i|ˆ Y).(14) Considering that the emission function follows a Normal law, gθ(i,y)= (σi√2π)−1exp −(y−μi)2/(2σ2 i),fori=1,2. The optimal value of the second term Q2((φi;i∈E)|θ(m))is obtained for μi=N n=1Pθ(m)(ˆ Xn=i|ˆ Y)ˆ Yn N n=1Pθ(m)(ˆ Xn=i|ˆ Y); and, σ2 i=N n=1Pθ(m)(ˆ Xn=i|ˆ Y)( ˆ Yn−μi)2 N n=1Pθ(m)(ˆ Xn=i|ˆ Y), for i∈{1,2}. We have estimated the model in both cases, i.e., with data from US as well as Japan. The estimated values reported in Table 1are the following: the transition matrix Qh;the parameters of the emission law, {G(i,·)→N(μi,σ i);i=1,2}; the initial distribution, α; the generating matrix Aand the stationary distribution of the continuous MC π. Figure3represents the transition probability functions between hidden states. 5.2 Scenario 2. Random inspections in time To illustrate this approach we present a simulation study. In particular, we consider a system with four possible states, that is E={1,2,3,4}, with {1,2}the functioning states whereas {3,4}are the down states. The observed output may vary in the set Y={y1,y2,y3,y4}.The 123 Statistical Inference for Stochastic Processes 1985 1995 2005 2015 0.0 0.2 0.4 0.6 0.8 1.0 P(X(t)=1 | X(0)=1) t Japan US 1985 1995 2005 2015 0.0 0.2 0.4 0.6 0.8 1.0 P(X(t)=2 | X(0)=1) t 1985 1995 2005 2015 0.0 0.2 0.4 0.6 0.8 1.0 P(X(t)=1 | X(0)=2) t 1985 1995 2005 2015 0.0 0.2 0.4 0.6 0.8 1.0 P(X(t)=2 | X(0)=2) t Fig. 3 Transition-function matrix of the hidden MC governing the suicide rate observed in Japan (solid red line) and in US (solid blue line) true generating and the emission matrices are given by A=⎛ ⎜ ⎜ ⎝ −64 1 1 3−51 1 12−52 022−4 ⎞ ⎟ ⎟ ⎠,and,G=⎛ ⎜ ⎜ ⎝ 0.50.50 0 0.30.50.20 0.10.20.50.2 00.20.30.5 ⎞ ⎟ ⎟ ⎠. Besides, we assume that the system is inspected at times that follow a Poisson process with intensity λ. Let us assume that X0=1andY0=y1. We have simulated a total of 500 samples of size N=100 each according to the following algorithm. 1. Generate a sample trajectory (X1,T1),...,(XN,TN)of the MC Xfrom the generating matrix A,whereXnis the nth state visited by the process and Tnthe sojourn time of the system in the n−1forn∈{1,...,N}. Denote Zn=n k=1Tn, the successive jump times of the MC. 123 Statistical Inference for Stochastic Processes Fig. 4 Scenario 2: Observations follow a Poisson process 0.0 0.5 1.0 1.5 2.0 0.0 0.2 0.4 0.6 0.8 1.0 Reliability function for CTHMM time True curve PP(6.5) PP(8) PP(9) Table 2 Mean values of sample sizes for different values of λλ6.5789 ¯ N0131.1 141.2 161.0 180.8 ¯ N0=500 k=1Nk 0 Nk 0, total number of observations obtained at the kth repetition of the experiment 2. Generate a sample Y1,...,YNof the process Y, following the rule P(Y=y|X=i)= Gi,y, with i∈{1,2,3,4}and y∈Y. 3. Generate a sample trajectory of the PP with rate λ,thatis,S1<S2<...< SN0.Simulate arrival times until SN0≥ZN. 4. Put ˆ Y0=Y0. For each r∈{1,...,N0},findn>0 such that Zn≤Sr<Zn+1and define ˆ Yr=Yn. We have considered three cases, λ∈{6.5,8,9} Again we use the EM-algorithm, as in Gamiz et al. (2023), to fit the discrete HMM (ˆ X,ˆ Y)and estimate the corresponding parameters  Qand  G. Also, for each repetition of the experiment, estimate  λ=n0 Sn0 . Then, obtain an estimation of the generating matrix  A as explained in Sect.3.1. Using the estimation of the emission matrix  Gwe construct the generating matrix of the 2-dimensional process (X,Y)and following 4.1 we can obtain the estimation of the reliability function, which is shown in Fig. 4. Notice that N0≥N, since we choose λ>max{−aii,i∈E}.Inourcasewehave obtained the statistics displayed in Table 2. 123 Statistical Inference for Stochastic Processes 6 Conclusion Continuous-time hidden Markov processes can be seen as a two-dimensional continuous-time Markov process (Xt,Yt)where the first component Xtis an unobservable continuous-time Markov chain and the second one Ytis an observable process whose distribution law depends on Xtthrough a function called the emission function. In this paper, we have defined the generator function corresponding to the coupled process in terms of the generating matrix of Xtand the emission function. The theoretical properties of this type of processes have been obtained using a semi-Markov formulation of the model. To estimate the characteristics of the process we have considered two different discretization schemes under which observations can arrive. On the one hand, we assume that observations arrive regularly in time, and on the other hand, we assume that observations arrive at random. In both cases, maximum-likelihood estimator of the parameters of the CTHMM have been obtained and their asymptotic properties have been proven. To our knowledge, the approach to HMM models considered in this paper, basing on Markov renewal theory, is completely new and provides a powerful tool to get other insights in this context of HMMs. With respect to the estimation problem, as pointed out in Liu et al. (2017), when discretization is too coarse, many transitions of the hidden states can occur between two consecutive observations and the dynamics of the hidden process might be poorly caught by the model. This situation may happen in our first scenario when the time-span between observations (h) is not fine enough. Then, more flexible models are required and it is suitable a continuous follow-up of the process that will be considered in a future work. In the applications discussed in this paper we have assumed that the set of hidden states is finite and the number of states is pre-specified. Generalizations of our work can be to consider selecting the optimal number of hidden states, as in Lin and Song (2022)wherethe number of states is unknown and to be determined by the data. Another approach that will be considered in future works, consists of defining the state space of the hidden chain, in general as a measurable set. See for example, Dorea and Zhao (2002) where kernel density estimation is discussed for the observed process in the context of DTHMM. Acknowledgements This work was jointly supported by the Spanish Ministry of Science and Innovation-State Research Agency through grants numbered PID2020-120217RB-I00 and PID2021-123737NB-I00, and the IMAG-Maria de Maeztu grant CEX2020-001105-/AEI/10.13039/501100011033; and by the Spanish Junta de Andalucia through grant number B-FQM-284-UGR20. Funding Funding for open access publishing: Universidad de Granada/CBUA Author contributuions All authors contributed to the study conception and design. Material preparation, data collection and analysis were performed by all authors. The first draft of the manuscript was written by MLG and all authors commented on previous versions of the manuscript. All authors read and approved the final manuscript. Declarations Conflict of interest On behalf of all authors, the corresponding author states that there is no conflict of interest. Consent for publication All the authors approve the version to be published. Ethical approval All authors declare to comply with Journal Ethics. Consent to participate All the authors consent to participate in this research. 123 Statistical Inference for Stochastic Processes Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/. References Baum LE, Petrie T (1966) Statistical inference for probabilistic functions of finite state Markov chains. Ann Math Stat 37(6):1554–1563 Bickel PJ, Ritov Y, Ryden T (1998) Asymptotic normality of the maximum-likelihood estimator for a general hidden Markov model. Ann Stat 26(4):1614–1635 Dorea CC, Zhao LC (2002) Nonparametric density estimation in hidden Markov models. Stat Inference Stoch Process 5:55–64 Freed DS, Shepp LA (1982) A Poisson process whose rate is a hidden Markov process. Adv Appl Probab 14(1):21–36 Gamiz ML, Limnios N, Segovia-Garcia MC (2023) Hidden Markov models in reliability and maintenance. Eur J Oper Res 304:1242–1255 Girardin V, Limnios N (2018) Applied probability. From random sequences to stochastic processes. Springer, Cham Gut A (2013) Probability: a graduate course. Springer, Berlin Hulme WJ, Martin GP, Sperrin M, Casson AJ, Bucci S, Lewis S, Peek N (2021) Adaptative symptom monitoring using hidden Markov models—an application in ecological momentary assessment. IEEE J Biomed Health Inform 25(5):1770–1780 Kingman JFC (1963) Ergodic properties of continuous-time Markov processes and their discrete skeletons. Proc Lond Math Soc 13(1):593–604 Kulkarni VG (2011) Introduction to modeling and analysis of stochastic systems. Springer, Berlin Leroux BG (1992) Maximum-likelihood estimation for hidden Markov models. Stoch Process Appl 40:127– 143 Limnios N (2012) Reliability measures of semi-Markov systems with general state space. Methodol Comput Appl Probab 14:895–917 Limnios N, Oprisan G (2001) Semi-Markov processes and reliability. Springer Science & Business Media, Berlin Lin Y, Song X (2022) Order selection for regression-based hidden Markov model. J Multivar Anal 192:105061 Liu YY, Li S, Li F, Song L, Rehg JM (2016) Efficient learning of continuous-time hidden Markov models for disease progression. Adv Neural Inf Process Syst 28:3599–3607 Liu YY, Moreno A, Li S, Li F, Song L, Rehg JM (2017) Learning continuous-time hidden Markov models for event data. In: Rehg J, Murphy S, Kumar S (eds) Mobile health. Springer, Cham. https://doi.org/10. 1007/978-3-319-51394-2_19 Mor B, Garhwal S, Kumar A (2021) A systematic review of hidden Markov models and their applications. Arch Comput Methods Eng 28:1429–1448 Ross SM (1996) Stochastic processes, 2nd edn. Wiley, Hoboken Sadek A, Limnios N (2002) Asymptotic properties for maximum likelihood estimators for reliability and failure rates of Markov chains. Commun Stat Theory Methods 31(10):1837–1861 Sadek A, Limnios N (2005) Nonparametric estimation of reliability and survival function for continuous-time finite Markov processes. J Stat Plan Inference 133:1–21 Shurenkov VM (1984) On the theory of Markov renewal. Theory Probab Appl 19(2):247–265 Verma A, Powell G, Luo Y, Stephens D, Buckeridge DL (2018) Modeling disease progression in longitudinal EHR data using continuous-time hidden Markov models. Machine Learning for Health Workshop. arxiv.org/1812.00528 Wei W, Wang B, Towsley D (2002) Continous-time hidden Markov models for network performance evaluation. Perform Eval 49:129–146 Zhou J, Song X, Sun L (2020) Continuous time hidden Markov model for longitudinal data. J Multivar Anal 179:1–16 123