
Changelog
opal 0.1.5
2026/12/03 (#174): The
timing-abbenchmark gates Opakapaka fit counts on eight paired starts per revision (median of the per-start HEAD/BASE ratios), plus where the fits end and whether they converge, instead of on one fit, whose counts change by more than 10% with rounding-level changes such as #172. The fit’s allocation is reported, not gated. Benchmark harness only; the package is unchanged.2026/12/03 (#169):
.github/scripts/setup-r-env.Rnow runs all phases on Windows when called without arguments; it previously exited with status 5 after “Bootstrap locked renv”.2026/12/02 (#172): Length and weight composition likelihoods now tape the catch-at-age × PLA products as atomic RTMB matrix operations, reducing tape size and speeding up derivatives without changing the model. This requires RTMB 2.0 or later.
2026/12/01 (#170): The development and CI environment (
renv.lock) now uses R 4.6.2, with every package updated: RTMB 2.0, TMB 1.9.25, RTMBdist 1.2.1, Matrix 1.7-6 and renv 1.3.1; SparseNUTS stays at its currentmain(2f3f162). xfun (0.57) and DBI (1.3.0) keep their previous versions until the package mirror used by CI serves the current releases. R 4.6.2 fixesnlminb(), and Matrix 1.7-6 removes the need for the Matrix 1.7-1 workaround that R 4.6 required in the environment setup (now removed).Fits made under R < 4.6.2 can take a different optimizer path and, for multimodal models, reach a different end point. Refitted from scratch under R 4.6.2, the Opakapaka quickstart, its golden reference and the assessment example reproduce their objectives (within 2e-9); the IO yellowfin AGE fit reaches a different optimum (B0 12% higher) and AGE-SF a worse one, so
io_yft_age_sf_fit.rdskeeps its stored optimum and the bridge table its values. The pull request lists every stored file with its old and new objective. Benchmark baselines and trajectories were recalibrated on hosted runners.Object checksums are now portable between R versions.
opal_read()and the stored-result checks hash a canonical copy of the object: R 4.5 and earlier serialize an internal flag that R 4.6 drops, so R 4.6 rejected some objects saved under R 4.5 (“Invalid or modified Opal file payload”). Checksums written by earlier opal versions are still accepted where R can recompute them. An object saved under R 4.5 or earlier that carries the flag (for example, one holding a data frame from package data) cannot be verified under R 4.6 and later; read it and save it again withopal_save()under the R version that wrote it. Reading, saving, and updating migrate the object’s identity, the references to it, and the stored payload checksums to portable hashes after verifying them.The package itself still supports
R (>= 3.5); CI now also checks R 4.5 (oldrel).
opal 0.1.4
- 2026/11/30 (#166): Remove the
compResidualdependency fromSuggestsandrenv.lock. The BET development vignette now computes composition residuals withopal_osa(). Development setup no longer grafts OSA headers into TMB or installs packages outside renv. Package code and numerical results are unchanged.
opal 0.1.3
2026/11/03 (#163): Add opt-in performance measurements and separate memory, PR timing A/B, and scheduled instruction-count regression checks. Model numerics are unchanged. Benchmark baselines are regenerated explicitly, never by tests.
2026/11/02 (#155): Reported multinomial
lp_lf/lp_wfand their weighted components now use fractional counts unrounded, matching the fitted objective. Objectives, gradients and estimates are unchanged when composition probabilities are AD-valued, including the bundled fits. If probabilities are entirely fixed during taping, the previously rounded objective constant is now unrounded too; this does not change gradients or estimates. Fixed-effect multinomial OSA residuals still round counts for discrete binomial calculations, with one notice per diagnostic call; RTMB’s latent OSA and simulation methods are retained. The scientific model contract is nowopal_model_contract_v6because reported quantities changed. Fits saved under v5 must be refitted or rebuilt before reading with the new contract; their estimates will not change.
opal 0.1.2
- 2026/10/29: SD of length-at-age can be linear in mean length (SS3
CV_Growth_Pattern = 2).get_sd_at_age()gainssd_model:"cv"(default) is the existing CV-linear form, which is SS3 pattern 0 (the documentation previously called it pattern 2), and"sd"makes SD linear in mean length betweenlog_SD1andlog_SD2, the log SDs at the reference lengths. OptionalA1andA2hold the SD at its end values belowA1and fromA2on, as SS3 does (SS_ALK.tpl).opal_model()reads the optionaldata$growth_sd_model; under"sd"it holds the end values, and"cv"objectives are unchanged.get_parameters()addslog_SD1andlog_SD2(initialized at the SDs implied by the CVs),get_map()fixes them, andget_priors()covers them. For the EPO bigeye SS3 model (GrowthModel 8, pattern 2),"sd"reproduces SS3’sSD_Begwithin 0.3%; the CV form was off by up to 72%. - 2026/10/28 (9f1260c): The pkgdown site renders math with MathJax (
template: math-rendering: mathjax), so\deqn{}and\eqn{}equations in the reference pages display as equations instead of raw LaTeX.get_growth()gains examples that set up each growth configuration (VB, SS3 GrowthModel 3, Richards and growth cessation) from the IO yellowfin inputs. - 2026/10/28 (PR #158): Alternative growth curves.
get_growth()gains agrowth_modelargument:"vonB"(default) is the existing Schnute VB curve,"richards"is the Richards curve (L1,L2,log_k,b) and"cessation"is the growth cessation model (L0,log_rmax,log_k_gc,t50,age_offset). SS3 GrowthModel 3 (age-specific K) remains"vonB"withlog_k_mult. The Richards parameterization and usage guidance follow the Stock Synthesis user manual (section 8.5.2.2.2); the growth cessation model is Eq. 2 of Maunder et al. (2018, Mar Biol 165:76).opal_model()readsdata$growth_modelanddata$growth_age_offset, both optional, so existing objectives are unchanged.get_parameters()addsrichards_b(fixed byget_map()) orlog_L0,log_rmax,log_k_gcandt50_gc(estimated) for the selected curve, andget_priors()andget_bounds()cover the new parameters. Under growth cessation,log_CV1andlog_CV2are the CVs at the predicted lengths atA1andA2.
opal 0.1.1
- 2026/10/27 (PR #152): The three Indian Ocean yellowfin articles are now one, “Indian Ocean yellowfin tuna: Cross model comparison with simulated truth and Stock Synthesis estimation model” (
io-yft-ss3-comparison). It compares the operating model’s truth, the IATTC team’s SS3 model and opal fit AGE-SF: SS3’s age-based selectivity curves and mirrors, plus SS3’s generalised size compositions for the index on their own bins with SS3’s lambda of 0.51 (row-specific composition bin schemes andlflambdas). AGE-SF is built inline from the bundled data. The earlier fits appear in one bridge table under consistent names: SS3-SEL, LEN (formerly C2), AGE (formerly A-SS3), AGE-SF and AGE-SF-NP (AGE-SF with SS3’s lambda of 0 on parameter priors).io_yft_reference$ss3gainssizefreqandlambdas.inst/extdata/now holds onlyio_yft_age_sf_fit.rds, the bridge summaries and the article cache; the stored fits C2, A, A-SS3, S1, S2 and the start-sensitivity runs were removed.data-raw/generate-io-yft-fits.Rrefits every model in the bridge table. The likelihood-lambdas how-to moved to the “Assessment tools” article. - 2026/10/26 (#150, PR #151): SS3-style likelihood lambdas. The optional
data$lambdaslist weights CPUE by index, length and weight compositions by fleet, and the recruitment, initial recruitment, prior and penalty terms; 0 switches a term off, and omitted values default to 1, so existing objectives are unchanged. Reports keep the rawlp_*terms and add weightedlp_*_wterms andlambdas. A prior can carry its ownlambda, per block or per element (seeopal_set_prior_lambda()), andlambdas$prior_mapped_onlydrops priors on elements fixed by the map when the model is built from anopal_obj.opal_update()gains alambdasargument.opal_osa(),opal_mcmc()and fit checks warn about tempered objectives and about parameters a zero lambda leaves without data. With CPUE switched on, non-integer or non-positive CPUE indices are now an error; previously those rows were silently left out of the likelihood. - 2026/10/26 (#147, PR #149): Length and weight composition observations can use row-specific, uneven bin schemes, supplied in long format or as a list of wide tables. Only model predictions are rebinned. Tail accumulation remains the default; truncation is optional. Misaligned length edges require an explicit override because proportional-overlap rebinning assumes uniform density within model bins. Composition residuals retain input ordering, and plots now show bin extents in length or weight units with an optional density scale. Existing grids, tail aggregation, objectives, and fitted-model reports remain compatible; this feature does not change the scientific model version.
- 2026/10/26 (PR #148): Add optional age-based selectivity. The new data element
sel_basis_f(1 = length, 2 = age, one per fishery) evaluates the logistic, double-normal or double Richards curve directly on age, using the samepar_selparameters and map, so age-based selectivity can be estimated and mirrored.get_selectivity()gains anage_aargument.convert_ss3_selex_to_rtmb()andconvert_rtmb_selex_to_ss3()gainbasisandsel_agesarguments to convert SS3age_selexpatterns 12 and 20. Withoutsel_basis_f, every fishery stays length-based and existing models give identical results.sel_fa_externalstill takes precedence. - 2026/10/16 (89d97c0, PR #148): New Indian Ocean yellowfin case study (simulated data, converted from the IATTC team’s Stock Synthesis model): bundled data
io_yft_data,io_yft_parameters,io_yft_mapandio_yft_reference, stored fits ininst/extdata/, and two articles: “Comparing opal with Stock Synthesis” and “Length- or age-based selectivity”, which fits the example with age-based selectivity started from SS3’sage_selexparameters. Both articles read outputs precomputed bydata-raw/generate-io-yft-vignette-cache.R, so they render in seconds. - 2026/10/15 (PR #143): Fix fit validation for random-effect models by calculating the marginal Hessian with
optimHess()instead of calling RTMB’s unsupported exact Hessian. Converged, biologically valid random-effect fits can now pass validation and proceed to grid sampling. Diagnostic version v3 invalidates old checks and grid checkpoints; rerunopal_check()on existing v5 objects. This diagnostic fix does not change model objectives or fitted estimates. - 2026/10/15 (d65126f, PR #143): Quantify the existing seasonal CPUE correction in reproducible paired simulations: maximum prediction changes at fixed parameters are 8.24% and 12.28%, and refitted B0 changes are +4.99% and +11.71%, for the specified two- and four-season examples. These are illustrative, not real-stock impact estimates or general correction factors. Full-coverage examples fail under the legacy indexing but evaluate under v5. The single-season control is unchanged, and all bundled stock inputs use one season. See the seasonal CPUE impact article for observation coverage, diagnostics, and instructions for rebuilding and refitting saved contract-v4-or-earlier assessments.
- 2026/10/13 (e1fbdbd, PR #141): Add optional SS3 GrowthModel 3 cumulative age-specific K multipliers and plus-group length adjustment, credited to Stock Synthesis (Methot and Wetzel 2013). Existing model configurations retain their exact growth calculation and numerical contract.
opal 0.1.0
This release makes the staged opal_obj workflow the primary way to run an assessment, from configuration and fitting through MCMC, diagnostics, projections and saved results. It also adds posterior and fit-checking tools. Scientific contract v5 changes CPUE predictions when n_season > 1, so saved models from earlier contracts must be rebuilt.
2026/09/29 (0ea5022): Add biological fit and posterior checks with versioned validation records, posterior report summaries, OSA residuals and dataset-level SDNR plots, composition and prior–posterior plots, objective profiles, resumable model grids, balanced posterior selection, and deterministic equilibrium MSY summaries. Include a simulated posterior and an assessment-tools tutorial. OSA covers lognormal indices and multinomial, Dirichlet, and Dirichlet–multinomial length and weight compositions, including latent-state integration. Dirichlet–multinomial OSA uses sequential beta-binomial densities; ordinary fitting and simulation retain the existing density implementation. Fix seasonal CPUE indexing, boundary diagnostics, invalid prior handling, and figure units. Scientific contract v5 changes CPUE predictions when
n_season > 1; the single-season Opakapaka reference is numerically unchanged. Earlier saved model contracts require rebuilding under the new contract. Projection behaviour, selectivity time blocks, and close-kin components are outside this change.2026/09/29 (fba96ea): Make assessment objects the primary documentation workflow, add a runnable projection vignette, organise the function reference, and publish a separately labelled development pkgdown site with internal-link checks. Model numerics and function interfaces are unchanged.
2026/09/29 (3475a2e): Expand tests for projection uncertainty, recruitment forecasts, selectivity, parameter diagnostics, and bundled data access. Tighten optimiser stopping tolerances in the Quickstart and projection examples while retaining the existing fit-check thresholds. Package model calculations are unchanged.
2026/09/29 (17ae7a6): Introduce the staged
opal_objworkflow: configuration, two-pass fitting, MCMC, diagnostics, direct plots, projections with source identities, and portableopal_save()/opal_read()persistence. Preserve legacy fit construction and migrate saved fits with objective verification. Configuration changes invalidate dependent results; metadata updates and same-target refits preserve compatible samples. Model numerics and scientific contract v4 are unchanged.
opal 0.0.4
- 2026/09/22 (2ae7722): Use portable integrity in the bundled-fit examples so they run across R versions while retaining strict model compatibility and objective checks. Build the package website on pull requests to
devas well asmain. Model numerics are unchanged. - 2026/09/22 (06f0d7c): Constrain and penalise initial seasonal survival before seasonal compounding when fisheries overlap, and protect equilibrium recruitment from becoming negative under excessive initial fishing. The initialisation penalty is included in the model objective and reported as
lp_init_penalty. Safely positive equilibria are unchanged. Previously saved fits use the earlier scientific model contract; the current contract is v4. - 2026/09/16 (c5dcdf1): Dirichlet-multinomial composition preparation now preserves half-up rounded effective sample sizes with largest-remainder integer counts. Existing saved fits use the previous scientific model contract.
- 2026/09/16 (bac7a99): Fished equilibrium initialization now uses the same seasonal harvest-fraction survival convention as the population dynamics, eliminating drift for partial selectivity.