-
PDF
- Split View
-
Views
-
Cite
Cite
Yu Luo, Chris Sherlock, Bayesian inference for the Markov-modulated Poisson process with an outcome process, Journal of the Royal Statistical Society Series C: Applied Statistics, 2025;, qlaf021, https://doi.org/10.1093/jrsssc/qlaf021
- Share Icon Share
Abstract
In medical research, understanding changes in outcome measurements is crucial for inferring shifts in health conditions. However, traditional methods often struggle with large, irregularly longitudinal data and fail to account for the tendency of individuals in poorer health to interact more frequently with the healthcare system. Additionally, clinical data can lack information on terminating events like death. To address these challenges, we start from the continuous-time hidden Markov model which models observed data as outcomes influenced by latent health states. Our extension incorporates a point process to account for the impact of health states on observation timings and includes a ‘death’ state to model unobserved terminating events through a Poisson process, where transition rates depend on the latent health state. This approach captures both the severity of the disease and the timing of healthcare interactions. We present an exact Gibbs sampler procedure that alternates between sampling the latent health state paths and the model parameters. By including the ‘death’ state, we mitigate biases in parameter estimation that would arise from solely modelling ‘live’ health states. Simulation studies demonstrate that the proposed Gibbs sampler performs effectively. We apply our method to Canadian healthcare data, offering valuable insights for healthcare management.
1 Introduction
In medical research, observed changes in outcome measurement are used to infer changes in the underlying condition of the patient. Data must be collected over time (longitudinally) on a patient to characterize the effect of risk factors and to evaluate the effectiveness of treatments. For instance, understanding the progression of chronic diseases, such as chronic obstructive pulmonary disease (COPD), is important to inform early diagnosis, personalized care, and health system management. With no existing cure, the severity of COPD increases over time, producing more frequent exacerbations, and increasing use of healthcare (Burge and Wedzicha, 2003). This worsening disease trajectory defines COPD and many other chronic illnesses. Despite this natural history of worsening disease, health system indicators currently describe COPD from a cross-sectional perspective. These traditional measures of service volume, such as hospitalization rates, neglect the temporal disease progression within individuals that is central to managing COPD. Data from clinical and administrative systems have the potential to advance this understanding, but traditional methods for modelling disease progression are not well-suited to analysing high-dimensional data collected at irregular intervals. Many cases of severe illness can be traced back to a lack of appropriate and ongoing follow-up health care. To help understand the long-term causes of severe and preventable illness, we need to understand not only how many patients have severe illness but also what their ‘care paths’ or ‘trajectories’ were before they ended up with severe illness. Private and public healthcare systems now have the ability to maintain longitudinal digital health records. These data from sources, such as electronic health records, health systems and data from mobile health applications, allow the study of subject-specific trajectories, which can inform clinical and public health decision-making. However, data are typically recorded only when a subject interacts with a provider, resulting in irregularly spaced longitudinal observations, and the patterns of clinical interactions vary from subject to subject. Although the data allow dynamic monitoring of the underlying disease progression that governs the data recorded in the health system, this disease progression cannot be observed directly, and so inferential methods are needed to ascertain the latent progression. The statistical analysis of such data, especially when the cohort is large and observations are frequent, is complex.
A multi-state model captures the status of an individual longitudinally as a time-discretization of a continuous-time Markov process, and in many settings the common assumption that the health status of a patient falls into one of a finite number of categories (usually ordered by severity) is a plausible one. Inference for continuous-time Markov processes observed discretely and either precisely or partially has been well studied (see, for example, Bladt and Sørensen, 2005; Pfeuffer, 2017). However, health system records typically do not include direct information about underlying health status; instead, it is inferred indirectly through a proxy measure. Such a process can be modelled as a continuous-time hidden Markov model (CTHMM, e.g. Cappé et al., 2005), which has been studied recently in medical applications such as disease progression (Luo et al., 2021) and cancer screening (Klausch et al., 2023; Lange et al., 2015). While a CTHMM can address the issue of non-equidistant longitudinal observations, in medical research, it is possible that the timing of healthcare utilization itself is informative in the assessment of health status progression. For example, patients who are in more severe health states typically interact with the healthcare system more frequently. A common approach to modelling informative observation times is to use a Poisson process (e.g. Cook and Lawless, 2018). However, if the intensity of the Poisson process depends on the state of a hidden Markov process, it is often referred to as a Markov-modulated Poisson process (MMPP) (e.g. Fearnhead and Sherlock, 2006; Rydén, 1996). There have been studies modelling this observation time process using frequentist approaches, such as Lange et al. (2015) and Mews et al. (2023).
In addition, data from the claim and healthcare system provide no information for terminating events, such as death. However, appropriate parameter inference will only follow if we distinguish a lack of interaction with the healthcare system due to, for example, mild illness from a lack of interaction due to the subject being dead. Nevala et al. (2024) included the death data from a different data system to model colorectal cancer progression. However, to the best of our knowledge, there is no existing method to account for the terminating event, such as death, when it is not available in a dataset and event times are informative. In this article, we develop a Bayesian inference procedure that takes into account the observation process by modelling the observed data as an outcome process and the time of observations as a point process jointly alongside the CTHMM, given the underlying latent health state. Moreover, we also consider the death time as missing data, and model the death as an informative censoring. This extension allows us to model disease severity and death not only from the types of care received but also from the times between different observed events and their respective frequency. It also provides insights on how long patients tend to survive in each state.
The article is organized as follows. Section 2 demonstrate the model structure, followed by the likelihood construction in Section 2.1 and the forward–backward method to calculate the probability of each state at the observation time in Section 3. Section 4 layouts the Gibbs sampler to draw inference for the model, and some empirical studies, including simulation and real data analysis, are in Section 5. The article concludes in Section 6 with a summary of findings and discusses areas for future research.
2 A MMPP with an outcome process
In this section, we describe the continuous-time hidden Markov model with the observation time following a Poisson process. In the sequel, for any collection of scalars, or , we denote the concatenations by and , respectively. Thus, for a particular individual we observe the data at time points . We assume that the data arise as a consequence of a latent continuous-time Markov chain (CTMC) taking values on the finite integer set . We denote the generator of the latent process by and the initial distribution by ν. At observation time (), the latent process is in state , and the observation is .
Conditional on the latent process being in state , at time , the outcome observation is drawn from a distribution with a probability mass or density function , where is a vector of covariates (including an intercept) and β is a D-vector of covariate effects. In all of our simulations, including the real-data example, the prior for , is chosen to be conditionally conjugate to so that it is straightforward to sample from the conditional posterior for each given . It is possible to extend inference to the non-conjugate case using the Metropolis–Hastings algorithm; see the online supplementary material for a brief discussion. Define the matrix for and as the regression coefficient matrix.
In addition, we allow the observation process itself (that is, the times that the observations are made) to be informative about the latent trajectory. Specifically, let be the number of observations (events of the Poisson process) on , , so that and . We assume that follows a Poisson process whose intensity is when . The joint process is a MMPP, and inference approaches have been extensively studied in, for example, Rydén (1996) and Fearnhead and Sherlock (2006). To simplify notation, we write for and for .
Conditional on , the observations are assumed to be independent of each other and of ; also is assumed to evolve independently of except that its intensity is . Therefore, the observation time is generated from the MMPP and the outcome is then generated from . Figure 1 provides a schematic of the presumed data generating structure for one subject. Conditional on ν, , and , data for each subject are assumed to be generated independently of the data for all other subjects. Ideally we observe the process over some time interval for some and with . However, for each patient, our data start with a diagnosis of COPD, so .

Schematic of the presumed data generating mechanism for the Markov-modulated Poisson process with an outcome process . represents the process underlying the observed data, with observation (event) time points denoted for a state-dependent Poisson process ; represents the hidden Markov process.
2.1 Likelihood for the MMPP with an outcome process
We are interested in inference for the data generated from the MMPP with an outcome process. We now construct the complete-data likelihood for one subject over the time interval . Since subjects are independent, the likelihood for all subjects is the product of the individual likelihoods.
The likelihood function for and ν is (Bladt and Sørensen, 2005)
where is the number of transitions from state l to state m in the time interval , and is the total time that the process has spent in state l in . The values of are the elements in . In addition, the likelihood function for is
where is the number of events at state i. Note that the quantities , , and all are unobserved, but they can be computed when the underlying process is known.
The complete likelihood, derived from , and can be factorized:
Thus,
If independent Gamma-distributed priors are assigned to all of the components and (see Section 4.1) then, conditional on the complete chains for all individuals, the posteriors for these parameters also have independent Gamma distributions. This permits the use of the Gibbs steps described in Section 4.2. An alternative partial imputation, which necessitates Metropolis–Hastings updates for these parameters, is discussed in the online supplementary material.
2.2 Data-induced window restriction
Our data are of interactions between patients with COPD and the health service during a 17-year window between 1st January 1998 and 31st December 2014. If a patient was diagnosed with COPD within the window then the first observation for that patient is the time of diagnosis. The patient may have interacted with the health service within the 17-year window and before they were diagnosed with COPD, but we do not know about these interactions. Therefore, for any given patient, we set ; we start the clock at the first interaction. Since we know there will always be an interaction at time 0, this observation does not contribute to the count in (1). Of necessity, therefore, the initial distribution ν represents an average of the distribution of the state when an individual is first diagnosed with COPD and, for those already had with COPD at the start of 1998, the distribution of the state at their first interaction within the window.
For each patient, we do not have the time of death or, even, an indicator of whether or not death occurred before the end of 2014. If the last interaction with the health service was just before the end of the window then it seems likely the patient was still alive at the end of the window; however, if the last interaction was well before the end of the window and there had been a high frequency of interactions before this then it is likely that the patient died or moved away from the province shortly after the final interaction. In Section 5, for the data analysis and one of the simulation studies, we circumvent this issue by introducing an additional state for the hidden chain, corresponding to death (or moving away). This is an absorbing state and there are no observations whilst in this state.
Figure 2 shows three example patients’ health trajectories. The observation window is between 0 and τ, and assume that all patients have an observation at time 0. Patient 1 died right before τ, and we have the record for the last observation but do not have information for the death. Patient 2, on the other hand, has one additional interaction after the observation window and died afterwards. For these patients, the death happens close to the observation window. Modelling death does not have much impact on estimates of or . However, Patient 3 has an early death, and the trajectory for observed data is only half of the observation window. For these patients who die early, in particular, we need to model death instead of, for example, assuming the patient is alive until the end of the window.

Example of patients’ health trajectories. Circle represents the observation, and cross represents the death (missing). The end of the observation window is at time τ.
3 The forward–backward algorithm
Before we discuss inference for the model, we first derive the specifics of the general forward–backward algorithm (Baum and Petrie, 1966) during the window which enable us to simulate the unobserved Markov process .
In this section, it will be clearer to denote the end of the observation window by rather than τ and to define . Note that are random observation times but is the fixed end of the window. Just as the event is equivalent to having observation-process events at times and at no other times in , the event implies, additionally, that there are no observation process events in the interval . Recall, also, that our data format forces us to set , so that the fact that an event happens at time 0 does not form part of the data; now has the same purpose as , defining the boundary of the observation window. However, since there was an event at time there is an observation, , which does need to be accounted for.
We use the notation to indicate all indices between and including j and k; for example . Thus, we first define the forward variable,
In our case, is guaranteed, so . Then for ,
Further, .
To enact the above recursion we must calculate the quantities, , , and . For , this is the probability of the next event after time being at time and the chain being in state k at this time, all given that the chain was in state i at time . The final quantity differs from this in that there has been no event from just after , up to and including .
Consider a new process on . The absorbing state occurs as soon as there has been at a new event in the Poisson process . Specifically, at time the process is in state i; i.e. . Up until the next event in the Poisson process, , we continue to have , but from the time of the next Poisson event onwards, . The process is a CTMC (Mark and Ephraim, 2013), and its generator is
where . Writing for , and defining , we see that
Similarly,
Therefore, the recursions for the forward variable are
with .
From its definition, so we may sample a value for with the probabilities of the individual states proportional to the elements of . Suppose that we have simulated from their joint distribution given , and . We now describe how to simulate backward from its conditional distribution given , , and . From the hidden Markov structure, conditional on , all random variables with time indices before are independent of those with indices after , so
where is understood to be . Hence
again using the conditional independence structure. Thus, for ,
since k is known. For , the constant term does not appear in the first place, leading to the same result. Finally,
The above recursions enable us to simulate , , conditional on , and and (no further observations up to) . To simulate from , we also need to fill in the gaps between the observation times. The conditional dependence structure of the model means that given and , is independent of and of and . Furthermore, given and , is independent of . However, the fact that two neighbouring event times, and bracket the time interval of interest means that there are no events in .
Combining the above information, to simulate from given and with and , we must simulate from given and . We employ the uniformization method of Fearnhead and Sherlock (2006) and Rao and Teh (2013).
4 Bayesian inference for the MMPP with an outcome process
We are interested in Bayesian analysis of the MMPP with an outcome process. Bayesian inference for CTHMMs has been explored under various likelihood formulation, such as simulation-based (Luo et al., 2021) and approximation (Williams et al., 2020) methods. To the best of our knowledge, it has never been implemented for an MMPP model with an outcome process under a full Bayesian paradigm. We outline the steps for a Metropolis-within-Gibbs Markov chain Monte Carlo (MCMC) algorithm to draw posterior samples given suitable prior distributions for the parameters. Our scheme uses the complete data log-likelihood in (1) in the spirit of Luo et al. (2021) and Fearnhead and Sherlock (2006). Throughout, we assume that the number of states, K, is fixed and known.
4.1 Prior distributions
As stated in Section 2, the model for the outcome process when , is such that a family of conditionally conjugate priors exists; we choose the prior for each from this family, and set . The initial distribution, ν, is given a Dirichlet prior, so that, conditional on , its posterior is also Dirichlet.
For and , we choose
where is the density of a random variable, evaluated at x. From (1), conditional on and , the posterior distributions for each and () are mutually independent and all have Gamma distributions.
For and , it is tempting to represent the absence of knowledge about each parameter through a prior with a low shape parameter, . However, any model with K states includes a model with states, with a particular state, i, never visited. In this case, the data, and , provide no further information on and (). Thus, the posteriors for all and parameters are a mixture including at least one component that is simply the prior. If the prior shape parameter for that parameter is below 1, the prior density rises to as the parameter tends to 0, and, because the posterior is a mixture density that includes the prior, the posterior density also rises to as each parameter , which usually does not represent our prior belief and, moreover, can lead to poor mixing of the MCMC chain.
4.2 Exact Gibbs sampler
Each step of our Gibbs sampler simulates a parameter or parameter vector, or an aspect of the latent process, , from its conditional distribution given all of the other information, including and .
The presentation in Sections 2 and 3 focused on a single individual. To make the full process clear, let there be N subjects, and let the nth have observations at times . For subject n, we shift time so that , set , where τ corresponds to the end of 2014 and define the latent path to be . Each latent path gives rise to summary statistics , , and as defined for a specific subject in Section 2.1. We write and .
Following Fearnhead and Sherlock (2006); Luo et al. (2021), the Gibbs sampler has the following distinct steps.
For each n in , simulate from its conditional distribution given , via the steps in Section 3.
For each n in and each t in , simulate (identifying with ) via the direct-sampling method of Hobolth and Stone (2009) or uniformization in Fearnhead and Sherlock (2006) and Rao and Teh (2013). This provides and, hence, the summaries , and , .
Update ν from its conditional Dirichlet posterior given .
For and , update from its conditional Gamma posterior given and .
For , update each from its conditional Gamma posterior given and .
For , update from its conditional posterior given .
Our first simulation study involves a two-state chain and allows us to demonstrate the utility of both forms of information: the event times and values observed at these times. Our second simulated example, and our real-data example consider a three-state chain, with the third state being death and where the state can only increase. The non-zero transition rates are , , and , and the non-zero observation-process rates are and .
5 Empirical studies
5.1 Example 1
In this example, we demonstrate the performance of the proposed Gibbs sampler, and investigate the convergence, mixing and inferences on parameters under different scenarios.
For each of subjects, we simulate a realization of a two-state latent process without the death, , using a generator of
and an initial distribution of . The outcome process is Gaussian, , where is a scalar, so that . For each individual, the time window is ; individuals are started from the initial distribution, ν, and the trajectory, events and observations simulated for the entire window. Thus, here, in contrast with our real-data scenario, there is no observation at time 0, and the first forward variable is .
We consider four scenarios in this example.
Scenario I: and the point process rate .
Scenario II: and the point process rate .
Scenario III: and the point process rate .
Scenario IV: We use the same and λ as Scenario III but perform Bayesian inference using a CTHMM (Luo et al., 2021), ignoring the point process.
In Scenario I, both the Poisson intensity and the Gaussian expectation are distinct between states, whereas in Scenario II, while the Gaussian expectations are distinct, the Poisson intensities are the same. In Scenario III, the Gaussian expectations are similar but the intensity rates distinct, while Scenario IV is extremely challenging, with no information from the point process and very little information from the outcome process.
We place non-informative priors on all the parameters in this study. Each of , , , and have independent priors. We place a prior on each element of , and a prior for ν.
Trace plots, auto-correlations plots, and histograms for and are shown in Figures 3 and 4; Integrated auto-correlation times (IACTs) for , , , , , and are provided in Table 1. In Scenario I, where the data are generated from a model characterized by clear separation between the states, the Gibbs sampler performs well, with fast convergence and mixing. In Scenario II, where the timing of the events provides no information about the state, the Gibbs sampler’s performance declines slightly, though it still remains promising. The posterior distribution of is slightly off the true value. Challenges arise when the data are generated from a less well-separated outcome process, leading to notable auto-correlations in the posterior samples, particularly those associated with . The reduction in mixing efficiency is considerable; however, the chain does still mix adequately over the 20,000 iterations shown. By contrast, in Scenario IV, when the point-process information is removed from Scenario III, the exploration of the posterior over the 20,000 iterations is so poor that we would judge that the chain has perhaps not yet even converged. Moreover, the posterior for includes values that are not strongly supported by the data. This illustrates the most important point: especially in cases where the outcome process is not particularly informative, the information from the timings of the events provides an important contribution to the posterior and, possibly because of the tighter posterior and more clearly defined paths for each , improves the mixing of the chain.

Example 1: Trace, ACF plots, and histogram for λ using the exact Gibbs sampler for different scenarios.

Example 1: Trace, ACF plots, and histogram for using the exact Gibbs sampler for different scenarios.
Example 1: Integrated auto-correlation times (IACTs) of the posterior sample for each parameter in each scenario
Scenario . | . | . | . | . | . | . |
---|---|---|---|---|---|---|
I | 3.4 | 5.0 | 7.8 | 8.4 | 5.4 | 4.6 |
II | 3.9 | 4.8 | 12.4 | 10.7 | 7.1 | 7.1 |
III | 27.4 | 22.9 | 52.7 | 47.7 | 13.3 | 14.5 |
IV | n/a | n/a | (257.0) | (261.4) | (276.2) | (384.0) |
Scenario . | . | . | . | . | . | . |
---|---|---|---|---|---|---|
I | 3.4 | 5.0 | 7.8 | 8.4 | 5.4 | 4.6 |
II | 3.9 | 4.8 | 12.4 | 10.7 | 7.1 | 7.1 |
III | 27.4 | 22.9 | 52.7 | 47.7 | 13.3 | 14.5 |
IV | n/a | n/a | (257.0) | (261.4) | (276.2) | (384.0) |
Note. Bracketed terms indicate that the effective sample size was , so there is reduced confidence in the estimate of the IACT.
Example 1: Integrated auto-correlation times (IACTs) of the posterior sample for each parameter in each scenario
Scenario . | . | . | . | . | . | . |
---|---|---|---|---|---|---|
I | 3.4 | 5.0 | 7.8 | 8.4 | 5.4 | 4.6 |
II | 3.9 | 4.8 | 12.4 | 10.7 | 7.1 | 7.1 |
III | 27.4 | 22.9 | 52.7 | 47.7 | 13.3 | 14.5 |
IV | n/a | n/a | (257.0) | (261.4) | (276.2) | (384.0) |
Scenario . | . | . | . | . | . | . |
---|---|---|---|---|---|---|
I | 3.4 | 5.0 | 7.8 | 8.4 | 5.4 | 4.6 |
II | 3.9 | 4.8 | 12.4 | 10.7 | 7.1 | 7.1 |
III | 27.4 | 22.9 | 52.7 | 47.7 | 13.3 | 14.5 |
IV | n/a | n/a | (257.0) | (261.4) | (276.2) | (384.0) |
Note. Bracketed terms indicate that the effective sample size was , so there is reduced confidence in the estimate of the IACT.
5.2 Example 2
In this example, we demonstrate valid inference for simulated data with a similar pattern to our real data. We generate the data from a three-state model which is similar to that used for our real data, with subjects. For each subject, we simulate a realization of a three-state latent process with the death as the absorbing state, ,
so trajectories can only progress forward with no chances to transit back to previous states. The outcome process is with when in state k, and where the time-varying covariate is Bernoulli; we set
This is equivalent to and , with and . In this case, the outcome expectations (marginalized over the covariate) are , which are and for the two states, respectively. The point process rate is set as . State 3 is the death state without any observed outcome. If the patient progresses to the absorbing state before the observation window, i.e. death, then the last observation is the final one before death. Otherwise, the last observation is the one right before the observation window, . We assumed that the first observation is made at time 0 according to the initial distribution. Similar to Example 1, we place non-informative priors on all the parameters in this study. Each of , , , and have independent priors. We place independent priors on each of the four Poisson expectations, , , , and a prior for .
Table 2 presents the integrated auto-correlation times (IACTs) for , , and over 20,000 iterations and shows that all of these parameters mix well. Figure 5 presents a histogram of the marginal posterior for each of these parameters, with each true parameter value falling within the main posterior mass. This example demonstrate that by simulating the data-induced window similar to the real data, we can achieve valid inference.

Example 2: marginal histograms of , , , , and ; the associated vertical red lines depict the true parameter value.
Example 2: Integrated auto-correlation times (IACTs) of the posterior sample for each parameter
. | . | . | . | . | . | . | . | . |
---|---|---|---|---|---|---|---|---|
3.0 | 3.0 | 3.2 | 3.5 | 3.1 | 3.4 | 3.7 | 3.2 | 3.0 |
. | . | . | . | . | . | . | . | . |
---|---|---|---|---|---|---|---|---|
3.0 | 3.0 | 3.2 | 3.5 | 3.1 | 3.4 | 3.7 | 3.2 | 3.0 |
Example 2: Integrated auto-correlation times (IACTs) of the posterior sample for each parameter
. | . | . | . | . | . | . | . | . |
---|---|---|---|---|---|---|---|---|
3.0 | 3.0 | 3.2 | 3.5 | 3.1 | 3.4 | 3.7 | 3.2 | 3.0 |
. | . | . | . | . | . | . | . | . |
---|---|---|---|---|---|---|---|---|
3.0 | 3.0 | 3.2 | 3.5 | 3.1 | 3.4 | 3.7 | 3.2 | 3.0 |
5.3 Application: Canadian healthcare system data
In this section, we delve into the proposed methodology designed to enhance our understanding of the progression of chronic diseases, particularly COPD. The significance of this understanding lies in its potential to help with effective management of healthcare systems and pave the way for methods of early diagnosis and personalized care, as the model can help the management team understand the ‘care path’ or ‘trajectory’ of the cohort before they become severely ill. While clinical and administrative data harbour valuable insights, traditional methods for modelling disease progression face limitations when dealing with data collected at irregular intervals and interaction frequency, such as when patients choose to engage with the healthcare system.
To address these challenges, our proposed methodology is applied to a COPD cohort derived from healthcare administrative data. An open, dynamic cohort was established, comprising a 25% random sample of Montreal residents in Canada. In 1998, a similar random sample was drawn from the Régie de l’assurance maladie du Québec (RAMQ)-registered population within the census metropolitan area of Montreal. Subsequently, at the onset of each subsequent year, 25% of individuals born in Montreal or relocating to Montreal within the past year were sampled to maintain cohort representativeness. Follow-up concluded upon death or a change in residential address outside Montreal; however, neither death nor the time of address change is recorded in our data. This administrative database encompasses outpatient diagnoses and procedures submitted through RAMQ billing claims, as well as inpatient claims for procedures and diagnoses. Drug dispensing data are available for individuals covered by drug insurance through RAMQ, which includes roughly half the population, especially all those aged 65 and above. All data are interconnected through an anonymized version of the RAMQ number, and administered by the Surveillance Lab at McGill Clinical & Health Informatics research group.
Utilizing established case definitions based on diagnostic codes (Lix et al., 2018), a total of 76,888 COPD patients were enrolled, with an incident event (ICD-9 491x, 492x, 496x; ICD-10 J41–J44) occurring after a minimum of 2 years at risk with no events. The observation period spanned from January 1998, commencing with the patients’ first diagnosis, until December 2014. Physicians observed these patients solely during medical visits, which transpired when patients chose to interact with the healthcare system. In these medical visits, pertinent medical information was gathered, and from this observed information, we aim to infer the patients’ unobserved disease status, which is represented using a discrete disease state model. In this study, the disease status was indirectly gauged through a proxy: the number of prescribed medications at the time of observation. Notably, this information was available exclusively for patients with drug insurance, leading us to focus on patients aged over 65 years, constituting the study population for our analysis. This full dataset has been previously analysed in Luo et al. (2021). Due to the data restriction, we are allowed to randomly sample 1,000 patients to demonstrate our proposed method. Figure 6 shows one COPD patient’s follow-up from this dataset. As shown in the figure, we observe the number of drugs prescribed as the observation process. In addition, we have also observe variations in the type of encounters, i.e. general practitioner visit (GP), hospitalization (HOSP), specialist visit (SPEC), and emergency department visit (ED), which will be incorporated as time-varying covariates in our model. These changes in the observation point process, transitioning from sparse to dense, reflect the evolving severity of the chronic disease under study. In the dataset, the average number of drugs prescribed from a visit for GP, ED, HOSP, and SPEC is 5.06, 5.57, 5.28, and 5.17 respectively, suggesting little deviation among the types of healthcare utilization. Over the 1,000 patients, the average time from the first recorded interaction until the last observation is about 13.71 years.

COPD patient’s trajectory from the Canadian healthcare system data.
We apply the model from Section 2 to this sample dataset, with the inference methodology from Section 4. We focus on a three-state model with State 3 (the unobserved death state) as an absorbing state. We place independent priors on each and all elements in , and a prior on each expected number of drugs dispensed for each healthcare utilization, and a prior for , with . The outcome process is modelled with a Poisson distribution, with the types of healthcare utilization (HOSP, SPEC, GP, and ED) as a time-dependent covariate; equivalently, for each of States 1 and 2 there are four parameters, indicating the expected number of drugs dispensed for each of the four values of the covariate.
We ran the algorithm for 20,000 iterations; for all parameters, the estimated IACTs were <5, indicating excellent mixing of the MCMC algorithm. Table 3 displays the estimates for all of the model parameters. The narrow 95% credible intervals associated with these estimated parameters indicate low uncertainty within the estimated densities. The posterior median for the number of prescribed drugs rises by about a factor of four from State 1 to State 2, reflecting the worsening severity of patients’ health conditions. In State 2, expected drug dispensations for emergency department visits and hospitalizations are slightly higher than other types of visits. Point process rates are roughly 35% higher in State 2 than in State 1, suggesting increased healthcare system interactions during poorer health conditions. This indicates a correlation between disease severity and healthcare utilization, with State 2 indicating the higher level of healthcare engagement among patients. In the state transition dynamics, the median stay in State 1 is roughly years and the probability that a patient is still in State 1 after 4 years is approximately . When a transition from State 1 occurs, the probability that it will be directly to the death state is . The estimates for State 2 suggest a more persistent state (median stay being over 4 years) and potentially more severe state of illness. Patients in State 1 are less likely to die (or move from the province) in any given year, compared to those in State 2. The median time to death in State 2 is 4.3 years. We also notice that meaning that conditional on a healthcare visit, patients are almost equally likely to start in each of the two states in the healthcare system.
Parameter . | State 1 . | State 2 . |
---|---|---|
λ (Marked point process rate) | 5.07 (4.97, 5.16) | 6.82 (6.72, 6.93) |
ν (initial state distribution) | 0.54 (0.51, 0.58) | 0.46 (0.42, 0.49) |
Expected number of drugs dispensed (GP) | 2.12 (2.10, 2.14) | 7.28 (7.26, 7.31) |
Expected number of drugs dispensed (ED) | 1.72 (1.67, 1.78) | 7.47 (7.43, 7.53) |
Expected number of drugs dispensed (HOSP) | 1.77 (1.72, 1.81) | 7.36 (7.31, 7.41) |
Expected number of drugs dispensed (SPEC) | 1.79 (1.75, 1.85) | 7.16 (7.10, 7.21) |
(Transition rate from State 1) | 0.23 (0.21, 0.25) | |
(Transition rate to death state) | 0.07 (0.06, 0.08) | 0.16 (0.14, 0.17) |
Parameter . | State 1 . | State 2 . |
---|---|---|
λ (Marked point process rate) | 5.07 (4.97, 5.16) | 6.82 (6.72, 6.93) |
ν (initial state distribution) | 0.54 (0.51, 0.58) | 0.46 (0.42, 0.49) |
Expected number of drugs dispensed (GP) | 2.12 (2.10, 2.14) | 7.28 (7.26, 7.31) |
Expected number of drugs dispensed (ED) | 1.72 (1.67, 1.78) | 7.47 (7.43, 7.53) |
Expected number of drugs dispensed (HOSP) | 1.77 (1.72, 1.81) | 7.36 (7.31, 7.41) |
Expected number of drugs dispensed (SPEC) | 1.79 (1.75, 1.85) | 7.16 (7.10, 7.21) |
(Transition rate from State 1) | 0.23 (0.21, 0.25) | |
(Transition rate to death state) | 0.07 (0.06, 0.08) | 0.16 (0.14, 0.17) |
Parameter . | State 1 . | State 2 . |
---|---|---|
λ (Marked point process rate) | 5.07 (4.97, 5.16) | 6.82 (6.72, 6.93) |
ν (initial state distribution) | 0.54 (0.51, 0.58) | 0.46 (0.42, 0.49) |
Expected number of drugs dispensed (GP) | 2.12 (2.10, 2.14) | 7.28 (7.26, 7.31) |
Expected number of drugs dispensed (ED) | 1.72 (1.67, 1.78) | 7.47 (7.43, 7.53) |
Expected number of drugs dispensed (HOSP) | 1.77 (1.72, 1.81) | 7.36 (7.31, 7.41) |
Expected number of drugs dispensed (SPEC) | 1.79 (1.75, 1.85) | 7.16 (7.10, 7.21) |
(Transition rate from State 1) | 0.23 (0.21, 0.25) | |
(Transition rate to death state) | 0.07 (0.06, 0.08) | 0.16 (0.14, 0.17) |
Parameter . | State 1 . | State 2 . |
---|---|---|
λ (Marked point process rate) | 5.07 (4.97, 5.16) | 6.82 (6.72, 6.93) |
ν (initial state distribution) | 0.54 (0.51, 0.58) | 0.46 (0.42, 0.49) |
Expected number of drugs dispensed (GP) | 2.12 (2.10, 2.14) | 7.28 (7.26, 7.31) |
Expected number of drugs dispensed (ED) | 1.72 (1.67, 1.78) | 7.47 (7.43, 7.53) |
Expected number of drugs dispensed (HOSP) | 1.77 (1.72, 1.81) | 7.36 (7.31, 7.41) |
Expected number of drugs dispensed (SPEC) | 1.79 (1.75, 1.85) | 7.16 (7.10, 7.21) |
(Transition rate from State 1) | 0.23 (0.21, 0.25) | |
(Transition rate to death state) | 0.07 (0.06, 0.08) | 0.16 (0.14, 0.17) |
We also ran the Gibbs sampler without the point process as with Scenario IV in Example 1. The parameter estimates are reproduced in the online supplementary material. They show that ignoring the point process information makes patients seem to remain in State 1 for longer. The other substantial difference is that the transition rate to the death state from State 1 is slightly greater than that from State 2. We also fitted a four-state model, again with only transitions to higher states allowed, and now with State 4 (the unobserved death state) as an absorbing state. We compared a Laplace-based approximation of its marginal likelihood with a similar approximation to the marginal likelihood of the three-state model; see the online supplementary material for details. The estimated marginal likelihoods for three-state and four-state models are and , respectively, leading to corresponding BICs of . This shows that the three-state model is preferable; results for the four-state model are also presented in the online supplementary material.
This inferred state dynamic provides valuable insights for healthcare management, offering guidance on the performance of current COPD interventions. The tendency for patients in State 1 to remain in that state initially before transitioning to State 2 underscores the need for interventions aimed at preventing or delaying disease progression, particularly during the early stages. For patients already in State 2, the observed persistence suggests a potentially more challenging treatment landscape, emphasizing the importance of comprehensive and long-term management strategies. Understanding these state transition dynamics informs healthcare providers and policymakers about the effectiveness of existing interventions and guides the development of targeted strategies to improve patient outcomes. By identifying critical transition points and patient populations at higher risk of disease progression, healthcare resources can be allocated more effectively to provide timely and appropriate interventions, ultimately improving the management and care of individuals with COPD. However, it is important to note that there is no guarantee that the latent state and trajectory groupings will directly correspond to the underlying biologic processes or disease stages as our initial model is built without clinical measurements. Therefore, the identified states correspond to the general health conditions of COPD patients, implying that a higher disease level or intensity of healthcare encounters does not strictly indicate a deterioration in COPD but could signify any temporary or prolonged period of poor health condition. By using this Canadian cohort dataset, the initial latent groupings are expected to generate hypotheses about how the patients are being managed.
6 Discussion
In this article, we have considered a generalization of both the hidden Markov model and the MMPP to an MMPP with an outcome process, and we have proposed an exact Gibbs sampler to facilitate Bayesian inference. Our data model also incorporates an unobserved terminating event (death or moving away from the area).
This advance is driven by the need to analyse longitudinal data and model an unobserved death so as to comprehend the progression of a disease processes. A critical decision revolves around whether observation times are considered non-informative or informative, on the state of the Markov chain, which relates to the disease severity. Neglecting to account for an informative observation process in the disease dynamics or to incorporate an unobserved terminating event, such as death, can potentially lead to biased parameter estimates. With the large amount of claim data and healthcare data available, there is a pressing need to work on appropriate statistical modelling framework for longitudinal healthcare studies. The proposed technique for inferring death prevents the bias that would arise if a model without death were employed with a shortened observation window only up to the final event time. Our approach offers a framework for analysing complex healthcare data, providing insights into disease progression and patient health/death states that can inform clinical decision-making and healthcare interventions.
Since our algorithm is a Gibbs sampler, it requires no tuning parameters and could be used ‘off the shelf’ by practitioners. Simulation studies indicate the effectiveness of the Gibbs sampler and show how the event times contribute vital information, especially when the outcome process lacks a clear separation between the states. By integrating observation times and death into the model, we enhance our understanding of disease dynamics and healthcare utilization patterns, thus advancing the methodology for analysing longitudinal data in healthcare research. In our application, we imposed a constraint that the process can only progress forward since COPD gets progressively worse over time (Cleveland Clinic, 2024). However, one could make no restrictions on the allowed transitions in the state space. In the absence of other information, the hidden state would then be non-identifiable with all permutations of the state labels equivalent. To avoid the ensuing identifiability issue, meaningful priors could be placed on the outcome models for each state or the outcome process event rates—that is, we would distinguish the states via their impact on the observable quantities or imposing certain restrictions on (see Section 4 in Luo et al., 2021 for a detailed discussion).
Although the proposed model possesses a flexible structure, there remains some scope for future research to explore several possibilities in analysing such irregularly spaced longitudinal data. The current setup assumes time-homogeneous processes and . Both processes may plausibly depend on time. For instance, within any given health state, older patients might engage more frequently with the healthcare system. However, introducing complex structures to model the transition in poses computational challenges in both frequentist and Bayesian inference (see for example, Kendall et al., 2024, and a discussion in the online supplementary material of this article). In addition, the issue of identifying the number of hidden states in MMPPs has been a long-standing challenge. In the context of HMMs, this topic has been explored using approaches such as marginal likelihood, cross-validated likelihood, and complete-data likelihood (see, Celeux and Durand, 2008; Luo and Stephens, 2021; Pohle et al., 2017); however, model selection criteria based on these quantities become unreliable as the dimensionality increases beyond 50 (Chen and Chen, 2008). Moreover, while the current model categorizes patients into discrete states, which is appropriate for some chronic diseases thought to have discrete stages of progression, relaxing the assumption of discrete states could yield insights. Relaxing the assumption that patients evolve through discrete states of underlying disease progression, would allow estimation of a continuum of severity that may better represent the trajectory of COPD and other chronic diseases. Substantial advances in statistical methodology would be required to extend this approach to a continuous state space and to allow the latent state distribution to have an interpretation as a continuous index or score. For example, one could use the features included in comorbidity indices to measure multimorbidity in terms of the ability to predict future mortality and health services use. The inference problem for this type of assumption involves multivariate diffusion processes, using discrete-time data that may be incomplete and affected by measurement errors (e.g. Golightly and Sherlock, 2022).
Acknowledgments
The authors would like to thank Prof. David Buckeridge from the Surveillance Lab at McGill Clinical & Health Informatics research group for granting us access to the real data that enabled us to demonstrate the empirical study in this article. The authors would also like to thank two referees for their constructive comments, which have improved the content and clarity of this article.
Data availability
Real data used in this article to illustrate our findings are not shared as restrictions apply to the availability of these data, which were used under license for this study. Simulated data related to Example 1 are generated by the code supplied in the online supplementary material.
Supplementary material
Supplementary material is available online at Journal of the Royal Statistical Society: Series C.
References
Author notes
Conflicts of interest The authors have no conflict of interest to disclose.