Skip to contents

Computes the (analytic) Hessian matrix of the log-likelihood of the stereotype (reduced-rank multinomial) logistic regression model documented in full at fast_stereotype_logit_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_stereotype_logit_hessian_cpp(X, y, params)

Arguments

X

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

y

A numeric vector of categorical (nominal or ordinal) responses; only the set of distinct values matters, not their numeric coding or order.

params

A numeric vector of the full joint parameter vector \([\alpha, \beta, \gamma]\), at which to evaluate the Hessian.

Value

The Hessian matrix of the log-likelihood at params.

See also

get_stereotype_logit_score_cpp for the corresponding gradient at the same point; fast_stereotype_logit_cpp for the full model documentation.