This function processes the TMB std and reshapes them into a structured tibble for easier analysis and manipulation.
Usage
reshape_tmb_estimates(
obj,
sdreport = NULL,
opt = NULL,
parameter_names,
precomputed_gradient = NULL
)Arguments
- obj
An object returned from
TMB::MakeADFun().- sdreport
An object of the
sdreportclass as returned fromTMB::sdreport().- opt
An object returned from an optimizer, typically from
stats::nlminb(), used to fit a TMB model. If the model is not optimized, opt is an empty list and is not used in the function.- parameter_names
A character vector of parameter names. This is used to identify the parameters in the
stdobject.- precomputed_gradient
A numeric vector of pre-computed gradient values at the MLE, typically from
get_gradient(x). When provided, this avoids a second call toobj[["gr"]](), which would crash afterclear()has freed the C++ memory. IfNULL(default), the gradient is computed directly fromobj[["gr"]](opt[["par"]]).
