Skip to content

Fit measured latent covariates and density-dependent effects - #24

Open
PaulRegular wants to merge 16 commits into
mainfrom
latent-covariates
Open

PaulRegular wants to merge 16 commits into
mainfrom
latent-covariates

Conversation

@PaulRegular

@PaulRegular PaulRegular commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Model and data

Annual covariates can be estimated jointly with the stock from measurements and their matching _sd column in an existing input table. An IID, random-walk or stationary AR(1) trajectory can supply several formulas. A null model retains the measurements and process density, so marginal AIC compares fits to identical observations.

In a survey catchability formula, density_dependent(N) reproduces q_power(N) using abundance at survey time. In the natural mortality mean, density_dependent(capelin / B) uses the current spring capelin index and January 1 stock biomass, including the plus group.

Assessment comparisons

  • The guide introduces measurement error and missing estimates with temperature, prey and predator examples. A Northern cod example shows how to supply capelin measurements with their standard errors, estimate the underlying series through the 1993–1995 survey gap, and use it in a mortality formula. The Northern cod guide and dashboard compare a null model with a model linking natural mortality to the spring capelin index per tonne of January 1 cod biomass. Both use a reference M of 0.30 per year, AR(1) mortality deviations and the same capelin measurements. The ratio slope was −0.79 (95% interval −1.06 to −0.52). Doubling the index at the same cod biomass multiplied fitted mean M by 0.58. The guide colours the 42 annual age-5+ mortality estimates by year and overlays the fitted ratio relationship in black.
  • Marginal AIC was 1831.81 for the null and 1813.55 for the ratio. Conditional AIC was 1122.14 and 1124.83, respectively. Conditional AIC is approximate for the nonlinear biomass feedback. Both fits have three survey catchability increments at their lower bound.
  • Both models passed all ten one-year hindcasts for 2016–2025, withholding the RV, catch and capelin data. Eight survey years contributed 104 matched age-year observations. The ratio reduced log-RMSE in six years and age-weighted MASE in four. The null and ratio had pooled log-RMSE of 0.695 and 0.641, and MASE of 1.149 and 1.103. Persistence scored 0.643 and 1.000. Both scores favoured the null in 2016 and 2019.
  • In the Gulf of Alaska pollock recipe, jointly fitting the Shelikof AR(1) changed terminal SSB by less than 0.01% relative to treating the measured environment as known.

Review

Guide source · Editable specification figure · Manuscript

The specification figure connects example input tables to covariate_settings. The manuscript describes biomass-dependent mortality and survey-time abundance-dependent catchability in a general density-dependence subsection.

Tests cover the analytic Gaussian marginal likelihood and its gradients, smoothed uncertainty, missing years, sharing across formulas, survey timing, January biomass feedback, plus-group accounting, simulation, projection and information criteria. The dashboard adds measured trajectories, observation residuals and process innovations. plot_covariate() uses the trend plot controls. Covariate measurements and uncapped whiskers share the grey and opacity of RV observations in the dashboard.

Local Windows R CMD check --no-manual completed with status OK. The packaged suite passed 6,065 assertions with zero failures, warnings or skips. The subsequent observation-style change passed 271 focused plot checks. The rendered guide, two-model interactive dashboard and editable manuscript figure were verified. The Word manuscript has 26 editable display equations and both figures were checked in the page proof. The dashboard was exercised in Chrome at desktop, tablet and mobile widths.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T14:59:31.182003Z 118125d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant