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 the possible scores run from 0 to a common maximum score `m`. 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, ..., m`,
`Pr(y_n = c) propto exp(sum_{h=1}^c (alpha_{i_n} theta_{j_n} - beta_{i_n} - kappa_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_i ~ Normal(0, 3), for i = 1, ..., I,`
`kappa_h ~ Normal(0, 3), for h = 1, ..., m,`
`theta_j ~ Normal(w_j^T lambda, 1), for j = 1, ..., J,`
`lambda_k ~ StudentT(3, 0, 1), for k = 1, ..., K,`
with identifying constraints `sum_{i=1}^I beta_i = 0` and `sum_{h=1}^m kappa_h = 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,
`alpha_i` is the item discrimination parameter,
`beta_i` is the item location or difficulty parameter,
`kappa_h` is the common step parameter for moving from category h - 1 to category h,
`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,
`m` is the maximum response category.
