A researcher’s tale
A little about my academic background.
From psychology to statistics.
An introduction to Markov models.
The challenge of assessing model fit.
A simulation study.
What did we find?
Moved to Maynooth: Started undergrad in Psychology.
Accepted into CRT: Started a PhD in data science.
Postdoc: Promoting the usage of e-bikes and sustainable travel.
Lecturing: Temporary lecturing in the department.
Bilbo’s Journey
Approximately 1528 kilometres

My journey
About … 950 meters!





What happens when you mix Rafael, Idemauro, and pancakes together
A Markov model project … apparently
A Markov model is a statistical framework used to describe how a system changes between different states over time.
Some examples include
\[ \boxed{Y_t \in \mathcal{S} = \{1,2,\ldots,K\} \quad \text{for} \; t \in \{1, 2, \dots, \tau\}} \]
A first-order Markov model assumes that the probability of the next state depends only on the current state.
\[ \boxed{P(Y_t = j \mid Y_{t-1} = i, \ldots,Y_1) = P(Y_t = j \mid Y_{t-1}=i)} \]
The Markov property
The future is conditionally independent of the past, given the present.
We can describe the probability of moving from state \(i\) to state \(j\) as
\[ \pi_{ij} = P(Y_t=j \mid Y_{t-1}=i). \]
These probabilities can be organised into a transition probability matrix,
\[ \mathbf{\Pi} = \begin{pmatrix} \pi_{11} & \pi_{12} & \cdots & \pi_{1K} \\ \pi_{21} & \pi_{22} & \cdots & \pi_{2K} \\ \vdots & \vdots & \ddots & \vdots \\ \pi_{K1} & \pi_{K2} & \cdots & \pi_{KK} \end{pmatrix}. \]
We can estimate the probability of transitioning between states.
But how do we know whether our model adequately describes the transitions we actually observe?
In many statistical models, we assess model fit by examining the difference between observed and predicted values.
\[ \text{Residual} = \text{Observed} - \text{Predicted} \]
What does an appropriate residual look like when the outcome is a transition between categorical states?
In a Markov model, the outcome is a transition between categorical states.
For example, a transition might be from:
Rather than predicting a single continuous value, the model estimates a probability for each possible transition.
\[ \hat{\mathbf{r}}_i = \mathbf{y}_i - \hat{\mathbf{y}}_i = (y_{i1} - \hat{y}_{i1},\; y_{i2} - \hat{y}_{i2}, \; \dots, \; y_{ij} - \hat{y}_{ij})^\top \]
However, discrete time Markov models are represented as matrices
\[ \begin{aligned} \hat{\mathbf{R}}_i &= \mathbf{P}_i - \hat{\mathbf{\Pi}}_i \\[4pt] &= \begin{pmatrix} p_{11} - \hat{\pi}_{11} & p_{12} - \hat{\pi}_{12} & \cdots & p_{1K} - \hat{\pi}_{1K} \\ p_{21} - \hat{\pi}_{21} & p_{22} - \hat{\pi}_{22} & \cdots & p_{2K} - \hat{\pi}_{2K} \\ \vdots & \vdots & \ddots & \vdots \\ p_{K1} - \hat{\pi}_{K1} & p_{K2} - \hat{\pi}_{K2} & \cdots & p_{kK} - \hat{\pi}_{KK} \end{pmatrix} \end{aligned} \]
We can construct two transition probability matrices:
\[ \mathbf{\Pi}_{\text{obs}} = \begin{pmatrix} 0.83 & 0.17 \\ 0.33 & 0.66 \end{pmatrix} \qquad \mathbf{\Pi}_{\text{model}} = \begin{pmatrix} 0.60 & 0.40 \\ 0.70 & 0.30 \end{pmatrix} \]
Do the two matrices tell a similar story?
We can calculate the difference between the observed and model-implied transition probabilities:
\[ \mathbf{D} = \mathbf{\Pi}_{\text{obs}} - \boldsymbol{\Pi}_{\text{model}} \]
\[ \mathbf{D} = \begin{pmatrix} 0.23 & -0.23 \\ -0.37 & 0.36 \end{pmatrix} \]
Each entry represents the discrepancy for a particular transition.
We need to summarise the differences across the entire matrix?
There are several ways to quantify the discrepancy between the observed and model-implied transition probabilities.
Different measures capture different aspects of model misfit.
\[ D_{\text{Manhattan}} = \sum_{i=1}^{K}\sum_{j=1}^{K}|d_{ij}| \]
\[ D_{\text{Frobenius}} = \sqrt{ \sum_{i=1}^{K}\sum_{j=1}^{K}d_{ij}^{2}} \]
Across the simulation study, we examined:
\(Y_{it}\) followed three different model structures
\[ Y_t \sim X_{t1} + X_{t2} + X_{t3} \]
\[ Y_t \sim X_{t1} + X_{t2} + X_{t3} + Y_{t-1} \]
\[ Y_t \sim (X_{t1} + X_{t2} + X_{t3}) \times Y_{t-1} \]
For each fitted model, we
We then examined how well each approach performed across the different simulation conditions.
We also used AIC and BIC as a form of model selection
Our results suggested that:
1. Real-world applications
Applying the goodness-of-fit approaches to empirical data.
2. More complex transition structures
3. More flexible modelling frameworks