Skip to contents

Computes the (analytic) score vector (gradient of the log-likelihood) of the logit-link cumulative (proportional-odds) ordinal regression model documented in full at fast_ordinal_regression_cpp, at arbitrary caller-supplied params (not necessarily the MLE). Exported standalone — independent of any optimizer run — for direct numerical diagnostics (e.g. verifying convergence) at a specific parameter value.

Usage

get_ordinal_regression_score_cpp(X, y, params)

Arguments

X

A numeric matrix of predictors (no intercept column needed; see fast_ordinal_regression_cpp).

y

A numeric vector of ordinal responses; only the rank order of distinct values matters, not their numeric coding.

params

A numeric vector \([\alpha, \beta]\): the category thresholds followed by the regression coefficients, at which to evaluate the score.

Value

The score vector (gradient of the log-likelihood) at params.

See also

get_ordinal_regression_hessian_cpp for the corresponding Hessian at the same point; fast_ordinal_regression_cpp for the full model documentation.