Skip to main content
Journal of Applied Statistics logoLink to Journal of Applied Statistics
. 2019 Oct 16;47(8):1354–1374. doi: 10.1080/02664763.2019.1677573

An MCMC computational approach for a continuous time state-dependent regime switching diffusion process

El Houcine Hibbah a,CONTACT, Hamid El Maroufy a,✉, Christiane Fuchs b,c,d, Taib Ziad e,f
PMCID: PMC9041985  PMID: 35706700

ABSTRACT

State-dependent regime switching diffusion processes or hybrid switching diffusion (HSD) processes are hard to simulate with classical methods which leads us to adopt a Markov chain Monte Carlo (MCMC) Bayesian approach very convenient to estimate complicated models such as the HSD one. In the HSD, the diffusion component is dependent on the switching discrete hidden regimes and the transition rates of the regime switching are dependent on the diffusion observations. Since in reality phenomena are only observed in discrete times, data imputation is called for to create more observations so as to have good approximations for the density of the diffusion process. Three categories of entities will be computed in a Bayesian context: The latent imputed observations, the regime switching states, and the parameters of the models. The latent imputed data is updated at random time intervals in block using a Metropolis Hastings algorithm. The switching states are computed by an adaptation of a forward filtering backward smoothing algorithm to the HSD model. The parameters are estimated after prior specifications and conditional posterior densities formulation using Gibbs sampler or Metropolis Hastings algorithm.

Keywords: Hybrid switching diffusion model, data imputation, hidden states computation, random time imputation, states computation

1. Introduction

Understanding phenomena dynamic such as disease progression is very challenging because it incorporates behavioural switching in continuous time; which requires us to apply a methodology that is suitable when data is observed at irregular times. Indeed, one should appeal to a rich class of continuous time models. Those models are usually taken to be diffusion processes such as the Ornstein–Uhlenbeck models [13]. Even though the usefulness of diffusion processes and the many advantages they can offer, they cannot handle all the dynamics caused by some complex phenomena. In many cases, phenomena change behaviour or evolution depending on intermediate indicators or variables. For example, in economics, the states can be the economic situations (growth, stability, crisis)and the developed variable can be options pricing or any economic factors that are changing attitude due to different economics situations. Also, in ecology [7], animal movement has been shown to change behaviour depending on the state of whether the animal is resting at a nest, foraging, or heading for a nest. Our modelling can be well present in disease progression such as HIV progression [23], where an observed bio-marker called CD4 counts decline is varying from one HIV disease stage to another. Thus, we recourse for diffusion processes but with the extension of regime switching. By adding the regime switching characteristics, the regime switching model (RSM) will be combining two components: a continuous diffusion observation component and an unobserved component most of the time discrete and supposed to be Markovian. Consequently, RSM is usually supposed to be Markovian and hence called Markov regime switching models. Their underlying idea is the switching mechanism who is supposed to be latent (unobserved or unknown). The simplest model supposes a two-dimensional Markov processes, where the first component is continuous and real valued and depending on the second, and the second has discrete values and acts monotonously from the first process. Such models have attracted a lot of attention in diverse fields or sciences such as in population dynamics [28], in pattern recognition [17], or in ecology [5,6]. However, in our case, we will go a little further and direct our attention toward a more advanced switching diffusion process that supposes the dependence of the rate of the switching or of the transition on the observations or covariates. A fundamental theoretical description and practical significance related to this modelling is provided in [4]. A recent example with the Bayesian estimation methodology is presented in [7], where animal movement is an adaptive movement since it depends and follows the habitat (resting or foraging). Those kinds of models are called hybrid switching diffusion (HSD) models and highlight the coexistence of continuous dynamics and discrete events: one component describes the continuous dynamics, whereas the other is a switching process representing discrete events with the switching part depending on the continuous dynamics. The exception to RSM is that the rates of transition for the discrete states in an HSD process depend on the continuous dynamics [20,27].

In this paper, we will provide a Markov chain Monte Carlo (MCMC) method to estimate the parameters of a HSD model. While we could find classical methods to compute the parameters of an RSM as in [22,24] where a maximum likelihood and expectation–maximization procedures are adopted, likelihood inference is very challenging for HSD. In fact, the diffusion component is non linear most of the time and most of the diffusion phenomena of practical interest are non-linear in their nature [32]. Furthermore, the transition rates of the regime switching are dependent on the diffusion observations [4,7]. Moreover, the observations are available only at scattered discrete times or are subject to measurement errors [21]. This leads us to impute data between successive observations to find an efficient approximation to the unavailable transition density of the HSD using an Euler approximation in the case of HSD as in [33]. The method of imputation aims at augmenting the likelihood with the imputed data. In the Bayesian context, the procedure alternates between updating the imputed data and updating the parameters. Unfortunately, the update of the imputed data can suffer from poor mixing such as the single site update of [16], or has a long mixing times of MCMC algorithm such as the block update of [14] if the number of imputation data is so large. The challenge of our modelling is that we have to augment the likelihood with the hidden states beside the imputed data and the parameters. Also, unlike regular state independent Markov switching diffusion process, our model supposes the dependence of the transition rate matrix on the diffusion process. Furthermore, instead of fixed times imputation, we opt for the algorithm of random time points update as described in [34] and applied to HSD in a Bayesian context in [7]. These will avoid any discretization error, where the times and the imputed data proposed are accepted or rejected using a Metropolis Hastings algorithm (MHA). Thus, we will appeal to the Bayesian inference through MCMC methods to sample the posterior distribution for the parameters, the latent imputed data and the hidden states for the uni-dimensional regime switching process since the discrete states of the switches are supposed unknown in this model. We will extend the Bayesian inference and data imputation of [19, Ch. 7] for non-linear diffusion to uni-dimensional HSD using the random time intervals for the imputation as in [7].

This paper is organized as follows: In Section 2, we describe the model considered. Section 3 provides the Bayesian inference for the latent imputed data, the hidden states, and the parameters including the parameters of transition rate matrix. In Section 4, we see more details on how priors are chosen and how posteriors densities are computed with an illustration by an important non-linear HSD process, and an application to disease progression. Finally, we give a discussion and a conclusion.

2. Model description and notations

We consider a continuous time HSP of the following form:

dX(t)=μ(X(t),S(t))dt+σ(X(t),S(t))dWt.X(t)=X0andS(t)=S0, (1)

with P(S(t+δt)=j|S(t)=i,X(s),S(s),s≤t)=qij(X(t))δt+o(δt), i≠j, μ() and σ(⋅) are appropriate real valued functions satisfying certain regularity conditions. W is a uni-dimensional standard Brownian motion. S(⋅) is a switching process taking discrete values in {1,…,a} with a is an integer and with the dynamics of S(⋅) depending on X(t). Specifically, the spontaneous transition rate matrix Q(x,t)=(qkl(x,t))1≤k,l≤a for the switching process has the following properties:

  1. qkl(x,t)≥0, for k≠l, for any x and time t.

  2. ∑lqkl(x,t)=0, for any x and time t.

Yin and Zhu [45] has summarized the difference between continuous state-dependent switching diffusion process and Markovian switching models in term of properties of solutions of the process and numerical procedures.

We suppose we have N individuals with ni the number of observation times for each individual i such that the trajectory for each individual i is given by xi=(xi1,…,xini). We consider tij the times of observations for individual i, and the latent switching states will be denoted sij for individual i at time tij. Time points are usually different between subjects, also ni may differ between individuals. Θ is the set of the parameters in the model, while θ is the set of all parameters except the parameters related to the transition rate matrix. Hence, by applying the Markov property and the conditional probability and Bayes rules, the likelihood could be written as

L(X,S;Θ)∝∏i=1N(P(xi1,si1,Θ)∏j=2niP(xij,sij|xij−1,sij−1,Θ)∝∏i=1N(P(xi1,si1,Θ)∏j=2niP(xij|xij−1,sij,sij−1,Θ)P(sij|xij−1,sij−1,Θ)∝∏i=1N(P(xi1,si1,Θ)∏j=2niP(xij|xij−1,sij−1,Θ)P(sij|xij−1,sij−1,Θ)Applying exponential matrix to the switching process givesL(X,S;Θ)∝∏i=1N(P(xi1,si1,Θ)∏j=2niP(xij|xij−1,sij−1,Θ)×[exp⁡(Q(xij−1)Δtij)]sij−1,sij

P(sij|xij−1,sij−1,Θ) is the element (sij−1,sij) of the transition probability matrix evaluated at the diffusion location xij−1. Since the transition matrix is obtained from the exponential of the generator Q evaluated at xij−1, and we obtain the elements [exp(Q(xij−1)Δtij)]sij−1,sij, with Δtij=tij−tij−1. This exponential approximation supposes constant xt for a short period of time Δtij.

3. Bayesian inference

Direct estimation of HSD processes is very difficult because the transition density of the diffusion component is most of the time unavailable in a closed form and we need to approximate it. Thus, to overcome the issue of low frequency data and consequently the density approximation can be used, we need to introduce intermediate data between successive observations. Thus, we appeal to Bayesian data imputation [15,16,35]. Hence an mij−1 missing observations are imputed between successive observations xij and xij−1 to obtain for each individual i a vector: Xi=(xi1,Xi12,…,Xi1mi1,xi2,Xi22…,xini−1,Xini−12,…,Xini−1mini,xini), with Xij1=xij and Xijk will have corresponding Sijk at the time point tijk (the kth imputation time after observation xij). Since we have three categories of variables to estimate: The parameters Θ, the latent switching state S and the imputed (latent) data X, our imputed joint posterior density is formulated as follows:

P(Θ,X,S|x)∝P(Θ)∏i=1N(P(Xi11,Si11|Θ)×∏j=1ni−1P(Xij+11|Xijmij,Sijmij,Θ)[exp⁡(Q(Xijmij)Δtij+11)]Sijmij,Sij+11×∏j=1ni−1∏k=1mij−1P(Xijk+1|Xijk,Sijk,Θ)[exp⁡(Q(Xijk)Δtijk+1)]Sijk,Sijk+1.

To evaluate the conditional posterior, we use a numerical Euler approximation [25] for the small time tijk (the kth imputation time between observation xij and xij+1, with the exception that Δtij+11=tij+11−tijmij and tij1 is the time at the observation xij), and we have πEuler(Xijk+1|Xijk,S,Θ)≈φ(Xijk+1|Xijk+μ(Xijk,Sijk,Θ)Δtijk+1,σ(Xijk,Sijk,Θ)Δtijk+1), with Sijk the regime switching state value for individual i at time imputation tijk, with Δtijk+1=tijk+1−tijk and φ(z|ν,Λ) is a normal distribution with mean ν and variance Λ. P(Θ) is the prior distribution for the set of parameters Θ. The MCMC algorithm will generate a Markov chain targeting the augmented posterior P(Θ,X,S|x) under some mild regularity conditions. In fact, the data augmentation procedure of [40] inference may proceed by alternating between the simulation of the parameters conditional on the augmented data, and the simulation of the augmented data given the observed data and the current state of the model parameters. A discussion of convergence issues related to non linear diffusion processes with latent data is provided in [21]. Such issues include the update choice for the imputed data and that the mij should not be so large in order to avoid the slow mixing of the targeted chain in the MCMC algorithm. Hence, we perform our simulation by alternating between drawing from the following conditional posteriors given all other quantities (denoted by ·):

3.

  1. Draw the latent(imputed) observations from P(X|⋅)

  2. Draw the latent switching states from P(S|⋅)

  3. Draw the parameters from P(Θ|⋅).

3.1. Sampling the latent data

While it is possible to update each latent(imputed) data separately, we will adopt a block update for the whole sequence of imputed data for each individual observation Xi. Since it is difficult to come with an analytical form for the posterior distribution of the imputed data, an MHA [19, Ch. 7] is utilized to draw the new imputed data Xinew from an old Xiold, for i=1,…,n. Though for the imputation of auxiliary data, we opt for the algorithm of random time points update as described in [34] and applied to HSD in a Bayesian context in [7]. These will avoid any discretization error.

Suppose that the transition rates are all bounded above and let the times will be generated from a Poisson process with parameter κ>maxi,x,t{−Qii(x,t)}, and by the way we can use algorithm (1) to generate the times for each individual i=1,…,N.

So by introducing mij−1 new observations between two successive observations xij−1 and xij, the MHA acceptance ratio will be

ζ(Xinew,Tinew;Xiold,Tiold)=1∧P(Xinew|D,S,Θ)ψ(Xiold|Xinew,D,S,Θ)P(Xiold|D,S,Θ)ψ(Xinew|Xiold,D,S,Θ).

Where P denote the posterior density, ψ the proposal density, and D the observed, not the imputed data. Due to the Markov property in HSD, we have

P(Xinew|D,S,Θ)P(Xiold|D,S,Θ)=∏j=1ni−1P(Xij+11|Xijnew,mij,S,Θ)P(Xij+11|Xijold,mij,S,Θ)∏j=1ni−1∏k=1mij−1P(Xijnew,k+1|Xijnew,k,S,Θ)P(Xijold,k+1|Xijold,k,S,Θ)=∏j=1ni−1P(Δtij+1new,1,Xijnew,mij,Xij+11)P(Δtij+1old,1,Xijold,mij,Xij+11)∏j=1ni−1∏k=1mij−1P(Δtijnew,k+1,Xijnew,k,Xijnew,k+1)P(Δtijold,k+1,Xijold,k,Xijold,k+1)

Δtijk+1=tijk+1−tijk is very small to permit an Euler approximation for P by

PEuler(Xijk+1|Xijk,S,Θ)≈φ(Xijk+1|Xijk+μ(Xijk,Sijk,Θ)Δtijk+1,σ(Xijk,Sijk,Θ)Δtijk+1),

with Sijk the regime switching state value for individual i at time imputation tijk, and φ(z|ν,Λ) is normal distribution with mean ν and variance Λ.

While to the choice of the proposal density ψ, one could choose an Euler proposal or a double-sided Euler proposal, but due to the dependency between Xnew and Xold, we will adopt the modified bridge proposal ψMB of [14]; supposed to overcome the issue of dependence between successive draws; as adopted in the Bayesian context by [11]. Note that Xijnew,1=Xijold,1=xij and Sijnew,1=Sijold,1, and the proposed path will be accepted with probability:

ζ(Xinew,Tinew;Xiold,Tiold)=1∧∏j=1ni−1P(Xij+11|Xijnew,mij,S,Θ)P(Xij+11|Xijold,mij,S,Θ)×∏j=1ni−1∏k=1mij−1P(Xijnew,k+1|Xijnew,k,S,Θ)P(Xijold,k+1|Xijold,k,S,Θ)×ψMB(Xiold|Xi1,Xini,S,Θ)ψMB(Xinew|Xi1,Xini,S,Θ), (2)

where

ψMB(Xiold|Xi1,Xini,S,Θ)ψMB(Xinew|Xi1,Xini,S,Θ)=∏j=1ni−1∏k=1mij−1ψMB(Xijold,k+1|Xij1,Xij+11,S,Θ)ψMB(Xijnew,k+1|Xij1,Xij+11,S,Θ)

with

ψMB(Xijnew,k+1|Xij1,Xij+11,S,Θ)=φ(Xijnew,k+1|Xijnew,k+Xijmij−Xijnew,ktij+1new,1−tijnew,kΔtijnew,k+1,…tij+1new,1−tijnew,k+1tij+1new,1−tijnew,kσ(Xijnew,k,Sijnew,k,Θ)Δtijnew,k+1).

3.1.

3.2. Sampling the switching hidden states

Instead of simulating each hidden state separately, Chib [9] developed a method called block update of the hidden states in which we simulate the full latent data for each individual i, i=1,2,…,N. Its algorithm was adapted to a multivariate autoregressive hidden Markov model in [30]. We will adapt this algorithm to the HSD process, with the modification that our model suppose observations with different lengths and non-equi-distant intervals. For clarity of representation and for good understanding of this so called forward filtering backward smoothing (FFBS) algorithm, we stack the imputed observations with the observations in one vector of size Ni (The staked data contains both the observation data xi″ and the imputed terms Xijk to give the new stacked vector Xi~) X~i.=(X~i1,…,X~iNi), with the corresponding switching hidden vector S~i.=(S~i1,…,S~iNi), and the times t~i.=(t~i1,…,t~iNi). The times contains both the original as well as the new times staked in a new vector and we use the FFBS to sample the whole sequence of the hidden states. A similar procedure is described in [34]. Let denote X~i−j=(X~i1,…,X~ij), X~ij=(X~ij,…,X~iNi), S~i−j=(S~i1,…,S~ij), and S~ij=(S~ij,…,S~iNi). Now, we write the joint conditional distribution for the hidden states as

P(S~i.|X~i.,Θ)=∏j=1NiP(S~ij|X~i.,S~ij+1).

Hence the states computation is based on the term P(S~ij|X~i.,S~ij+1) which will be evaluated in the backward pass after running the forward filtering as detailled in algorithm (2).

Again, let's remind that in the HSD model, the transition rates are related to the observed diffusion component.

3.3. Sampling from P(θ|X~,S~)

Given the estimation of X~ and S~ in the previous subsection, the conditional posterior of θ is proportional to the prior P(Θ) multiplied by the likelihood, which gives

P(θ|X~,S~)∝P(θ)P(Xi11,Si11|Θ)×∏i=1N∏j=1Ni−1P(X~ij+1|X~ij,S~ij,θ)[exp⁡(Q(X~ij)Δt~ij+1)]S~ij,S~ij+1

Usually, we do not come with a standard distribution to sample from by using Gibbs sampler, thus we will appeal to an MHA. After using proportionality and dropping the terms of the transition rate matrix since they are independent of θ. Hence, we come with an MHA [19, Ch. 7] with an acceptance probability ratio for every new proposal θ∗ as

ζ(θ,θ∗)=1∧P(θ∗)P(θ)×∏i=1N∏j=1Ni−1P(X~ij+1|X~ij,S~ij,θ∗)∏i=1N∏j=1Ni−1P(X~ij+1|X~ij,S~ij,θ)×ψ(θ|θ∗,X~,S~)ψ(θ∗|θ,X~,S~).

As before, using Euler approximation we have P(X~ij+1|X~ij,S~ij,θ)=PEuler(X~ij+1|X~ij,S,θ)≈φ(X~ij+1|X~ij+1+μ(X~ij+1,S~ij,θ)Δt~ij,σ(X~ij,S~ij,θ)Δt~ij+1), ψ is a proposal density to draw a new Θ∗, it depends on the form of the likelihood and the hypothesis of the HSD. Some times, we could use simply a random walk proposal which is independent of X~ and S~ and it is only related to the old draw Θ(old), and we simply propose from a gaussian distribution for some θjnew∼N(θjold,ϵ). ε is the random walk step that can be adjusted to improve convergence. For positive values, we could propose from the log-normal distribution: log⁡θjnew∼LN(log⁡θjold,ϵ).

Finally, and since we have a HSD, the parameters will be dependent on the switching process S~, so for every given parameter θj, we will have to estimate (θj1,…,θjk,…,θja), and the posterior for θjk is

P(θjk|X~,S~)∝P(θ)×∏i=1N∏j=1,S~ij=kNi−1P(X~ij+1|X~ij,S~ij,θ). (3)

4. Numerical example with application to disease progression

We will consider here an example of a non-linear HSD process and give more details on how we can estimate each parameter of the model. In fact, a non-linear drift and a non-linear volatility would allow the HSD process to dispose of elements to represent clearly any complex problem and to be more flexible. Considering the non-linear process of [2] with an extra addition of the regime switching and we get in our case dX~ij=[α0,k+α1,kX~ij+α2,kX~ij2+α3,k/X~ij]dt~ij+1+σX~ijηkdW, for the hidden switching state k∈{1,…,a}. This general form with the regime switching gives many explanations for majority of phenomena, where a negative α2,k guarantees ergodicity and second order stationarity for a volatility function σk(X~ij)=σX~ijηk. Than the first order Euler approximation of this model for a state S~ij=k:

X~ij+1−X~ij=α0,k+α1,kX~ij+α2,kX~ij2+α3,kX~ijΔt~ij+1+σX~ijηkΔt~ij+1ϵ,ϵ∼N(0,1). (4)

4.1. Computation of αk and σ2

To simulate our parameters αk and σ2 using the MCMC algorithm, first let mention that when the posterior density is not known we have to use an MHA as described in parameters update (3), otherwise if we come up with a known posterior density to draw from it directly using Gibbs sampler as it is the case here. For this reason, let's pose Yij=(X~ij+1−X~ij)/X~ijηk, βk=(α0,k,α1,k,α2,k,α0,k) and

yij=Δt~ij+1X~ijηk,X~ijΔt~ij+1X~ijηk,X~ij2Δt~ij+1X~ijηk,(1|X~ij)Δt~ij+1X~ijηk.

In matrix form, the Euler discretization may be represented as in [38]: Y=yβk+ϵ, with ϵ∼N(0,σ2), which is the formulation for a regression model. Consequently, the parameters of the HSD can be easily computed using the Bayesian approach for regime switching regression model. Hence for each βk, k=1,…,a, the posterior is proportional to the prior multiplied by the likelihood

P(βk|X~,S~)∝P(β)×∏i=1N∏j=1,S~ij=kNi−1P(X~ij+1|X~ij,S~ij,Θ).

As in [18, p:251], by supposing a normal and an inverse gamma prior respectively for βk and σ2: Consequently with a conjugate normal prior for βk∼N4(b0k,σ2B0K), we have βk|⋅∼N4(bk,BK), where Bk=(B0K−1+y′y)−1 and bK=Bk(B0K−1b0k+yk′Yk); Yk and yk corresponds only to the observations where S~ij=k.

Similarly, under an inverted conjugate prior for σ2∼IG(c0,C0), the posterior density for σ2 given the observations, the imputed data, the other parameters and the switching states is σ2|.∼IG(c,C), where c=(c0+M/2), and

C=C0+12∑k=1ab0k′B0K−1b0k+12∑k=1a(yk′yk−bk′BK−1bk),

M is the number for all individuals observations.

Ridge regression: One of the problem that can be faced here is the effects of multi-collinearity on the Bayesian regression estimation. Consequently, we recourse to the Bayesian Ridge Regression approach as in [43] who supposes the same priors as earlier for βk and σ2 and we get again similar posteriors as before, the only difference is that in the ridge regression we have B0K=Diagonal(R1,R2,R3,R4). Moreover, to overcome the issue of choosing fixed value for Rj; we suppose the prior P(R1,R2,R3,R4)∼∏j=14RjA/2−1exp⁡(−(b/2)Rj). Hence, we alternate between updating the following posteriors, for each k=1,…,a:

Rjj∼GammaA+Mk2,b+βj22,Mk :the number of observations where S~ij=k.B0K=Diag(R1,R2,R3,R4).βk∼N4(bk,BK). (5)
σ2∼IG(c,C). (6)

4.2. Sampling the posterior dependent parameters on the transition rate matrix Q

In this example, we will suppose that the intensities of the transition rate matrix are dependent on the observed diffusion process through the relation of Gompertz model as in [44]. The consideration of the Gompertz model comes from the fact that this function has been used longer in insurance, in biology such as tumour evolution or bacteria growth and in many other fields [41]. Also the Gompertz model has interpretable parameters, and we have qkl(X~ij)=λklexp⁡(−γklX~ij), λkl,γkl>0, for k≠l∈{1,…,a},i=1,…,N; and j=1,…,Ni. We will suppose prior independence between the parameters of Θ. While the λ's and the γ's can be updated in block as in [29], here we adopt an approach similar to [37], where each element is updated conditional on the other since they are correlated. Hence by supposing a Gamma prior G(0.01,0.01) for the λkl, the posterior of λkl will be

P(λkl|X~,S~)∝P(λkl)∏i=1N∏j=1Ni−1[exp⁡(Q(X~ij)Δt~ij+1)]S~ij,S~ij+1.

As we can see, all the other parameters especially θ are omitted due to the Bayes rule. Consequently, we obtain a non-standard posterior and we have to adopt a random walk MHA to draw a new λklnew (the new MCMC iteration) from an old value λklold (the previous MCMC iteration) with an acceptance probability:

ζ(λklnew,λklold)=1∧P(λklnew)∏i=1N∏j=1Ni−1[exp⁡(Q(X~ij)Δt~ij+1)]S~ij,S~ij+1newP(λklold)∏i=1N∏j=1Ni−1[exp⁡(Q(X~ij)Δt~ij+1)]S~ij,S~ij+1old×λklnewλklold, (7)

where we propose the λklnew from a log-normal distribution LN(λklold,ϵλ) so as to keep operating on real positive values with ϵλ the random walk step. Similarly, a no close form is obtained for the posterior of γkl. So, we consider again a random walk MHA. With a Gamma prior G(0.01,0.01) on γkl and a random walk proposal LN(γklold,ϵγ), our MHA acceptance probability is:

ζ(γklnew,γklold)=1∧P(γklnew)∏i=1N∏j=1Ni−1[exp⁡(Q(X~ij)Δt~ij+1)]S~ij,S~ij+1newP(γklold)∏i=1N∏j=1Ni−1exp(Q(X~ij)Δt~ij+1)S~ij,S~ij+1old×γklnewγklold. (8)

4.3. Computation of ηk

To compute ηk, the posterior is proportional to the prior multiplied by the likelihood. By supposing a Gamma prior G(0.01,0.01), we come with a non-standard posterior, and we call for random walk MHA with the acceptance probability:

ζ(ηknew,ηkold)=1∧P(ηknew)∏i=1N∏j=1,S~ij=kNi−1P(X~ij+1|X~ij,S~ij,ηknew,Θ−ηk)P(ηkold)∏i=1N∏j=1,S~ij=kNi−1P(X~ij+1|X~ij,S~ij,ηknew,Θ−ηk)×ηknewηkold. (9)

Θ−ηk represent all the parameters except ηk. Each ηk must be positive. As before we propose from a log-normal distribution LN(ηkold,ϵη) with step ϵη chosen concisely.

4.4. Numerical implementation and simulation

To assess the accuracy of our finding, we will simulate observations for N = 50 individuals with follow up size between 16 and 20 for every individual. We suppose we have a = 3 regime switching states. the parameters of the non-linear HSD are α0=(0.3,0.6,0.9), α1=(0.02,0.04,0.06), α2=(−0.08,−0.06,−0.04), α3=(0.01,0.05,0.09), η=(0.4,0.5,0.6), σ2=0.04, and

λ=00.20.42030.30.90,γ=00.20.040.010410.80.

Algorithm (3) provides the data generation process for the HSD model, that works with the help of the Euler approximation. This algorithm is applied for every individual i for i=1,…,50.

4.4.

To assess the efficiency of our methods, we will see how our MCMC algorithm can estimate the true values (values used to generate the simulated data). Before providing the MCMC algorithm, we should point out that we do not opt for the usual regularly spaced points imputation procedure that can drive the Bayesian estimation to break down if the amount of imputation is large [21]. In fact, it has been shown dependence between the unknown parameters in the diffusion and the missing data while adopting this imputation. This can result in slow rates of convergence of naive sampling or could conduct to identifiability problem as in the single update of [16] or the block update of [14]. Thus we call for random time imputation that allow exact estimation as in [7]. After the generation of the simulated data and to check the accuracy of the estimation, we ran the MCMC algorithm (see algorithm (4)) for a large number of iterations. During this ran there is a burnings period (where the algorithm has not converged yet). The burnings period varies depending on the volatility complexity, the number of parameters in the model, or the number of imputation as well as the latent data. After the burnings period, the MCMC converges and the inference is based on the last iterations of the MCMC algorithm. Our algorithm proceeds for 8000 iterations (number of iterations found in our case to be convenient for the MCMC to converge so as we can draw inference from the MCMC output) as follow:

4.4.

Table 1 gives the posterior statistics of our algorithm such as the posterior mean, the standard deviation and the 95% credible intervals, where estimations are of good approximation to the true values even though that this complicated process has a large number of parameters. Consequently, parameter estimations have been rendered very simple. Moreover, the convergence issues have been checked for every parameter of the model by the graphical inspection of the trace-plot, the kernel density, and the autocorrelation function plot. It is revealed that we get a good mixing of the MCMC chain (Figure 1), a perfect density shape (Figure 2) and autocorrelations that decay immediately after a few lag (Figure 3). Hence convergence for this MCMC method is achieved. In fact, the MCMC methods show that they are appropriate especially that we have opted for random time imputation. Our algorithm works well if we choose different values for this switching one factor model, or ran a bootstrap simulation. Hence, the algorithm was efficient in approximating the true values.

Table 1. MCMC estimation for the parameters of the model (8000 iterations).

Posterior computations
Parameters True value Mean Standard deviation Credible interval (95%)
α0,1 0.3 0.3026 0.0011 (0.3004,0.3048)
α0,2 0.6 0.6028 0.0201 (0.5636,0.6426)
α0,3 0.9 0.9048 0.0047 (0.8956,0.9140)
α1,1 0.02 0.0211 3.5015×10−04 (0.0204,0.0218)
α1,2 0.04 0.0401 0.0036 (0.0331,0.0472)
α1,3 0.06 0.0602 6.0245×10−04 (0.0590,0.0614)
α2,1 −0.08 −0.0722 6.2750×10−04 (−0.0734,−0.0710)
α2,2 −0.06 −0.0593 0.0038 (−0.0671,−0.0522)
α2,3 −0.04 −0.0395 5.5752×10−04 (−0.0406,−0.0384)
α3,1 0.01 0.0101 3.4369×10−04 (0.0094,0.0107)
α3,2 0.05 0.0503 0.0037 (0.0431,0.0577)
α3,3 0.09 0.0901 7.1083×10−04 (0.0887,0.0915)
λ12 0.2 0.1839 0.0040 (0.1911,0.2070)
λ13 1 0.9108 0.0195 (0.9413,1.0181)
λ21 0.3 0.2790 0.0059 (0.2895,0.3126)
λ23 2 1.8189 0.0392 (1.8738,2.0267)
λ31 0.4 0.3708 0.0080 (0.3846,0.4161)
λ32 7 6.5094 0.1432 (6.7576,7.3138)
γ12 0.2 0.1827 0.0040 (0.1902,0.2056)
γ13 0.04 0.03681 7.7337×10−04 (0.0381,0.0411)
γ21 0.3 0.2899 0.0063 (0.3021,0.3268)
γ23 0.06 0.0538 0.0012 (0.0558,0.0604)
γ31 0.4 0.3841 0.0082 (0.3948,0.4264)
γ32 0.08 0.0742 0.0016 (0.0778,0.0842)
η1 0.3 0.2909 0.0201 (0.2510,0.3298)
η2 0.4 0.3788 0.0430 (0.3098,0.4694)
η3 0.5 0.5324 0.0199 (0.4933,0.5716)
σ2 0.04 0.0377 0.0023 (0.0333,0.0425)

Figure 1.

Figure 1.

8000 MCMC iteration plots for the parameters of the model.

Figure 2.

Figure 2.

Posterior density plots for the parameters of model.

Figure 3.

Figure 3.

Autocorrelation sample plots for the parameters of model.

4.5. Application to disease progression

Many models have been proposed to model disease progression through markers observations, among them [46] proposed a deterministic differential equation model (DEM) to model markers in disease such as Alzheimer's disease, Huntington's disease, or Parkinson's disease. Taking the stochastic version of this DEM by adding the regime switching, we get a process similar to the previous regime switching one factor model with the following expression:

dX~ij=[α0,k+α1,kX~ij+α2,kX~ij2]dt~ij+1+σdWfor k=1,2,3.

We applied this process to model marker observations from a slow developed disease: COPD (Chronic Obstructive Pulmonary Disease). Doctors use Gold stages to address the stage of the COPD (the severity of the disease). Knowing how severe the COPD is in a patient helps to choose the best treatment. The idea is to unravel the stages of the disease using one marker or a combination of many markers. In fact, there are many clinical markers for COPD disease among them: Chest hyperinflation, low body mass index, the use of accessory muscles of respiration, and prolonged expiration. Since, we are interested in one-dimensional diffusion process, we take into consideration as a marker the FEV1 (how much air one can exhales from his lungs in one second, measured in Liter). We will see how the FEV1 observations allow to estimate the parameters of the HSD process. We have supposed that our model has three hidden states; a = 3 (Mild, Moderate, and severe) [39]. We extracted our FEV1 observations using data from the Danish Lung Cancer Screening Trial (DLCST) [36] where 2052 current or ex-smokers aged 50–70 years having FEV1 measured annually for 5 years (2005–2009). We have for each subject, five FEV1 measurements with the date of each measurement. While having more than 10 marker observations by patient would give more parameters precision and identification, disposing here of only 5 marker observations by patient is found to be sufficient for giving accurate results. From the database, it can be seen that the values of the FEV1 marker decrease with the severity of the COPD disease (from values that are greater than 3 L in mild stages to approximately less than 1.5 L for severe stages).

We ran our MCMC algorithm to fit the HSD model and make the inference after the burnings period (inference is based on the last 3000 samples after the burnings). In fact, starting from good initial values for the parameters would help in reducing the time of the burnings period and hence accelerate the MCMC convergence. Such initial values can be obtained from other estimation methods such as the maximum likelihood computation.

Also, while the α's and σ are computed here using Gibbs sampler via a ridge regression approach, in the general case, when the posterior is not a known one we call for the MHA such as for the parameter of the transition rate matrix: the λ's and γ's that have been computed via MHA.

Furthermore, this MCMC uses the random time imputation mechanism. Hence, we have seen that between successive observations, it could happen no imputation or 1 imputation, or 5, or more than 10 time points.

Finally, Table 2 gives the posterior computations for each one of the parameters of the model. It shows how the marker can lead to the estimation of the parameters depending on the hidden states. We could see that most of the parameters (the linear effect parameters and the quadratic effect parameters) have negative values, which goes with the attitudes of the FEV1 marker to decrease with the time. Moreover, and while here we fitted a model with three hidden states one can consider the cases where a = 4 or 5, and uses the Bayesian information criterion (BIC) to choose the best model. Also, we could take other forms of stochastic differential equations and choose which equation fits well the data using the BIC.

Table 2. MCMC output for fitting a HSD Process via FEV1 marker in COPD disease progression.

Posterior computations
Parameters Mean Standard deviation Credible interval (95%)
α0,1 0.0030 0.0084 (−0.0128,0.0172)
α0,2 0.0169 0.0231 (−0.0300,0.0618)
α0,3 0.0164 0.0127 (−0.0113,0.0402)
α1,1 −0.0539 0.0209 (−0.0952,−0.0136)
α1,2 −0.0226 0.0656 (−0.1545,0.1105)
α1,3 −0.0240 0.0395 (−0.1037,0.0497)
α2,1 −0.0264 0.0242 (−0.0730,0.0202)
α2,2 −0.0094 0.0744 (−0.1557,0.1452)
α2,3 −0.0120 0.0450 (−0.0991,0.0761)
λ12 0.2657 0.0058 (0.2538,0.2782)
λ13 0.7661 0.0369 (0.7224,0.8706)
λ21 0.0458 7.55×10−4 (0.0435,0.0470)
λ23 0.6294 0.0114 (0.6152,0.6584)
λ31 0.0708 0.0011 (0.0688,0.0733)
λ32 0.2223 0.0034 (0.2144,0.2263)
γ12 0.0122 4.79×10−4 (0.0113,0.0131)
γ13 0.312 0.012 (0.2889,0.3369)
γ21 2.0406 0.081 (1.8855,2.2007)
γ23 0.0087 3.59×10−4 (0.0081,0.0095)
γ31 4.592 0.187 (4.2384,4.9777)
γ32 3.122 0.126 (2.8812,3.3773)
σ2 0.0086 7.78×10−4 (0.0073,0.0103)

5. Discussion

Bayesian approach is very efficient in simulating complicated models such as the non-linear diffusion processes. In fact, one can incorporate any prior information or knowledge in the likelihood through the prior specification and this is possible because the posterior of the parameters is proportional to prior multiplied by the likelihood. Also, and while MCMC algorithm can converge even when starting in dispersed initial values for the parameters, we can take use of classical method inference on data to get a good starting value such as maximum likelihood or expectation–maximization algorithms.

Another issue that should be pointed here too is that this model uses observation intervals that are non-equi-distant, though we get accurate estimate using The Euler discretization; and why not should we try to improve this accuracy in the future by using the Milstein discretization [42]. Moreover, the number of observations imputed was chosen using the random time imputation which gives exact simulation. With this way, for small intervals we do not impute any data while for large intervals we could impute data.

Other ideas that can attract attention, is the use of the random walk MHA; that could have many problems such as the moving step. Indeed, a bad choice for the moving step can lead to bad mixing or create high correlated draws. Thus, we should some times avoid the random walk MHA and find good proposal density for every new draw for each parameter or adopting more efficient algorithm such as the accept–reject MHA [10]. Hopefully here the ridge regression has allowed to sample many parameters through Gibbs sampler.

Finally, even that the HSD model here adopts a homoscedastic σ2, it could be easily extended to σk2 depending on the hidden states k=1,…,a or we can take the stochastic variance as in the case of ARCH and GARCH model [1,8,12,31].

6. Conclusion

This work provides a Bayesian approach for the simulation of a state-dependent switching diffusion process; one of the processes usually hard to handle in a classical framework. We used Euler discretization to overcome the issue of dispersed observations as it is the case for most diffusion models. We have adapted the random time data imputation to the HSD model. We have let the transition rate matrix to depend on the diffusion observations. Hence, we have lead to the estimation of three categories of variables: The imputed data, the hidden switching states, and the parameters of the diffusion process; the sampling of the hidden state has been realized by the FFBS algorithm adapted to the HSD. Overall, even though the complexity of the switching one factor model, the MCMC algorithm has shown its efficiency to estimate the parameters accurately.

Supplementary Material

Supplemental Material

Supplemental materiel

The supplemental materiel contains the Matlab program of the MCMC simulation of the hybrid switching process considered in the present paper.

Acknowledgment

We would like to thank the editor and the associate editor for their significant guidance. Also, we would like to thank the anonymous reviewers for orienting us toward important references and for helping in improving this work.

Disclosure statement

No potential conflict of interest was reported by the authors.

ORCID

El Houcine Hibbah  http://orcid.org/0000-0001-9319-3670

Hamid El Maroufy  http://orcid.org/0000-0001-6113-7543

Christiane Fuchs  http://orcid.org/0000-0003-3565-8315

Taib Ziad  http://orcid.org/0000-0002-5329-9793

References

  • 1.Adesi G.B., Rasmussen H., and Ravanelli C., An option pricing formula for the GARCH diffusion model, Comput. Stat. Data Anal. 49 (2005), pp. 287–310. doi: 10.1016/j.csda.2004.05.014 [DOI] [Google Scholar]
  • 2.Ait-Sahalia Y., Testing continuous-time models of the spot interest rate, Rev. Financ. Stud. 9 (1996), pp. 385–426. doi: 10.1093/rfs/9.2.385 [DOI] [Google Scholar]
  • 4.Berman S. M., A bivariate Markov process with diffusion and discrete components, Commun. Stat. Stoch. Models 10 (1994), pp. 271–308. doi: 10.1080/15326349408807297 [DOI] [Google Scholar]
  • 5.Blackwell P.G., Random diffusion models for animal movement, Ecol. Modell. 100 (1997), pp. 87–102. doi: 10.1016/S0304-3800(97)00153-1 [DOI] [Google Scholar]
  • 6.Blackwell P.G., Bayesian inference for Markov processes with diffusion and discrete components, Biometrika 90 (2003), pp. 613–627. doi: 10.1093/biomet/90.3.613 [DOI] [Google Scholar]
  • 7.Blackwell P.G., Niu M., Lambert M.S., and LaPoint S.D., Exact Bayesian inference for animal movement in continuous time, Methods Ecol. Evol. 7 (2016), pp. 184–195. doi: 10.1111/2041-210X.12460 [DOI] [Google Scholar]
  • 8.Bollerslev T., Chou R.Y., and Kroner K.F., ARCH modeling in finance: A review of the theory and empirical evidence, J. Econom. 52 (1992), pp. 5–59. doi: 10.1016/0304-4076(92)90064-X [DOI] [Google Scholar]
  • 9.Chib S., Calculating posterior distributions and model estimates in Markov mixtures models, J. Econom. 75 (1996), pp. 79–98. doi: 10.1016/0304-4076(95)01770-4 [DOI] [Google Scholar]
  • 10.Chib S. and Jeliazkov I., Accept–reject Metropolis-Hastings sampling and marginal likelihood estimation, Stat. Neerl. 59 (2005), pp. 30–44. doi: 10.1111/j.1467-9574.2005.00277.x [DOI] [Google Scholar]
  • 11.Chib S. and Shephard N., [Numerical techniques for maximum likelihood estimation of continuous-time diffusion processes]: Comment, J. Bus. Econom. Stat. 20 (2002), pp. 325–327. [Google Scholar]
  • 12.Chou R.Y., Volatility persistence and stock valuations: Some empirical evidence using GARCH, J. Appl. Econom. 3 (1988), pp. 279–294. doi: 10.1002/jae.3950030404 [DOI] [Google Scholar]
  • 13.Dunn J.E. and Gipson P.S., Analysis of radio telemetry data in studies of home range, Biometrics 33 (1977), pp. 85–101. doi: 10.2307/2529305 [DOI] [Google Scholar]
  • 14.Durham G.B. and Gallant A.R., Numerical techniques for maximum likelihood estimation of continuous-time diffusion processes, J. Bus. Econ. Stat. 20 (2002), pp. 297–338. doi: 10.1198/073500102288618397 [DOI] [Google Scholar]
  • 15.Elerian O., Chib S., and Shephard N., Likelihood inference for discretely observed non-linear diffusion, Econometrica 69 (2001), pp. 959–993. doi: 10.1111/1468-0262.00226 [DOI] [Google Scholar]
  • 16.Eraker B., MCMC analysis of diffusion models with application to finance, J. Bus. Econ. Stat. 19 (2001), pp. 177–191. doi: 10.1198/073500101316970403 [DOI] [Google Scholar]
  • 17.Fink G.A, Markov Models for Pattern Recognition, Springer-Verlag, Berlin, 2008. [Google Scholar]
  • 18.Fruhwirth-Schnatter S., Finite Mixture and Markov Switching Models, Springer Series in Statistics, New York, NY, 2006.
  • 19.Fuchs C., Inference for Diffusion Processes: With Applications in Life Sciences, Springer-Verlag, Berlin, Heidelberg, 2013. [Google Scholar]
  • 20.Ghosh M.K., Arapostathis A., and Marcus S.I., Optimal control of switching diffusions with application to flexible manufacturing systems, SIAM J. Control Optim. 31 (1993), pp. 1183–1204. doi: 10.1137/0331056 [DOI] [Google Scholar]
  • 21.Golightly A. and Wilkinson D.J., Bayesian inference for nonlinear multivariate diffusion models observed with error, Comput. Stat. Data Anal. 52 (2008), pp. 1674–1693. doi: 10.1016/j.csda.2007.05.019 [DOI] [Google Scholar]
  • 22.Goutte S., Ismail A., and Pham H., Regime-switching stochastic volatility model: Estimation and calibration to VIX options, Appl. Math. Finance 24 (2017), pp. 38–75. doi: 10.1080/1350486X.2017.1333015 [DOI] [Google Scholar]
  • 23.Guihenneuc-Jouyaux C., Richardson S., and Longini Jr. I.M., Modeling markers of disease progression by a hidden Markov process: Application to characterizing CD4 cell decline, Biometrics 56 (2000), pp. 733–741. doi: 10.1111/j.0006-341X.2000.00733.x [DOI] [PubMed] [Google Scholar]
  • 24.Janczura J. and Weron R., Efficient estimation of Markov regime-switching models: An application to electricity spot prices, AStA Adv. Stat. Anal. 96 (2012), pp. 385–407. doi: 10.1007/s10182-011-0181-2 [DOI] [Google Scholar]
  • 25.Kloeden P.E. and Platen E., Numerical Solution of Stochastic Differential Equations, Applications of Mathematics (New York) 23, Springer-Verlag, Berlin, 1992. doi: 10.1007/978-3-662-12616-5 [DOI]
  • 27.Krystul J. and Blom H.A.P., Monte Carlo simulation of rare events in hybrid systems, Technical Report WP8, Deliverable D8.3. HYBRIDGE, 2004.
  • 28.Li X., Jiang D., and Mao X., Population dynamical behavior of Lotka–Volterra system under regime switching, J. Comput. Appl. Math. 232 (2009), pp. 427–448. doi: 10.1016/j.cam.2009.06.021 [DOI] [Google Scholar]
  • 29.Ma J., A Bayesian approach to longitudinal categorical data in a continuous time Markov chain model, Ph.D. thesis, The University of Texas School of Public Health, Houston, TX, 2013.
  • 30.Maroufy E.H., Hibbah E.H., Zyad A., and Ziad T., Bayesian estimation of multivariate autoregressive hidden Markov model with application to breast cancer biomarker modeling, in Bayesian Inference. J. T. Prieto, eds., Chapter 7, 2017. doi: 10.5772/intechopen.70053 [DOI]
  • 31.Nelson D.B., ARCH models as diffusion approximations, J. Econom. 45 (1990), pp. 7–38. doi: 10.1016/0304-4076(90)90092-8 [DOI] [Google Scholar]
  • 32.Ogawa S., Monte Carlo simulation of non-linear diffusion processes, Jpn. J. Indust. Appl. Math. 9 (1992), pp. 25–33. doi: 10.1007/BF03167193 [DOI] [Google Scholar]
  • 33.Parton A. and Blackwell P.G., Bayesian inference for multistate ‘step and turn’ animal movement in continuous time, J. Agric. Biol. Environ. Stat. 22 (2017), pp. 373–392. doi: 10.1007/s13253-017-0286-5 [DOI] [Google Scholar]
  • 34.Rao V. and Teh Y.W., Fast MCMC sampling for Markov jump processes and extensions, J. Mach. Learn. Res. 14 (2013), pp. 3295–3320. [Google Scholar]
  • 35.Roberts G.O. and Stramer O., On inference for partially observed nonlinear diffusion models using the Metropolis-Hastings algorithm, Biometrika 88 (2001), pp. 603–621. doi: 10.1093/biomet/88.3.603 [DOI] [Google Scholar]
  • 36.Shaker S.B., Dirksen A., Lo P., Skovgaard L.T., de Bruijne M., and Pedersen J.H., Factors influencing the decline in lung density in a Danish lung cancer screening cohort, Eur. Respir. J. 40 (2012), pp. 1142–1148. doi: 10.1183/09031936.00207911 [DOI] [PubMed] [Google Scholar]
  • 37.Siekmann I., Wagner L.E.I.I., Yule D., Fox C., Bryant D., Crampin E.J., and Sneyd J., Fast MCMC sampling for Markov jump processes and extensions, Biophys. J. 100 (2011), pp. 1919–1929. doi: 10.1016/j.bpj.2011.02.059 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 38.Sorwar G., Estimating single factor jump diffusion interest rate models, Appl. Financ. Econom. 21 (2011), pp. 1679–1689. doi: 10.1080/09603107.2011.591729 [DOI] [Google Scholar]
  • 39.Stockley R.A., Biomarkers in chronic obstructive pulmonary disease: Confusing or useful?, Int. J. COPD 4 (2014), pp. 163–177. doi: 10.2147/COPD.S42362 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 40.Tanner M.A. and Wong W.H., The calculation of posterior distributions by data augmentation (with discussion), J. Amer. Statist. Assoc. 82 (1987), pp. 528–540. doi: 10.1080/01621459.1987.10478458 [DOI] [Google Scholar]
  • 41.Tjørve K. M. C. and Tjørve E., The use of Gompertz models in growth analyses, and new Gompertz-model approach: An addition to the Unified-Richards family, PLoS ONE 12 (2017), pp. e0178691. doi: 10.1371/journal.pone.017869 doi: [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Tse Y.K., Yu J., and Chang X.B., Estimation of hyperbolic diffusion using MCMC method, in Research Collection, School of Economics, 2002. Available at http://ink.library.smu.edu.sg/soe_research_all/5
  • 43.Tsionas E. and Tassiopoulos A., Bayesian implications of ridge regression, Zellner's g-prior, Tech. Rep., Athens University of Economics and Business – Department of Economics, Athens, 2016. Available at SSRN: http://ssrn.com/abstract=238758.
  • 44.van den Hout A., Fox J.P., and Klein Entink R.H., Bayesian inference for an illness-death model for stroke with cognition as a latent time-dependent risk factor, Stat. Methods Med. Res. 24 (2015), pp. 769–787. doi: 10.1177/0962280211426359 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 45.Yin G. and Zhu C., Properties of solutions of stochastic differential equations with continuous state-dependent switching, J. Differ. Equ. 249 (2010), pp. 2409–2439. doi: 10.1016/j.jde.2010.08.008 [DOI] [Google Scholar]
  • 46.Young A.L., Oxtoby N.P., and Ourselin S., A simulation system for biomarker evolution in neurodegenerative disease, Med. Image Anal. 26 (2015), pp. 47–56. doi: 10.1016/j.media.2015.07.004 [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplemental Material

Articles from Journal of Applied Statistics are provided here courtesy of Taylor & Francis

RESOURCES