Learn R Programming

MSEtool (version 2.0.1)

diagnostic_AM: diagnostic_AM (diagnostic of Assessments in MSE): Did Assess models converge during MSE?

Description

Diagnostic check for convergence of Assess models during MSE. Assess models write output to the DLMenv environment if the MP was created with make_MP with argument diagnostic = TRUE. This function summarizes and plots the diagnostic information.

Usage

diagnostic_AM(MSE, MP = NULL, gradient_threshold = 0.1, figure = TRUE)

Arguments

MSE

An object of class MSE created by runMSE. If no MSE object is available, use argument MP instead.

MP

A character vector of MPs with assessment models.

gradient_threshold

The maximum magnitude (absolute value) desired for the gradient of the likelihood.

figure

Logical, whether a figure will be drawn.

Value

A matrix with diagnostic performance of assessment models in the MSE. If figure = TRUE, a set of figures: traffic light (red/green) plots indicating whether the model converged (defined if a positive-definite Hessian matrix was obtained), the optimizer reached pre-specified iteration limits (as passed to nlminb), and the maximum gradient of the likelihood in each assessment run. Also includes the number of optimization iterations function evaluations reported by nlminb for each application of the assessment model.

See Also

retrospective_AM

Examples

Run this code
# NOT RUN {
DD_MSY <- make_MP(DD_TMB, HCR_MSY, diagnostic = "min")
show(DD_MSY)

##### Ensure that PPD = TRUE in runMSE function
myMSE <- runMSE(DLMtool::testOM, MPs = "DD_MSY", PPD = TRUE)
diagnostic_AM(myMSE)
# }

Run the code above in your browser using DataLab