Skip to contents

Calculates the matrix of second-derivatives of the marginal likelihood with respect to fixed effects, to see if any linear combinations are not estimable (i.e. cannot be uniquely estimated conditional upon model structure and available data, e.g., resulting in a likelihood ridge and singular, non-invertible Hessian matrix)

Usage

check_estimability(obj, h)

Arguments

obj

A TMB compiled object (class sdreport or ADFun).

h

Optional numeric matrix containing pre-computed Hessian matrix. If missing, the Hessian is computed using optimHess.

Value

A list with components:

Hess

Numeric matrix of the Hessian (second derivatives).

Eigen

Eigen decomposition of the Hessian matrix.

WhichBad

Integer vector of indices for non-estimable parameter combinations (eigenvalues < sqrt(.Machine$double.eps)).

BadParams

Data frame (if non-estimable parameters exist) with columns: Param (parameter names), MLE (maximum likelihood estimates), Param_check (OK or Bad).