Skip to main content
Dryad

R code from: Diagnosing common sources of lack of fit to composition data in fisheries stock assessment models using One-Step-Ahead (OSA) residuals

Data files

Oct 10, 2025 version files 30.12 KB

Click names to download individual files

Abstract

Fisheries stock assessments often include age- and size-composition data to estimate recruitment strengths, mortality rates and management quantities. Compositions inherently have correlation among the categories, and therefore residuals are not independent. One-Step-Ahead (OSA) residuals have been proposed as a replacement for the commonly used (but incorrectly interpreted) Pearson residuals; however, there is no clear best practice for diagnosing model fit when using OSA residuals. We use a simple example to illustrate common sources of model-misspecification and impacts on statistical and visual diagnostics. We find that visual inspection of model fit aggregated across all observations reliably identifies many types of misspecification, visual inspection of Pearson residuals can reveal further lack of fit, and statistical analysis of OSA residuals provides for objective evaluation of both lack-of-fit and overall data weighting. The power to detect model misspecification depends on the sample size, the number of age bins, and the number of years of data. By illustrating common problems when the correct answer is known, this work provides a guideline for model diagnostics using OSA residuals in more complex settings. This R code will reproduce the simulated data and analysis; each of the figures in the paper are also created.