Skip to contents

Computes the (analytic) Hessian matrix 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 at a specific parameter value.

Usage

get_ordinal_regression_hessian_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 Hessian.

Value

The Hessian matrix of the log-likelihood at params.

See also

get_ordinal_regression_score_cpp for the corresponding gradient at the same point; fast_ordinal_regression_cpp for the full model documentation.