design_matrices: Build design matrices for 'mc_multinom'

View source: R/design_matrices.R

design_matricesR Documentation

Build design matrices for mc_multinom

Description

Function that builds the contrast and design matrices required by mc_multinom to parameterize, through multinomial logits, the initial and the transition probabilities of a Markov chain model.

Usage

design_matrices(k, nc, baseline, model_int, model_cov)

Arguments

k

Number of response categories (or observed states) in the Markov chain, coded as 1, ..., k. Note that the structures "dist1", "dist2", "dist3", "two" and "diff" (see model_int) rely on the distance or on the direction between categories, and are therefore meaningful only when the categories are ordered; the remaining structures do not require any ordering

nc

Number of covariates affecting the transition probabilities, excluding the intercept. Set nc = 0 when no transition covariates are included

baseline

Character string specifying the reference category in the multinomial logit parameterization. With "initial", category (1) is the reference category for both initial and transition probabilities. With "central", category (1) remains the reference category for the initial probabilities, whereas the current state is the reference category for each row of the transition matrix

model_int

Character string specifying the constraint structure for the intercepts of the transition logits. Possible values are:

"all"

unconstrained transition-specific intercepts, one for each of the k(k-1) transitions

"const"

one common intercept for all transitions

"dist1"

one parameter for each signed distance v-u between the destination category v and the origin category u (2(k-1) parameters)

"dist2"

one parameter for each absolute distance |v-u|, shared by the two directions (k-1 parameters)

"dist3"

as "dist2", but the parameter enters with a positive sign for upward transitions and with a negative sign for downward ones (k-1 parameters)

"two"

separate parameters for upward and downward transitions

"symm"

one parameter for each pair of categories, shared by the two directions (k(k-1)/2 parameters)

"rsymm"

as "symm", but the parameter enters with opposite signs in the two directions

"diff"

effects expressed as differences between destination- and origin-specific parameters, with the parameter of the first category set to zero (k-1 parameters)

model_cov

Character string specifying the constraint structure for the regression coefficients of the transition covariates. The admissible values and their interpretation are the same as for model_int. This argument is used only when nc > 0

Value

G

Contrast matrix used to parameterize the initial probabilities in the mc_multinom function

Z

Design matrix mapping the reduced parameter vector to the transition-logit parameters under the selected intercept and covariate constraints

GG

Array of contrast matrices used to parameterize the transition probabilities for each origin state

Z1

Design matrix defining the constraint structure for the intercepts of the transition logits

Z2

Design matrix defining the constraint structure for the covariate effects on the transition logits. This component is returned only when nc > 0

Author(s)

Francesco Bartolucci, Silvia Pandolfi, University of Perugia (IT), Luca Brusa and Fulvia Pennoni, University of Milano-Bicocca (IT)

References

Bartolucci, F., Pandolfi, S., and Pennoni, F. (2026). Parsimonious parametrizations of transition matrices of Markov chain and hidden Markov models, Annals of Operations Research, 363, 233–266.


LMest documentation built on Oct. 8, 2026, 5:08 p.m.