This is an old version, view current version.

13.9 Ordered logistic generalized linear model (ordinal regression)

13.9.1 Probability mass function

If N,M,KN with N,M>0, K>2, cRK1 such that ck<ck+1 for k{1,,K2}, and xRNM,βRM, then for y{1,,K}N, OrderedLogisticGLM(y | x,β,c)=1iNOrderedLogistic(yi | xiβ,c)=1iN{1logit1(xiβc1)if y=1,logit1(xiβcy1)logit1(xiβcy)if 1<y<K,andlogit1(xiβcK1)0if y=K. The k=K case is written with the redundant subtraction of zero to illustrate the parallelism of the cases; the y=1 and y=K edge cases can be subsumed into the general definition by setting c0= and cK=+ with logit1()=0 and logit1()=1.

13.9.2 Sampling statement

y ~ ordered_logistic_glm(x, beta, c)

Increment target log probability density with ordered_logistic_lupmf(y | x, beta, c).

13.9.3 Stan functions

real ordered_logistic_glm_lpmf(int y | row_vector x, vector beta, vector c)
The log ordered logistic probability mass of y, given linear predictors x * beta, and cutpoints c. The cutpoints c must be ordered.

real ordered_logistic_glm_lupmf(int y | row_vector x, vector beta, vector c)
The log ordered logistic probability mass of y, given linear predictors x * beta, and cutpoints c dropping constant additive terms. The cutpoints c must be ordered.

real ordered_logistic_glm_lpmf(int y | matrix x, vector beta, vector c)
The log ordered logistic probability mass of y, given linear predictors x * beta, and cutpoints c. The cutpoints c must be ordered.

real ordered_logistic_glm_lupmf(int y | matrix x, vector beta, vector c)
The log ordered logistic probability mass of y, given linear predictors x * beta, and cutpoints c dropping constant additive terms. The cutpoints c must be ordered.

real ordered_logistic_glm_lpmf(int[] y | row_vector x, vector beta, vector c)
The log ordered logistic probability mass of y, given linear predictors x * beta, and cutpoints c. The cutpoints c must be ordered.

real ordered_logistic_glm_lupmf(int[] y | row_vector x, vector beta, vector c)
The log ordered logistic probability mass of y, given linear predictors x * beta, and cutpoints c dropping constant additive terms. The cutpoints c must be ordered.

real ordered_logistic_glm_lpmf(int[] y | matrix x, vector beta, vector c)
The log ordered logistic probability mass of y, given linear predictors x * beta, and cutpoints c. The cutpoints c must be ordered.

real ordered_logistic_glm_lupmf(int[] y | matrix x, vector beta, vector c)
The log ordered logistic probability mass of y, given linear predictors x * beta, and cutpoints c dropping constant additive terms. The cutpoints c must be ordered.