In this section, the two statistical models, i.e., stratified Cox model and heterogeneous Markov chain model, are introduced in detail.
2.1. Stratified Cox Model with Time-Dependent Covariates for Recurrent Event
As an extension of original Cox models in Cox [
14], Andersen and Gill [
15], Prentice et al. [
16] proposed a stratified Cox model, which is commonly used for modelling recurrent events in survival analysis. It will be used in this study to analyse the relationship between hazards of trains with recurrent events (primary delay) and weather covariates by assuming that the hazard function of a train is correlated with its preceding events through an event-specific baseline hazard function. Formally, the stratified Cox model with time-dependent covariates for recurrent events is an expression of the hazard function and covariates
where
represents the hazard function for the jth event of the ith train at time t.
is an event-specific baseline hazard and the order number j is the stratification variable, e.g., is a common baseline hazard of the first event for each train.
represents the weather covariate vector for the ith train and the jth event at time t.
is an unknown coefficient vector to be estimated, the exponential of which indicates how the hazard ratios are affected by the covariate vector.
The coefficients can be estimated by maximising the partial likelihood, given by
where
j is the event index with
being the train-specific maximum number of events,
denotes the covariate vector for the
ith train at the
jth event time
is an event indicator that equals 1 for the
jth event of the
ith train and 0 for censoring,
is a group of trains that is at risk of the
jth event at time
. Please note that the partial likelihood takes into account the conditional probabilities for the events that occur for trains.
The fitted model can then be used to predict the hazard function, , for the jth event of train i of interest given the values of covariates, as well as corresponding survival function, , which gives the probability that the train i does not suffer the jth event up to time t. The survival function is an exponential function of the hazards function, i.e., .
2.2. Heterogeneous Markov Chain Model with Time-Dependent Covariates
Let
denote a continuous time Markov chain. At each time point
t,
takes a value over a countable state space. The probability of chain
being in state
s at time
t is
. The conditional probability
represents the transition probability of moving from the state
r at time
t to the state
s at time
. The instantaneous movement from state
r to state
s at time
t is governed by transition intensity,
, through the transition probabilities
With these definitions, a Markov chain can be used to describe train running states (delay/punctuality) on a train line, where the time
t refers to running distance of a train from the starting point throughout the study instead of time, since the running distance is more meaningful in practice. The
of a
q states process forms a
transition intensity matrix
, whose rows sum to zero, so that the diagonal entries are defined by
. An example of transition intensity matrix
with two states can be seen below
where
and
at time
t.
A homogeneous Markov chain in time means that the transition intensity
is independent of
t, and the transition probability from one state to another depends solely on the time difference between two time points, i.e.,
Corresponding to the transition intensity matrix
Q, the entry in a transition probability matrix
is the transition probability
. The relationship between transition intensity matrix and transition probability matrix is specified through the Kolmogorov differential equations [
17]. In particular, when a process is homogeneous, the transition probability matrix can be calculated by taking the matrix exponential of the transition intensity matrix
In a homogeneous Markov chain model, to take account of the effect of covariates, a Cox-like model was proposed by Marshall and Jones [
18]
where
is a baseline transition intensity from state
r to state
s when all covariates are zero and
is a covariate vector under the corresponding transition. The value
, where
is one element of the vector
reflects how the corresponding covariate affects the hazard ratio given that all other covariates are held constant. More specifically,
indicates the transition intensity from
r to
s increases as the value of the covariate increases,
indicates the transition intensity decreases as the value of the covariate increases, while
implies the covariate has no effect on the transition intensity.
The coefficient vectors
as well as the transition intensity matrix
Q and the transition probability matrix
can be estimated by maximising the likelihood
where
j is a sequence index of observed states with
being number of measuring spots for train
i on the train line,
represents the
jth observed state of the
ith train at time
and the transition probability is evaluated at the time difference
.
Contrary to the homogeneous Markov chain model, a heterogeneous Markov chain model assumes that the transition intensity may change continuously at any time. However, the transition probability matrix as well as the likelihood (
8) are analytically intractable under this situation [
19]. An exception is that the transition intensity changes at countable time points. For example, the transition intensity is assumed to change at time point
for each train. To achieve it, one can introduce an indicator covariate in the model to represent the two time periods
where
is an indicator function taking value 1 if
, otherwise, 0, and
is the coefficient. Please note that the covariate vector under the same transition is separated into two at
through the indicator function, since (
9) can be formulated as two homogeneous models and each model has its own covariate vector, i.e.,
for the first model when
and
for the second model when
. Similar to
, the value
is the hazard ratio of intensities between
and
for the transition from
r to
s.
After fitting the heterogeneous Markov chain model, one can calculate the predicted transition probability matrix for any operational interval of interest on the train line using (
6) provided that values of covariates for the interval are given.