I have a time series of an ordinal variable that I wish to model as a first-order Markov chain and estimate the matrix of transition probabilities. (I'm assuming the chain meets all the conditions to have a unique stationary distribution). As my ordinal variable has several categories and I don't have a vast amount of data, I'd like to make use of the ordering of the categories to reduce the number of model parameters by making some modelling assumption, analogous to an ordered logit or ordered probit model. I'd like to do this in R or python.
I've found a paper that proposes a model to do exactly what I want:
Varin, C. & Czado, C. (2010). "A mixed autoregressive probit model for ordinal longitudinal data." Biostatistics, 11, 127-138. doi: 10.1093/biostatistics/kxp042
Varin, C. & Vidoni, P. (2006). "Pairwise likelihood inference for ordinal categorical time series." Computational Statistics & Data Analysis, 51, 2365-2373. doi: 10.1016/j.csda.2006.09.009
The link in the paper to the authors' R code is dead however. It seems quite likely to me that this model or a similar one can be fitted in an R package published in the intervening ten years, maybe mvord
(A flexible framework for fitting multivariate ordinal regression models with composite likelihood methods), or LMest
(Latent Markov models for longitudinal categorical data). These packages are quite sophisticated and this isn't an area of statistics I'm familiar with, so I'm having trouble working out if or how I can do this. I'd be most grateful if anyone can show me a way, in one of these packages or somehow else.
The motivating example used in Varin & Czado's Vidoni's paper is a daily rainfall series for Alofi Island. This is available both as data(rain)
in the markovchain
R package and data(alofi)
in the SMPracticals
package. The three states are 1 (no rain), 2 (up to 5mm rain), 3 (over 5mm). The observed counts of one-step transitions are:
\begin{pmatrix}
362 & 126 & 60 \\
136 & 89 & 68 \\
50 & 78 & 124
\end{pmatrix}
Modelling this as a first-order Markov chain ignoring the ordering of the states requires 6 parameters. More generally, a chain with $K$ states requires $K(K-1)$ parameters. Varin & Czado's Vidoni's model uses only $K$ parameters. I have up to 10 states, and would prefer a model with 10 parameters rather than 90 ! (I'll need to check it's a reasonable fit, of course).