
Return strongly-correlated parameter pairs
get_cor_pairs.RdComputes the parameter correlation matrix from the (inverse) Hessian and
returns a data.frame of pairs whose absolute correlation exceeds
threshold. Pairs are sorted by descending absolute correlation.
If no pairs meet the criterion the function returns an informative string
instead of a data.frame.
Usage
get_cor_pairs(
obj,
h = NULL,
threshold = 0.9,
include = c("core", "all"),
digits = 3
)Arguments
- obj
An RTMB AD object from
MakeADFunafter optimisation.- h
Optional pre-computed Hessian matrix (square, same dimension as
length(obj$par)). WhenNULL(default) the Hessian is obtained viaobj$he()if available, otherwiseoptimHess.- threshold
Absolute correlation threshold. Only pairs with
|cor| > thresholdare returned. Default0.9.- include
Which parameters to consider:
"core"(default) excludesrdev_yparameters;"all"includes everything inobj$par.- digits
Number of significant digits applied to the correlation column. Default
3. UseNULLto suppress rounding.