I have ordinal item-response data `y_n` from persons answering test items. Response `n` comes from person `j_n` answering item `i_n`, and item `i` has response categories `0, 1, ..., m_i`. I also observe a matrix `W` of person-level covariates that enters a latent regression for ability.

My model is:
For response `n = 1, ..., N` and category `c = 0, 1, ..., m_{i_n}`,

`Pr(y_n = c) propto exp(sum_{h=1}^c (alpha_{i_n} theta_{j_n} - beta_{i_n h})),`

with the convention that the empty sum for `c = 0` equals 0.

The priors are

`alpha_i ~ LogNormal(1, 1), for i = 1, ..., I,`
`beta_{ih} ~ Normal(0, 3), for h = 1, ..., m_i and i = 1, ..., I,`
`theta_j ~ Normal(w_j^T lambda, 1), for j = 1, ..., J,`
`lambda_k ~ StudentT(3, 0, 1), for k = 1, ..., K,`

with the identifying constraint that the full collection of step parameters satisfies

`sum_i sum_{h=1}^{m_i} beta_{ih} = 0.`

The person-level covariates are adjusted before entering the latent regression. The first covariate is left unchanged. For each remaining covariate `k = 2, ..., K`, let `mu_k` be the sample mean of column `k` of `W`. If that covariate takes only two distinct values, define
`w_{jk} = (W_{jk} - mu_k) / (max(W_{.k}) - min(W_{.k}))`.
Otherwise define
`w_{jk} = (W_{jk} - mu_k) / (2 sd(W_{.k}))`.

Here:
`y_n` is the observed ordinal response for observation n,
`i_n` and `j_n` identify the item and person for response n,
`m_i` is the maximum observed score for item i,
`alpha_i` is the item discrimination parameter,
`beta_{ih}` is the h-th step difficulty parameter for item i,
`theta_j` is the latent ability of person j,
`w_j` is the adjusted covariate vector for person j after the centering-and-scaling rule above,
`lambda` is the coefficient vector in the latent regression for ability,
`W` is the original person-level covariate matrix before centering and scaling,
`I` is the number of items,
`J` is the number of persons,
`N` is the number of observed responses,
`K` is the number of person-level covariates.

Parameterization notes:
In `LogNormal(mu, sigma)`, `mu` and `sigma` are the mean and standard deviation on the log scale.
In `StudentT(nu, mu, sigma)`, `nu` is the degrees of freedom and `sigma` is a scale parameter.
In `Normal(mu, sigma)`, `sigma` is a standard deviation.
