Changelog
View source ↗On this page
ALSCL 2.5.3
Fixes found in a full review of the code
- A bundle made by
prepare_alscl_data()can keep infit_argsa setting that only one model takes, such ast0_lowerfor ALSCL orboundsfor ACL. Checking or fitting the other model leaves it out with a message that names it; 2.5.2 stopped with "unknown arguments". run_acl()andrun_alscl()read the text cells "NA" and "", also with spaces around them, as missing values, asprepare_alscl_data()andread_survey_csv()do.- Length labels written as intervals with gaps, such as "10-14" and "15-19", are accepted when
len_midandlen_borderare both given. Input errors name a duplicated length label, a length bin without a label, fewer than two length bins, and time columns that differ only by the leading "X" thatread.csv()adds. check_alscl_data()reports an invalidstart_spreadas an error and returnsvalid = FALSE.summary()lists a parameter that the F structure does not use, such as the correlation between ages withF_structure = "year", with the fixed parameters and marks it "not used with this F structure". Insummary()andplot_self_test(),log_std_log_N0is named "Standard deviation of the deviations of initial log numbers at age" andlog_std_index"Standard deviation of the observation error (log scale)".extract_estimates()andsummarize_simulations()stop with a message that names the model when a requested quantity is not reported, such as CB of an ACL fit.summarize_simulations()returned an empty summary before.- A retrospective analysis in which the full fit and every peel stop with an error now stops and quotes their messages, for example when a
mapfixes recruitment deviations while their standard deviation is estimated. A retrospective in which at least one fit returns is returned as before, with the failures recorded. retro_acl()andretro_alscl()ignore amodelormodel_typethat names their own model and stop when it names the other model.acl_figure_size(width = )keeps the width given and computes the height for it; 2.5.2 limited a given width to 3 to 14 inches.acl_save_plot()takes this height.acl_theme_set()again acceptsfont_family = ""(the default font of the graphics device),compare_legend_pos = "inside"andse_color = NA, as 2.5.1 did.- The messages of a fit write small numbers in the form
6.14 x 10^-6, not in E notation. Printed tables and the numbers of returned objects keep the formatting of R. options(ALSCL.sd_backend = )is accepted in any letter case.- The warning "NaNs produced" of
TMB::sdreport()for a Hessian that is not positive definite no longer reaches the user; the numerical checks report the Hessian as before. sim_model(),sim_acl()andsim_alscl()name a missing replicate file in its error record.- Messages and warnings say "numerical checks", the name used in printed output and in the documentation, where they said "numerical screen", and
sim_data()reports the simulated replicates, not iterations. Scripts that match these messages need the new words.
Help pages and function reference corrected
- The 81 help pages were checked against the code. Among the corrections are the quantities that each model reports in
extract_estimates(), the defaults ofinitialize_params()(those of the flatfish preset), the restriction on the maps of a retrospective analysis, the cases in whichplot_fishing_mortality(se = TRUE)leaves out the plus group and the last time step, the interval of an estimate of zero, the inputs ofplot_ridges()andplot_deviance(), whatreturn_data = TRUEreturns, whatcompare_models()anddiagnose_model()print, andx_breaksexamples that removed every tick of a time axis. - The index of the function reference is grouped by task, as on the website. In each entry the summary line comes first, the English and Chinese text say the same thing, and text copied from other functions is removed. The figure code of
acl_theme()reproduces its figure, the figure code ofacl_theme_set()andacl_palette()draws the palettes, and theacl_save_plot()example writes to a temporary file.
Documentation read again with the writing skill
- The function reference, its notes on the website and the articles use one name for each object (numerical checks, time step, saved fit, length bin, input bundle), state what the functions do directly, leave version history to this changelog, and write numbers as decimals or in the form 3 × 10⁻⁹.
- The help pages were read with the writing skill as well. Each page has a description of what the function is for,
run_alscl(),run_acl(),retro_acl()andretro_alscl()are shorter and link to the articles for the long rules, version history is no longer in the help pages, and the help uses the same names as the documentation. - The installation page says that on R 4.1 the package S7 0.2.2 must be installed before ALSCL, because ggplot2 needs S7 and S7 1.0.0 needs R 4.2. The R 4.1 jobs of CI install that version.
ALSCL 2.5.2
Time axes and letter case
- Time axes always label the first and the last year of the series, in every panel. A regular label that would collide with one of them is left out, and in figures with several panels the labels may be slanted so that a label can stay. On quarterly and other sub-annual axes the labels stay at year starts, and the first and the last year start within the series are labelled.
x_breaksgiven in a call or withacl_theme_set()is used as given. - Letter case does not matter in choice arguments and quantity names:
plot_SSB(fit, type = "sbl"),plot_compare_ts(a, b, quantities = c("ssb", "rec"))andacl_theme_set(style = "Classic")give the same results as the usual spellings, which the functions still return and store. An unknown value stops with a message that lists the accepted values, for exampletype must be one of "SSB", "SBL", "SBA" in any letter case, not "xyz".
Compatibility and installation
- Help-page tests read the source help files when the package is loaded from a checkout and the installed help database when it is loaded from a library. Both routes have regression tests, and CI also runs the affected tests from the source checkout.
- Both R 4.1 checks now install readxl 1.4.5 and run the Excel import tests. The installation and data preparation pages show the compatible version. The RcppEigen namespace import is declared explicitly to avoid an unused-dependency NOTE on older R.
- DESCRIPTION now states the minimum versions that the code needs: ggplot2 4.0.0, patchwork 1.3.2, scales 1.4.0, dplyr 1.1.4, tidyr 1.3.0, ggsci 2.7 and ggridges 0.5.5, and testthat 3.1.8 for the tests. The minimum TMB is 1.9.17 in place of 1.9.21, because no feature that the package uses needs a later version and 1.9.17 is the binary TMB that CRAN keeps for R 4.3 on Windows and macOS. R 4.1 remains the minimum R. The R-CMD-check workflow now also checks R 4.1 with the current versions of the dependencies and R 4.1.0 with their minimum versions.
- The installation page says for each version of R what R installs and whether to answer yes when R offers to install packages from source, and how to install with R 4.1 to 4.2.2 on Windows, where TMB 1.9.22 and later cannot be built.
- When all starts of a fit fail and TMB was built with another Matrix ABI version than that of the installed Matrix package, the error now advises to update both packages with
install.packages(c("Matrix", "TMB"))first, and to reinstall TMB from source only if TMB still warns when it loads.
Printed output
print(fit)is a short overview: the model, the time steps, the F structure, the verdict of the numerical checks with the failed checks named, the objective and the number of estimated parameters.summary(fit)is the detailed view: a table of the checks, then the estimated and the fixed parameters in two tables, named in words, such as "Median recruitment", with the name used in code beside them. The objects thatsummary()and the print methods return are unchanged.diagnose_model()prints its table with the checks as TRUE or FALSE, values to 4 significant digits and a short legend of the fit statistics, and it names the gradient as in its printed lines. Row names of the returned table changed: "Boundary Hit" is now "Parameter boundary hit", "Model Converged" is "Optimizer converged", "Final Outer mgc" is "Maximum absolute gradient", "Positive Definite Hessian" is "Positive-definite Hessian", "Numerical Screen Passed" is "Numerical checks passed", "Natural Scale Boundary" is "Natural-scale boundary", "Covariance Condition" is "Covariance condition number", "Highly Correlated Pairs" is "Highly correlated parameter pairs", "Parameters At Limit In Practice" is "Parameters at their limit in practice" and "Plausibility Notes" is "Plausibility notes". Scripts that read rows by the old names must be updated, andoutput/tables/diagnostics.csv, written byrun_acl()andrun_alscl()withoutput = TRUE, changes the same way. The Value column stays numeric.compare_models()prints the optimizer code and its message in one cell, such as "code 0, relative convergence", keeps its tables within the width of the console and ends with a section "Numerical checks" that gives the verdict for each fit.check_alscl_data()names the first cells that are not numbers, as inNot a number in length bin 10, time step 2002: "abc". Messages and printed text say "time step" where they said "period", as in "No positive observations in time steps: 2004".?ALSCLis a short start page: what the package does, the functions to start with, an example withYTF_exampleand links to the tutorials.
Fixes
acl_theme_set()checks every value before it stores any and rejects invalid values, such as a negative text size orcompare_legend_pos = "middle", with a message that names the setting.extract_estimates()marks every quantity after the last time step with a survey observation as extrapolated, not only F and catch.plot_VB(se = TRUE)gives a warning and draws no band when Linf, k and t0 are all fixed.- The theme setting
legend_position, and"none"to hide the legend, reaches every plot with a legend, among themplot_CatL(),plot_VB(),plot_retro()andplot_survey_catchability(). plot_survey_catchability()names the runs of time steps of each curve from the time steps of the fit.- A global
line_colorno longer recolours the interval bands of the SSB, F, recruitment and catch plots; a globalse_colordoes when it differs from the band color of the palette. compare_facet_ncolandcompare_facet_scalesreach every comparison plot with panels. The heat map ofplot_compare_growth()now followscompare_facet_scales("free_y" by default), where 2.5.1 drew fixed scales, andplot_compare_CatL(facet_scales = )defaults to NULL, which takes the setting.plot_compare_growth(age_range = )restricts the heat map as well as the left panel.x_angleapplies whenx_breaksis given, and a globalx_breaksreaches the length axes ofplot_compare_CatL()andplot_compare_selectivity().plot_residuals(resid_cap = )reports the cap it applies and the length bins it caps.- The legend keys of
plot_CatL(facet_by = "year")have the widths of the thinned lines in the panels. - An unknown entry of a selection such as
yearsormetricsis named in a warning and left out; when nothing valid is left, it is an error. acl_save_plot()has the new argumentunits("in", "cm", "mm" or "px"), as inacl_save_plot(p, "SSB.png", width = 16, units = "cm").run_acl()andrun_alscl()withoutput = TRUE, silent = TRUEsave their figures and tables without printing the numerical checks.simulate_example_data(save_csv = TRUE)writesdata.CatL.csv,data.wgt.csvanddata.mat.csvtooutput_dir, the files thatread_survey_csv(output_dir)reads, with numbers in decimal form.- A transformed scale, such as a log scale, keeps the breaks and labels of its transformation when the package arranges the axes.
- Axis tick labels are plain decimals with thousands separators. An axis with values below 0.0001 or of 1,000,000,000 or more is labelled in powers of ten, such as 1 × 10⁻⁹. No label uses E notation.
exp(mean_log_R)andexp(mean_log_F)are named "Median recruitment" and "Median fishing mortality rate" insummary()andplot_self_test(), because the exponential of the mean of a log process is its median.- The plausibility note on an initial total mortality rate below M now names recruitment that decreased, not increased, before the first time step: numbers at age that decline more slowly than M alone would give mean that the older cohorts were relatively large.
- The help of
self_test()says that the mean parameter of an AR(1) process is close to, not equal to, the weighted mean of the fitted process.
Documentation and repository
- The data preparation page shows the three example tables as scrollable tables read from the CSV files, with decimals, in place of screenshots of a spreadsheet. The example CSV files hold no numbers in E notation, and the example workbook shows its values as decimals; the values are unchanged.
- Numbers that people read are written as decimals or in the form 3 × 10⁻⁹, not in E notation, on the website, in the manuals and in the function reference.
- The worked cases were reviewed against the code and their sources. Among the corrections:
exp(mean_log_F)and theF_meanof the full simulator are medians of the F process, not means; in a fit to survey data the fixed M sets the level of F, not the scale of biomass; and the catchability at length that the whiting case takes from Fraser et al. (2007) is for the third quarter. - Removed: figures that no page used (
man/figures), a stray MIT license file (inst/COPYRIGHTS) that contradicted the GPL-3 license of the package, and the investigation records and tools of 2.2.2 and 2.4.3.
ALSCL 2.5.1
- The default plot style and its palette are now named "default":
acl_theme_set(style = "default")andacl_theme_set(palette = "default"). ALSCL 2.5.0 named them "standard"; that name is still accepted and gives a warning once per session. Figures and all other settings are unchanged.
ALSCL 2.5.0
Default look of the figures
- The default plot style changed, so figures made with the default settings look different from those of 2.4.5. Estimates, standard errors and saved fits are unchanged. Spawning stock biomass, total biomass and abundance are teal lines with a shaded 95% band, fishing mortality is an orange line with a band, total recruitment is drawn as light-blue bars and total catch as dark-blue bars, both with thin dark-grey error bars with a light outline when
se = TRUE, and panels at age or at length are lines in the color of their quantity. Lines are thinner: the defaultline_sizeis 1 andcompare_line_size0.9, in place of 1.5 and 1.2. The y axes of these plots, and ofplot_compare_ts()andplot_compare_F_ts(), start at zero. Titles are black, bold and left aligned, facet labels are bold text without a box, legends are below the plot and, as before, no grid lines are drawn. The other plots draw estimates in dark blue and observations in orange, the two fits of a comparison are dark blue and orange, heat maps run from white to dark blue, and inplot_retro()the full fit is orange and the earlier fits are grey. acl_theme_set(style = "classic")brings back the look of 2.4.5 in one call: the npg palette, lines for every series, the line widths 1.5 and 1.2, centered plain titles, facet labels in grey boxes, y axes that follow the data and the legend position of each plot. It does not bring back the former texts inside the figures, the former number of facet columns or the former tick labels, because the rules for texts, time axes and layout below apply under both styles.acl_theme_set(style = "standard")oracl_theme_reset()returns to the new default.- Each feature of a style is also a setting of its own, so one feature can be changed and the others kept:
acl_theme_set(bars = FALSE)draws total recruitment and total catch as lines,acl_theme_set(y_zero = FALSE)lets the y axes follow the data,acl_theme_set(palette = "npg")brings back the npg colors of lines, observations, comparisons and heat maps,acl_theme_set(title_color = "quantity")gives the titles of the stock size, fishing mortality, recruitment and catch plots the color of their quantity, andacl_theme_set(grid = "y")adds horizontal grid lines. The new settings arestyle,grid,title_face,title_color,show_title,stock_color,F_color,recruitment_color,catch_color,bars,y_zero,strip,legend_position,axis_colorandx_angle.paletteaccepts"standard", the palette of the default style, next to the five ggsci palettes, and a style also setstitle_hjust,line_size,compare_line_size,se_alphaandcompare_se_alpha. The function reference lists the value of every setting under both styles.
Titles, texts and time axes
- Every plot function takes
title:NULLdraws the default title,FALSE(alsoNAor"") draws no title, and a character string is drawn as given. The eight comparison plotsplot_compare_ts(),plot_compare_F(),plot_compare_F_ts(),plot_compare_CatL(),plot_compare_growth(),plot_compare_selectivity(),plot_compare_residuals()andplot_compare_metrics()have this argument now.acl_theme_set(show_title = FALSE)removes the default titles of all plots and keeps the titles given in a call and the titles that name the panels of a multi-panel figure. The titles of the threecheck_fit()panels are now keys oftitles(check_residuals,check_lagandcheck_qq), so they can be changed or removed. - The default texts inside the figures changed: titles, axis titles, facet labels, legends and panel texts use the full names of the quantities, without code names or undefined abbreviations. For example "Estimated spawning stock biomass (SSB) with 95% CI" is now "Spawning stock biomass with 95% confidence intervals", the y axis "Catch numbers" is "Catch in numbers", and the title "{m1} vs {m2}" of
plot_compare_ts()is "Time series of {m1} and {m2}". The panels ofplot_retro()are named "Total biomass", "Recruitment", "Spawning stock biomass (SSB)" and "Total abundance", with the y axis "Estimate" and the text "Mohn's rho = ...";plot_self_test()names the parameters in words, such as "Asymptotic length (Linf)" forlog_Linf; andplot_CatL()has a legend for the observed and fitted series. Texts set withacl_theme_set(titles = , xlab = , ylab = )or with the arguments of a plot are used unchanged. - Time axes follow one rule in all plots. A single panel labels every year up to 12 years, every second year up to 30, every fifth year up to 60 and every tenth year beyond, with unlabelled minor ticks at the other years or time steps. In a figure with several panels the label step follows the width of a panel, and labels that would touch are slanted by 45 degrees instead of being dropped. The new setting
x_angle, also an argument oftheme_acl(), sets the angle:NULLchooses it,0keeps the labels horizontal and thins them, and another number fixes the angle.x_breaksin a call or in the settings still wins.
Layout and saved figures
- The default number of facet columns follows the number of panels, for example 4 panels as 2 x 2, 15 as 5 x 3, 20 as 5 x 4 and 23 as 6 x 4;
facet_ncolandfacet_nrowin a call win. The defaults of the settingcompare_facet_ncoland ofplot_compare_CatL(facet_ncol = )changed from 2 and 4 toNULL, which chooses the columns in the same way; set them to keep the former layout. plot_compare_ts()with five quantities andplot_compare_metrics()put the legend in the empty cell of the grid.plot_SSB_Rec()and the quantile-quantile panel ofcheck_fit()are square. Reference lines at zero and one and lines of equality are thin and drawn under the data. Unlessline_sizeis given, lines are thinner in figures with many panels: full width up to 4 panels, two thirds for 5 to 12 panels and half beyond. Tick labels are thinned by the number of panel rows, drop trailing zeros and do not overlap, text inside the plots is at least 8 pt, also when a smallertext_sizeofplot_VB()orlabel_sizeofplot_compare_metrics()is given, and long legends wrap.plot_compare_metrics()draws horizontal bars and writes the value of each bar beside it without rotating it, with room for these values, andplot_retro()leaves room in each panel for the Mohn's rho text. Plots that draw points keep about a point radius between a point and the panel border on the x axis, and in short facet panels on the y axis too, so that no point is cut by the border, unlessx_expandor the expansion of the plot itself is set. Caps of error bars on points or lines are a quarter of the spacing of the x values and stay short when a plot has a single time step; caps on bars are a third of the bar width. The defaults ofse_widthinplot_deviance()anderrorbar_widthinplot_compare_residuals()changed from 0.5 and 0.3 toNULL, which chooses this width; a value given in the call is used as before. The default size of the growth annotation ofplot_VB(),text_size, is 3.5 in place of 5.- New functions
acl_figure_size()andacl_save_plot().acl_figure_size(plot)returns the recommended width and height in inches for saving a plot, computed from its layout: about 8 x 4.5 inches for a single time series and 10 inches wide for figures with panels;width =fixes the width and returns the matching height.acl_save_plot(plot, filename)saves a plot at that size, on a white background and at 300 dpi by default. The figures written byoutput = TRUEare saved with it at the recommended size of each plot, instead of 12 x 7 inches, and the code in the documentation saves figures at 300 dpi.
Theme helpers and new arguments
- New functions
theme_acl()andacl_palette(), so ALSCL now exports 81 functions.theme_acl()returns the theme layers of the package plots under the current settings (base theme, text sizes, grid lines, title, facet labels and legend position), so thatggplot(...) + theme_acl()gives a figure of your own the look of the package plots.acl_palette()returns the colors of the active palette or of a named one,nof them whennis given, and withrolethe colors that the plots use for stock size, F, recruitment, catch, lines, observations, smoothers and reference lines. plot_recruitment()andplot_catch()have a new argumentgeom:"bar"or"line"for one call, while the defaultNULLfollows the settingbars. Catch at age and at length stay lines. The default ofse_typeinplot_recruitment()is nowNULL, which draws error bars on bars and a ribbon around a line; 2.4.5 drew a ribbon. The default ofpaletteinplot_ridges()is nowNULL, which gives a ramp from light to dark blue under the standard palette and, as before, viridis under any other palette;palette = "viridis"gives the former ramp under either style.
Intervals and messages
extract_estimates()andsummarize_simulations()have a new argumentinterval, and its default is the lognormal intervalexp(log(estimate) -/+ z * SE / estimate), the interval that the plots andself_test()already used. Tables, coverage and figures therefore show the same interval, and the interval of a positive quantity stays above zero. By default theconf_lowandconf_highcolumns ofextract_estimates()and the coverage ofsummarize_simulations()differ from those of 2.4.5;interval = "wald"gives the former boundsestimate -/+ z * SE. An estimate of zero keeps the Wald bounds with the lower bound stopped at zero, and a negative estimate keeps the Wald bounds. Estimates and standard errors are unchanged.self_test()now builds its intervals with the same code; its results for positive estimates are unchanged.- The message of an ALSCL fit about the t0 that a supplied
log_t0means (t0 = t0_lower + exp(log_t0)) is now given only whent0_lowerandlog_t0come from different places: one from the arguments of the call and the other from the input bundle or therecipeof a saved fit.run_alscl(YTF_example, t0_lower = -1)still gives it, because the bundle storeslog_t0 = log(1/60), chosen fort0_lower = 0, which then means a t0 of -0.983 years. A bundle that stores both, such aswhiting_example, and a call that gives both no longer give the message. The message for a positivet0_lowerthat is not below the default t0 is unchanged.
ALSCL 2.4.5
self_test()keeps the estimate of the source fit as the truth of mean_log_F and mean_log_R in conditional mode, as in 2.4.4, and its help and the model validation article now explain why. At the estimate, the mean parameter of an AR(1) process equals a weighted mean of the fitted process in which the first and last time steps weigh more, not its arithmetic mean, and a refit that recovers the process recovers this weighted mean. A development version after 2.4.4 used the source estimate plus the arithmetic mean of the fitted deviations; that truth compared unlike quantities and reversed the sign of the bias. In a self-test with 20 data sets (YTF_example, ALSCL) the median relative error of mean_log_F was -4.2% against that truth, +12.7% against the source estimate and +7.1% when the arithmetic means of the fitted and refitted log F are compared. The level of F and recruitment is measured by the time series.- With
structure = list(initial_deviations = "independent")the recruitment reported for the first time step (Recand its standard error, and soplot_recruitment(),plot_SSB_Rec(),extract_estimates()and the truth ofself_test()) is the number of the first age class in that step, which includes its initial deviation; it omitted that deviation. The estimates and fits with the default form are unchanged. run_acl()andrun_alscl()give a message whensurvey_q_agechanges the default start of mean_log_R by-log(survey_q_age[1]), and say how to supply a start. The message is given once per call and not withsilent = TRUE.compare_models()$growthhas been a table with the columns Model, Parameter, Estimate and Meaning since 2.4.4. Code written for the earlier table, such ascmp$growth$ALSCL, now stops with an error that showssubset(cmp$growth, Model == "ALSCL"), instead of returning NULL. Printing andwrite.csv()are unchanged.plot_VB(fit, se = TRUE)for an ALSCL fit still draws no interval. Its warning now says how to draw the interval of the figure before 2.4.4: scripts that relied on that interval must addparameter_curve = TRUE, which draws the curve computed from Linf, k and t0 with its interval.- References: the help of
self_test()lists all authors of Deroba et al. (2015). The help ofsurvey_catchability()cites Thompson (1994) only for the confounding of a selectivity that declines at older ages with the natural mortality rate, and Cook (2013) for the survey index alone. The help ofwhiting_examplestates thatices$Mandices$maturityequal Tables 22.15 and 22.14 of the WGNSSK 2026 report in every cell. run_alscl()witht0_lowerand no supplied start oflog_t0: the default start is converted so that t0 keeps its default value of 1/60 year, as default correlation starts keep theirs under the symmetric range. It was read ast0_lower + 1/60, so witht0_lower = -1the fit fixed t0 at -0.98 years without a message. Fits that supplylog_t0, and fits with the defaultt0_lower = 0, are unchanged.self_test()divides the error by the absolute value of the truth, so a positive relative error is an overestimate also for a negative truth, such as a negative t0 or correlation. Relative errors of positive truths are unchanged.hindcast_model()accepts negative fitted correlations of recruitment and F, whichstructure = list(correlation_range = "symmetric")allows; such folds were reported as failed predictions.profile_model()drops map entries of an archive saved by 2.4.3 that release a parameter the model does not have, asrefit_model()andsummary()do; every grid fit of such an archive failed.project_model()andsimulate_fit()reject an older fit without stored diagnostics when one of its stored fields shows a failure (a nonzero convergence code, a gradient of 0.001 or more, a Hessian that is not positive definite or a bound reached); such fits were used with status "unknown".allow_failed_fit = TRUEstill allows them.- Whole-number time steps of a quarterly fit are labelled as first quarters ("2004 Q1"), not "Year 2004", in the legend of
plot_retro()(for example withpeel_step = 4when the data end in a first quarter) and in the subtitles ofplot_relative_catch(),plot_VB()andplot_length_at_age(). plot_self_test(): withwhat = "both"the figure title followsfont_family,title_sizeandtitle_hjust, and the new argumentfacet_scales(default"free_y") sets the scales of the time-series panels.- Failure records of batch fits (class
alscl_fit_error) havelogLik(),nobs()andfitted()methods:AIC()andBIC()give NA, so a loop over a batch no longer stops at a failed fit. The plots,extract_estimates(),extract_parameters(),refit_model(),project_model()andsimulate_fit()stop on a failure record with its error message, instead of a message about missing metadata. run_acl(),run_alscl(),retro_model()and the batch functions give a message whenstructure = list(correlation_range = "symmetric")reads a supplied correlation start on the symmetric scale. For example thelogit_log_Rstart ofYTF_example, a correlation of 0.1 under the default range, becomes a fixed correlation of -0.8; the message names the value and says how to keep it. Not withsilent = TRUE.- An ALSCL fit with
t0_lowerdifferent from 0 gives a message when it reads a suppliedlog_t0, with the t0 that the value means. For exampleYTF_examplefixeslog_t0 = log(1/60), which becomes a t0 of -0.983 years witht0_lower = -1. A positivet0_lowerthat is not below the default t0 of 1/60 year also gives a message.run_acl(),run_alscl(),refit_model(),retro_model(),hindcast_model()andfit_scenarios()give a message when aparameterslist in the call leaves out stored parameter values: the list replaces the stored one, and the message names the values that are no longer used and those that the map still fixes at their defaults. For examplerun_alscl(YTF_example, parameters = list(logit_log_R = qlogis(0.2)))fixes Linf at 55, the default, in place of the stored 60. The note on correlation starts under the symmetric range now says to set the value in the parameters list that the fit uses. Not withsilent = TRUE. sim_model()andsim_alscl()taket0_lower, so replicates generated with a negative t0 can be fitted with the true growth.simulate_example_data(seed = )uses the random-number generator ofsim_data(), so a seed gives the same data in any session; with the default generator the data are unchanged. Restoring a session that usesRNGversion("3.5.0")aftersim_data(),simulate_fit()orself_test()no longer repeats R's warning about the "Rounding" sampler.- When every start of a fit fails, the error says whether TMB was built with another Matrix ABI version than that of the installed Matrix package, and gives the remedy,
install.packages("TMB", type = "source"). Such a TMB binary can make every start fail. This applies torun_acl(),run_alscl()and the functions that call them. ALSCL now requires TMB 1.9.21 or later, the oldest version used in its checks; earlier versions were allowed but are not covered by the checks. The installation page and the troubleshooting table describe the warning that TMB gives as it loads. The R-CMD-check workflow also checks the package with the previous R release on Windows, and the installation page says what to do when the available TMB is older than 1.9.21. - A fit whose covariance matrix is not positive definite no longer gives the R warning "NaNs produced" from the calculation of the standard errors. The standard errors are unchanged, with NaN where a variance is negative. The failed numerical checks name the Hessian as before. An example is the fit in the diagnostics article that releases the correlation of F across ages,
cfg$map["logit_log_F_a"] <- list(NULL)followed byrun_acl(x, map = cfg$map). - Documentation: the help pages of
run_acl()andrun_alscl()are regenerated from their source; they still described the first-period recruitment before the change above. The help ofpolish(the second refinement pass),t0_lower,inspect_parameters()andextract_parameters()(the transforms of the symmetric range and oft0_lower) andsimulation_to_tables()(passlen_border = sm$len_borderwhen the length bins have unequal widths) is corrected. The R-CMD-check workflow fails when the help pages differ from the roxygen comments.citation("ALSCL")gives the model paper and the package (newinst/CITATION), and the package description cites the model paper. The README counts seven worked cases. English text uses hyphens for ranges and compounds, andwebsite/check.pyrejects en and em dashes on English pages and verifies the plot-function, worked-case and chapter counts quoted in the READMEs.
ALSCL 2.4.4
- Fixes from a full code review. Default fits keep their estimates; changes that alter results are listed first. Changed results: (1)
sim_model(),sim_acl()andsim_alscl()fit each replicate with the natural mortality rate recorded in its file (the default wasM = 0.2); a suppliedMthat differs is an error unlessallow_M_mismatch = TRUE. (2) Inretro_model(), amean_log_Rfixed throughmapwithout a value uses the full-data value in every peel. (3) Interval plots draw lognormal intervals by default (see below). (4)plot_SSB_Rec()pairs SSB with recruitment at the youngest fitted age, so quarterly fits withrec.age = 0.25use a lag of one quarter, not four, and annual fits with a recruitment age other than 1 use that age. (5)run_acl()uses data-based Linf start and bounds when its defaults do not suit the length bins, and for M above 0.7 its default init_Z start is no longer moved onto the upper bound. - New
structureargument ofrun_acl(),run_alscl()andretro_model()selects optional model structures; the default is the original structure, that of the package as first released.initial_plus_group = "equilibrium"makes the first-period plus group the sum of all older cohorts at init_Z. For ALSCL,initial_length = "growth"builds the first-period lengths at age from the growth transition,growth_increment = "von_bertalanffy"uses the von Bertalanffy increment over the time step, andgrowth_transition = "bin"integrates the transition over the source length bin. Withinitial_length = "growth"andinitial_plus_group = "equilibrium"together, a population with constant recruitment and no fishing stays constant; with the original structure it does not.sim_cal()andsim_data()take the same list asparams$structure. - A map that ties or fixes entries of dev_log_R, dev_log_F or dev_log_N0 is rejected when the matching standard deviation or correlation is estimated, because those estimates were biased (the standard deviation could run to its bound). With these parameters fixed the map is accepted, and the fit lists the arrays in
restricted_random. UseF_structure = "year"for one F deviation per time step. - The ACL defaults for Linf (start 60, bounds 10 to 100) are replaced by data-based values when they do not suit the length bins, for example tuna lengths in cm: the start is 1.1 times the length below which 99 percent of the summed survey index lies, the upper bound is twice the largest bin midpoint, and the lower bound is not raised above the default. Starting values moved into their bounds are reported (a warning for supplied starts, a message for default starts) and listed in
clamped_starts. The default init_Z start no longer sits on its upper bound for large M. - New
start_spreadargument sets the spread of the second and later starts. Fits recordstart_summary; converged starts that differ by more than 2 objective units are added todiagnostics$issues. The help pages explain that a single start can stop at a local optimum that passes every numerical check. Sequential multistart fits reuse one TMB object with identical results. - Fits report the number of zero survey observations treated as missing. Numeric length labels with unequal spacing and no
len_bordergive a warning. Logical survey, weight or maturity columns are rejected.create_parameters()errors name the unknown parameter and its name in the other model.read_survey_excel()stops on Excel error cells (#DIV/0!, #N/A) and names the sheet and cells.len_lowerandlen_upperare deprecated inprepare_alscl_data(),retro_model()and bundles fitted with ACL (they cannot change a fit);run_alscl()still accepts them without a warning. sim_data()andsimulate_example_data(seed = )no longer change the caller's random-number stream. Replicates record their seed, generator settings and package version, and a replicate ID gives the same data under any session generator. Replicate files are written only after every replicate is valid, with integer names (sim_rep100000). A zero AR(1) coefficient no longer warns,initialize_params()$yearsends at the last observation period, and a discontinuous dome selectivity gives a warning.simulate_example_data()reports withmessage().- Results of
sim_model(),sim_acl()andsim_alscl()no longer hold the TMB object (about 0.9 GiB per ALSCL replicate); userefit_model()when one is needed. Newsimulation_to_tables()converts asim_data()replicate to fitting tables.summarize_simulations()also returnssummary_convergedandfailures. Failure records of batch fits have classalscl_fit_errorwith print, summary, coef and vcov methods. print(),summary(),extract_parameters()andrefit_model()work again on assessments saved by 2.4.3. A fit has one numerical-screen verdict in all summaries.save_assessment(x = )keeps the observations and time metadata of an older fit; archives use RDS version 3.vcov()returns NULL when the covariance is not finite or not positive definite. Newfitted(),logLik()(soAIC()andBIC()) andnobs()methods.extract_estimates()has a new last columnextrapolatedfor terminal-period F and catch, which no observation informs.retro_model(): newpeel_step(for example 4 for annual peels of a quarterly model); per-fit warnings infit_diagnostics$warnings;retro_acl(x, 3)is accepted; the full fit runs in the same batch as the peels; delta-method standard errors that the retrospective does not use are skipped (also inhindcast_model()withoutsave_fits).plot_retro()draws fits that failed the numerical screen with dashed lines, keeps fits without estimates in the legend, keeps colours with the peel and labels quarterly peels as "2001 Q4".compare_models()recordsdelta_aic,aic_thresholdandreason, and reports a failed fit as such. A bundle whosefit_confighas an entry for one model can be fitted with the other; misplaced top-level fitting arguments give a warning.check_fit()describes the QQ reference correctly: standardized conditional residuals have a standard deviation below 1 under a correct model.- Plots: intervals of abundance, biomass, SSB, recruitment, catch and fishing mortality are lognormal by default,
exp(log(estimate) +/- 1.96 * SE / estimate), and cannot fall below zero; useinterval = "wald"oracl_theme_set(interval = "wald")for the previous interval. Age panels and axes show fitted ages and mark the plus group ("Age 15+").plot_compare_F_ts()gainsbasis = "age"for a common age basis. A globalx_breaksapplies only to axes it lies on. Faceted survey plots no longer overprint year labels. Error bars are opaque by default.plot_ridges()has one figure title and quarter labels. Shared F is drawn as one panel. Labels state the time basis of F and spell out SSB.acl_theme_set()rejects unsupported settings. - Speed and infrastructure: the compile cache key includes the platform and C++ settings and builds are installed atomically (existing persistent caches are rebuilt once).
sd_cores = "auto"respectsSLURM_CPUS_PER_TASKandoptions(mc.cores)and avoids forking with a threaded BLAS. Sequential batch fits use the session'ssd_cores. A malformed speed option stops the fit with a message that names it. Diagnostics report unfinished refinement and standard deviations close to zero. Socket workers stop when they load a different TMB version. Internal optionsALSCL.se_levelandALSCL.delta_methodare available. - The development version is 2.4.3.9000.
reshape2andcowplotare no longer required. The built package no longer contains unused figures. Documentation states that outputs are on the scale of the survey index unless the index is absolute, corrects thegrowth_stepdefault and the description of process maps, and maintainer scripts check that the loaded package has the code of the checkout. - Tests compare the joint likelihood, the growth transition matrix, the population dynamics and Mohn's rho with independent R implementations, check that the operating models reproduce the templates, and fit
YTF_exampleto check recovery of the simulated truth. structurehas a fifth setting,correlation_range, for ACL and ALSCL."positive"(default) keeps the AR(1) correlations of recruitment and F between 0 and 1, the logistic transform of thelogit_*parameters."symmetric"lets them lie between -1 and 1 (2 * logistic - 1), so a correlation of zero is no longer a boundary in the numerical checks and a negative correlation can be estimated. Under"symmetric"a correlation rho isqlogis((rho + 1) / 2)on the optimizer scale; default starts keep their natural value, andinspect_parameters(),extract_parameters(),profile_model()andsimulate_fit()use the same transform. Use it when recruitment has no or negative autocorrelation: with the default range such a fit runs to the lower boundary and fails the numerical checks.structureaccepts the name of a set:"original"or"von_bertalanffy"."original"is the default structure: the structure of the package as first released, which implements the model of Zhang and Cadigan (2022). Two details of its growth increment are in the code and not in the paper: the lengths at which the logistic increment is 50% and 95% of its maximum (0.5 Linf and 0.05 Linf) and the multiplication of the increment by the time step."von_bertalanffy"selectsgrowth_increment = "von_bertalanffy",growth_transition = "bin",initial_length = "growth"andinitial_plus_group = "equilibrium"together (for ACL, the plus-group setting). A list can name a set and add settings, for examplelist(set = "von_bertalanffy", correlation_range = "symmetric")."published"and"consistent"are accepted as the earlier names of"original"and"von_bertalanffy". Use the four settings together: in simulation tests with quarterly time steps and 5 cm length bins, fits with only some of them failed the numerical checks or were strongly biased."von_bertalanffy"is also a value of the single settinggrowth_increment.structure = list(growth_increment = "von_bertalanffy")changes one setting, andstructure = "von_bertalanffy"changes all four. An ALSCL fit whosestructurelist changes one, two or three of the four settings gives a message that names the settings left at their original values (not withsilent = TRUE;fit_scenarios(),hindcast_model()andretro_model()give it once per call). A list that names the set and replaces one of its settings, for examplelist(set = "von_bertalanffy", growth_transition = "midpoint"), gives no message.run_alscl()storesgrowth_check. When growth undergrowth_transition = "midpoint"stops below 90% of the estimated Linf, that is, when fish stay in a length bin with a probability of at least 0.99 per time step, the fit reports it in a message andsummary()prints it. A fit that would fail the gradient check (largest component 0.001 or more) gets a second pass of refinement steps. This pass accepts a step that lowers the gradient when the objective rises by no more than its working precision, which matters when the likelihood is very sharp in one parameter, such as Linf under the von Bertalanffy increment. Fits that pass the gradient check after the first pass are unchanged.- New argument
t0_lower(default 0) ofrun_alscl()andretro_model(). ALSCL uses t0 = t0_lower + exp(log_t0), so a negative t0 can be fixed or estimated, for example witht0_lower = -1andparameters = list(log_t0 = log(t0 + 1)). Reported t0 values are on the natural scale. In an input bundle, store it underfit_config$alscl. - ALSCL F at age is shown for every age, including the plus group, and for every period: by
extract_estimates(fit, "FA"), byplot_fishing_mortality(type = "age")without intervals and byplot_compare_F_ts(basis = "age"). The fitted report (fit$report$FA) is unchanged and holds the ages before the plus group and the periods before the last, with standard errors; the other cells are computed from the reported numbers at length and age by the same formula and have no standard errors, so plots with intervals keep the reported cells.extract_estimates()marks the terminal-period rows of FA asextrapolated. When the last periods have no positive survey observation, it also marks F and catch from the last period with an observation onwards. extract_estimates()acceptsN_at_ageas an alias ofNA(numbers at age), because a table labelled "NA" loses the label when it is written to a CSV file and read back with the defaults ofread.csv().- New argument
random_numbersofinitialize_params(). With"by_process",sim_data()draws recruitment, F, initial numbers and survey errors from separate streams with a fixed number of draws each, so scenarios that differ in one process share the random numbers of the others."sequential"(default) draws as before. The two settings give different data for the same replicate ID, and each replicate records the setting inprovenance$random_numbers. - Changed results:
YTF_example$fit_configfixes the standard deviation of log F at the marginal SD of the generating AR(1) process, F_sd / sqrt(1 - F_ar^2) = 0.302, for both models; it was the innovation SD 0.2. The data tables are unchanged. Fits ofYTF_examplewith its stored configuration change: the ACL and ALSCL objectives are -335.14 and -28.59 (were -335.69 and 22.29) and the AIC difference is 613.09 (was 715.96). The tables and figures of the documentation were regenerated, and the articles quote the new values. plot_retro()labels quarterly terminal periods ("2004 Q4") also whenpeel_stepis above 1. The lower bound of a lognormal interval never falls below zero for a nonnegative estimate.plot_compare_F_ts(basis = "age")stops when the two fits have different time steps.plot_pla()labels the axis "Age group" for a result without age metadata.sim_model(),sim_acl()andsim_alscl()read replicate files written under their earlier names (sim_rep1e+05).profile_model()reports the same numerical verdict assummary()for older fits. Help pages of the exported functions have examples that run in the package checks.- Natural mortality and survey catchability accept more forms in
run_acl(),run_alscl(),retro_model(),hindcast_model(),fit_scenarios(),refit_model()and input bundles. Fits that do not use them are unchanged.Mcan be a single number, a matrix with one row per age class and one column per time step (or one column used for every time step), or, for ALSCL, a numeric vector with one value per length bin. Thedimattribute tells the last two apart: M by age that is constant over time ismatrix(M_at_age, ncol = 1). With M by age or by length in ALSCL, F at age is total mortality at age minus the mean of M weighted by numbers at length,ZLis F at length plus the mean of M weighted by numbers at age, and the report holds the rates asM_LAY. Newlorenzen_M()returns M by length asM_ref * (length / L_ref)^exponentwith a default exponent of -1 (Lorenzen 2022; Lorenzen et al. 2022). New argumentsurvey_qsupplies survey catchability directly, as a vector by length or a matrix by length and time step (for example after a change of survey gear), in place ofsel_L50andsel_L95, which now default toNULL; supplying both is an error. Newsurvey_catchability()computes logistic and dome-shaped curves forsurvey_q. New argumentsurvey_q_ageis a survey catchability multiplier by age; when it is supplied, the default start ofmean_log_Ris raised by-log(survey_q_age[1]).project_model()accepts future M by age and requires it when the fitted M varies over time.summary()andprint()name the non-default input forms.plot_compare_selectivity()draws the supplied catchability. Simulation functions keep a single M and say so in their error. M,survey_qandsurvey_q_ageare assumptions: the survey index does not inform the split of total mortality into fishing and natural mortality, nor the level or the descending part of survey catchability. - Fit diagnostics. The numerical screen now fails a fit in which a parameter is at its limit in practice although it has not reached an optimizer bound:
log_t0below -10 (ALSCL; t0 equalst0_lower), the logarithm of a standard deviation below -9 (a variance of zero), or a logit correlation with an absolute value above 15. Such fits passed the screen before, so their verdict changes; fits saved by earlier versions keep their stored verdict.diagnostics$limit_parameterslists these parameters with their values on the natural scale, anddiagnostics$advicesays what to do (fix the parameter withmapat a chosen value and refit; for a correlation at zero, usestructure = list(correlation_range = "symmetric")).diagnostics$plausibilitylists notes that do not change the verdict: the mean length of recruits lies more than two length-bin widths below the lower border of the second length bin; the estimated standard deviation of the observation error on the log scale is above 0.9; an estimated cv_len or cv_grow is above 0.3; the estimated initial total mortality rate is below the smallest natural mortality rate. The thresholds are indiagnostics$check_thresholds. The messages of a fit,summary()andprint()show the advice and the notes.diagnose_model()reports their numbers, andsummarize_simulations()has the failure reason "parameter at its limit in practice". - A fit with one start (
nstarts = 1, the default) gives a message, unlesssilent = TRUE, that a single start can stop at a local optimum and that at least three starts with a widerstart_spreadare recommended for results that will be reported. Functions that run several fits give the message once per call. The default number of starts is unchanged. run_acl(),create_parameters()andretro_model()have the new argumentbounds = c("default", "wide")."wide"gives ACL the bounds of ALSCL for the initial total mortality rate (upper bound 10 instead of 1), the mean fishing mortality rate (2 instead of 1), the standard deviations of the initial numbers at age and of recruitment (10 instead of 1) and the von Bertalanffy growth rate k (0.05 to 2 instead of 0.1 to 1 per year). The default bounds are unchanged. An ACL fit that stops at one of the default upper bounds is told about this argument, and a fit in which t0 stops at its upper bound is told what the bound means.- New outputs for comparing a fit with age readings and with external assessments, all computed from a fitted or saved result.
length_at_age()returns the mean and standard deviation of length for each age class and time step, in the population and as the survey sees it (numbers at length multiplied by survey catchability at length). Use it to compare growth: in ALSCL, Linf, k and t0 set the growth increment at length and the length of recruits and are not the parameters of a von Bertalanffy curve of mean length at age.ssb_at_age()returns spawning stock biomass from a maturity ogive by age (vector, or matrix by age and time step) and biomass at age, next to the model SSB from maturity at length; mean weight at age can be supplied.relative_catch()returns catch in numbers and in weight divided by its mean over the time steps; a fit to survey data alone has no information on the absolute level of catch or F, which depend on the assumed natural mortality rate and survey catchability, so only the trend should be compared with reported catch. Changed output ofcompare_models():growthlists the parameters in a separate block of rows for each model with their meaning (columns Model, Parameter, Estimate, Meaning) instead of one column per model; the new elementlength_at_ageholds mean length at age of both fits; the catch rows ofcorrelationare labelled "CN (relative)" and "CB (relative)" and have noRatio_Mean; catch in weight of an ACL fit is now included. - Documentation: the model principles article has the new section "Differences between the package and the paper". It covers the marginal standard deviations of the F and recruitment processes (Equation 7 of Zhang and Cadigan 2022 uses the innovation variance), the standard deviation of the F process that is fixed by default, the two lengths of the logistic growth increment, the multiplication of the increment by the time step, and the deviations of the initial numbers at age that accumulate over ages. The articles, the function reference and the manuals describe the inputs, checks and outputs of the five entries above, and state that the level of F from a fit to survey data depends on the assumed natural mortality rate and survey catchability.
- New data set
whiting_example: the survey index by length and year of North Sea whiting from the quarter 1 hauls of the North Sea International Bottom Trawl Survey, 1983 to 2026 (18 length bins of 2 cm, 44 years), with weight and maturity at length, the settings of a fit of ACL and ALSCL, and three tables for checks that do not enter a fit: mean length and index at age from age readings, the natural mortality rate and maturity at age of the ICES assessment, and the results of that assessment. The data are derived from the ICES Database of Trawl Surveys (DATRAS), the ICES Stock Assessment Database and ICES (2026) under CC BY 4.0;?whiting_examplegives the citations. New case study "What can a fit to a real survey be used for?" fits both models to these data with several starts, follows the advice of the numerical checks, compares the fits with the age readings and the assessment, and refits with natural mortality by age and year and with a survey catchability that declines with length. - Plots of mean length at age, relative catch and the fixed inputs of a fit. Estimates are unchanged. Changed default figures: for an ALSCL fit,
plot_VB()now shows mean length at age calculated from the fitted numbers by length bin and age class (length_at_age(), population basis, mean over the time steps) and has no annotation of Linf and k. It showed the curve computed from Linf, k and t0, which in ALSCL set the growth increment at length and the mean length of recruits and are not the parameters of a von Bertalanffy curve of mean length at age.parameter_curve = TRUEadds that curve as a dashed reference line, named in the legend and explained in the caption, with its annotation and, withse = TRUE, its interval;se = TRUEwithout it gives a warning and the estimate only, because the model reports no standard error for mean length at age from the fitted numbers; scripts that relied on the interval of the earlier figure must addparameter_curve = TRUE. The figure of an ACL fit, the von Bertalanffy curve, is unchanged. The left panel ofplot_compare_growth()now compares mean length at age of the two fits on one basis (ACL from its age-length key, ALSCL from its fitted numbers), and its subtitle states the basis and the time steps and no longer lists Linf and k of the two models. It drew one curve from the growth parameters of each model. The right panel shows, for an ALSCL fit, the proportion of each age class in each length bin from the fitted numbers. In both functionsage_rangenow selects age classes for these values and may start before t0, and a result without ages, time steps, length-bin midpoints or, for ALSCL, numbers by length and age gives an error. Both functions have the new argumentsobserved(mean length at age from age readings, drawn as points with an optional standard deviation or interval),basis("population", or"survey"for a comparison with age readings of fish caught in the survey) andyears. New functions:plot_length_at_age()draws mean length at age by time step, with optional age readings by time step;plot_relative_catch()draws the model catch in numbers or in weight divided by its mean, with an optional reported catch series divided by its mean over the same time steps;plot_natural_mortality()andplot_survey_catchability()draw the natural mortality rate and the survey catchability that a fit used. The new argumentsmaturity_at_ageandweight_at_ageofplot_SSB()add the SSB from a maturity ogive by age (ssb_at_age()); without them the figure is unchanged. The theme has title and label keys for the new figures, and the default title ofplot_compare_growth()is "Mean length at age". - New setting
initial_deviationsof thestructureargument ofrun_acl()andrun_alscl(), for ACL and ALSCL."cumulative"(default) keeps the deviations of the initial numbers at age accumulated over age classes, as before."independent"gives every age class, the first included, its own deviation, as in Equation 11 of Zhang and Cadigan (2022);dev_log_N0then hasnageentries, and the setting is stored in thestructureelement of the fit. The setting is not part of the set"von_bertalanffy"and combines withinitial_plus_groupandinitial_length.sim_data()generates either form whenpa$structuresets it,simulate_fit()draws new deviations in the form of the fit, andsim_model()andsim_acl()have a new argumentstructure. Default fits and simulated data are unchanged. In a simulation test ("flatfish"preset without burn-in, standard deviation of the initial deviations 0.4, 20 data sets per form) the form of the estimation model changed the errors of SSB, recruitment and F little, the standard deviation was estimated at zero in 40% to 55% of the fits with the cumulative form and in 25% to 30% with the independent form, and the objective did not identify the generating form. The section "Differences between the package and the paper" of the model principles article gives these results and refits of Norway pout, dab and whiting. - New function
self_test()checks whether a fitted model can estimate its parameters from data like the observed ones. It simulates data sets from the fit withsimulate_fit(), either keeping the fitted population (process = "conditional") or drawing new recruitment, F and initial deviations from their estimated distribution ("resample"), refits the same model with the settings of the fit to each data set on parallel workers, starting from the starting values of the fit (default) or from its estimates (start = "estimates"), and compares the estimates with the values used to simulate them. It returns, for each refit, the numerical checks and the relative errors of SSB, recruitment, F and the estimated parameters, and over the refits the median relative error, the median absolute relative error, the share of refits that pass the numerical checks and the coverage of the approximate 95% intervals.print()andsummary()show these summaries, andplot_self_test()draws the relative errors by year with a percentile band. A self-test does not test the assumed natural mortality rate, survey catchability or growth form. The model validation article has a new section with an example. Fits and estimates are unchanged. - Draw single estimates as points with error bars when intervals are requested. Keep the full length range in ridge panels and the full time range in mean-residual comparisons when boundary observations are missing. Validate ridge-height multipliers; add rendering regression tests and bilingual examples without gridlines.
- Keep gaps in mean-residual comparison lines and observed ridge polygons, show isolated observations, and align ridge panels and time colors. Support Brewer palettes for two-period results; add rendering regression tests and refresh affected figures without gridlines.
- Use the checked parallel Hessian during optimizer refinement where forked processes are selected, with sequential fallback and per-step method records. Simulate fitted processes without constructing unused derivative tapes; fitting interfaces and model equations are unchanged.
- Revised some wording to make the documentation more precise.
- Compare positive survey observations cell by cell before reporting fit metrics or choosing a model by AIC. Protect archives from overlapping writes to the same path.
- Check every map name, including named NULL releases, and normalize unused factor levels before fitting. Preflight and fitting now validate the same optimizer controls.
- Preserve small positive probabilities in the simulated age-length key and growth transitions. In age-based simulations, average dome-shaped fishery selectivity over length at each age.
- Show isolated survey observations and residuals as points and keep gaps in observed lines and trends. Preserve scientific-notation length labels and use the fitted ages on ACL fishing mortality heatmaps.
- Preserve an actually converged optimization pass when a numerically equivalent restart reports false convergence; retain all original pass records and still select materially lower objectives.
- Retain optimizer messages, selected passes and refinement evidence in retrospective diagnostics; missing legacy records remain missing.
- Preserve native numeric precision when survey, weight or maturity tables mix numeric, text and factor columns; use the same conversion in diagnostics and reject complex cells.
- Require one-dimensional real numeric time coordinates and quantity vectors in simulation summaries; reject matrices and arrays before they can be recycled into misleading statistics.
- Validate retrospective plot/silent flags before fitting. Reject plots without any finite time/estimate pair while retaining gaps in partially observed series.
ALSCL 2.4.3
- Check that simulation biology matches the supplied parameters and arrays before drawing data or writing files. Reject inconsistent saved survey catchability before fitting; matching legacy simulation objects remain supported.
- Correct the worked simulation cases to use the marginal F standard deviation implied by the operating model's innovation SD and temporal correlation. Regenerate the data, fitted results and figures, and explain the remaining differences between generating and fitted process assumptions.
- Make the growth comparison reference example self-contained, with its reference data defined in the example. Execute the English and Chinese website examples in isolated environments.
- Preserve the
alscl_fitclass when the own-data example saves results without the live TMB object, sosummary()retains its diagnostic output after reading the file. - Apply the global comparison legend position to F heatmaps and growth probability panels, and the global point size to lag and QQ diagnostics. Refresh affected figures without gridlines.
- Clarify that process resampling recomputes survey predictions from the new population states, and that shared F is one time series across groups. Add regression checks and execute the complete fitting and validation examples.
ALSCL 2.4.2
- Allow
plot_compare_selectivity()to use saved assessments without refitting, recovering fixed survey catchability from the retained input recipe. - Restore nullable theme settings, including automatic axis breaks and survey labels, when a saved
acl_theme()snapshot is applied. Retrospective rho and comparison metric labels inherit the chosen font. - Use fitted ages for comparative growth plots and reject explicit ranges before either model's
t0, preventing negative-length extrapolation. Existing valid explicit ranges remain supported. - Accept replicate ID 0 consistently in simulation generation and fitting; require distinct nonnegative integer IDs.
- Execute the current plotting tutorial blocks and check the
facet_byexamples, with grid-free checks included in the automated workflow. - Preserve every executable line when merging bilingual code examples with different comment or blank-line counts; add generator regression checks.
ALSCL 2.4.1
- The README now provides an English entry page and a separate Simplified Chinese version, with installation, examples and links to the task guides.
- Preserve effective fixed scalar values in each
simulate_fit()input bundle, including a data-derivedmean_log_Rthat was fixed without an explicit value. Refit the simulated data under the same fixed assumptions while retaining the original starting-value strategy for free parameters. - Record
dev_log_N0in new ALSCL reports so conditional simulations retain all three process-deviation arrays, including after saving and reading an assessment. Older saved reports with missing deviations remain readable. - Complete
point_sizesupport in comparison plots. Unset point sizes inherit the global value (2.5); explicit legacyobs_sizeandcompare_point_sizesettings remain supported, and a per-callpoint_sizetakes priority. Refresh affected figures without gridlines. - Preserve positional
base_themecalls toplot_fishing_mortality()by appending new typography arguments after the existing arguments. - Stop the own-data example before fitting when ALSCL is older than 2.4.0. Align the declared minimum R version and installation instructions at R 4.1.
- Explain that process deviations are estimated by default but may be fixed or tied through
map; document the restrictions for process resampling and hindcast validation. - Separate data loading from source-model fitting in the validation tutorial, so the hindcast-only route needs
xand no full-data fit. Add regression checks for the tutorial route and early version gate.
ALSCL 2.4.0
- Plot functions share one set of argument names:
facet_ncol,facet_nrowandfacet_scalesfor the facet layout,line_sizefor the line width (the theme keycompare_linewidthis nowcompare_line_size),point_size = NULLinheriting the new theme keypoint_size(2.5), andse = FALSEas the default everywhere, includingplot_deviance().plot_CatL()andplot_residuals()choose their layout withfacet_by("length" or "year") instead oftype. The former names still work and warn once per session. - The population plots
plot_SSB(),plot_biomass(),plot_abundance(),plot_catch()andplot_deviance()take the sametitle,xlab,ylaband typography arguments as the other single-model plots, andplot_fishing_mortality()gains the five typography arguments it lacked. A value given in the call replaces the theme setting. plot_compare_annual_F()is renamedplot_compare_F_ts(): it summarizes F per model time step and never annualized quarterly values.- Plot titles use sentence case. The title keys
CatL_by_lengthandCatL_by_yearreplaceCatL_yearandCatL_year_dist;compare_F_tsreplacescompare_annualF;plot_retro()uses theretrokey;plot_pla()uses the newylab$length. Time-step panels are labelled "Year 2000" in every plot, or "2000 Q2" for quarterly fits, and age panels "Age bin". - The tutorials are rewritten as task pages: each page states its goal, then numbered steps with the code to run, why, what to expect and what to do when it fails, and a closing table of next steps. Version history stays on this page.
- Example figures: every plotting function's reference page, and the reference entries of
check_fit(),fit_scenarios(),profile_model(),project_model(),hindcast_model(),simulate_fit(),sim_data()and the retrospective functions, show the figure their example produces.acl_theme_set()shows the five palettes with the role of each colour (docs/figures/palettes/, drawn byscripts/palette_swatches.R), and the colours page shows the same plot under every palette. - Plot labels name each quantity the same way everywhere: "Spawning biomass (SSB)", "Catch numbers (CN)", "Abundance";
plot_recruitment()labels its axis "Recruitment". The gallery figures are regenerated with these labels and every figure description says what the figure shows, when to use it and what a pattern means. - The bilingual manuals, the book and the Wiki are generated from the article pairs with
scripts/build_manual.py, so each tutorial is written once per language.
ALSCL 2.3.0
- Release the nineteen assessment-workflow functions added since 2.2.9 (data preparation and checks, result extraction and archives, sensitivity scenarios, profiles, projections, fitted-model simulation and hindcast validation): 64 exported functions.
run_alscl()andretro_alscl()infergrowth_steplikerun_acl(): NULL uses rec.age when it is below one, otherwise one. Passgrowth_step = 1explicitly for annual ALSCL data with rec.age below one.fit_scenarios()defaults tomodel = "acl"and uses one start per scenario unless the bundle or the call setsnstarts, the rule ofhindcast_model()andretro_model().retro_model()acceptsmodelas well asmodel_type.- Simulated bundles from
simulate_fit()no longer carry the source fit'soutput,ncoresandsilentsettings. - Every worker count respects the two-process limit of
R CMD check. -
The example script uses the exported
read_survey_csv(),prepare_alscl_data()andcheck_alscl_data(); the legacy helper script calls the exported readers. The gallery lists 44 figures; stale statements in the speed documents, guide values, the function reference and four website pages are corrected. -
Add
simulate_fit()for observations conditional on fitted states or resampled stationary processes, andhindcast_model()for expanding-window survey prediction checks with paired persistence baselines. Retain truth, failure diagnostics, actual scoring denominators and grid-free worked figures. -
Guard projections against known failed fits; add
nstartsto simulation batches; record available source revisions, core/R hashes and runtime metadata in assessment recipes, with change warnings during refitting. -
Align model names and descriptions with the implemented population, observation and growth processes. Clarify survey catchability, simulation F baselines and innovation standard deviations, natural parameter scales and nominal confidence levels without changing existing argument names or calculations.
-
Correct residual facet documentation, document the shared ACL/ALSCL simulation entry points, complete Chinese return-value descriptions, remove escaped paragraph artifacts and organize current tutorials by task. Probability-matrix and survey-catchability plot titles use the same terminology as the manuals.
-
Add public CSV/Excel preparation and compilation-free data/parameter checks, using the same effective starts, bounds and maps as fitting; preserve original numeric precision and validate scalar logical controls consistently.
- Add fitted-result summaries and extraction, portable assessment archives and recipe-based refitting; retain legacy list access and fitting syntax.
- Add standardized conditional residual tables and grid-free heatmap, actual-time lag and QQ diagnostics, without claiming calibrated tests.
- Add named sensitivity batches and free-scalar parameter profiles with per-fit numerical status, warnings and errors; parallelize independent fits without nested workers.
- Add deterministic ACL/ALSCL projections with explicit future F, recruitment and biology, correct terminal-mortality timing and no implied uncertainty, MSY or TAC calculation.
-
Add shared ACL/ALSCL simulation fitting and bias/RMSE/coverage summaries with aligned truth, failure rates and explicit denominators. Document all six workflows in English, Simplified Chinese, the website and Wiki chapter 16, with six new grid-free figures.
-
Growth plots default to fitted ages and reject explicit pre-t0 ranges, preventing negative-length extrapolations and reversed intervals. Parameter annotations, fonts and growth-axis labels are consistent with and without intervals.
- Fishing-mortality plots inherit global titles, axis labels, breaks and expansion. Theme names and existing theme objects are both supported with grid-free panels.
- Survey comparison axes use survey-index labels independently of fishery catch; the new survey label takes precedence while preserving legacy custom abundance labels.
- Retrospective tutorials correctly show that saved observations and reports support ridge plots without a live TMB object.
- Growth-reference labels must be nonempty and distinct from both model labels, preventing unrelated curves from being connected.
- Residual smoothers choose their method and span independently in each facet; a sparse group no longer removes or changes trends in other groups.
- All SSB, biomass, abundance and catch plot modes inherit global titles, axis labels, breaks and expansion, including interval variants.
- Process-deviation labels distinguish log deviations from multiplicative factors; survey-index and composition titles describe the plotted quantities.
- Bilingual examples define the retrospective result before use and use the effective year-profile line-width arguments. Manual figures are regenerated with no gridlines.
ALSCL 2.2.9
- In 2.2.9, omitted generic
line_sizeandse_alphainheritacl_theme_set()(defaults 1.5 and 0.2); explicit function arguments take priority. Comparison curves honorlinetypesandcompare_linetypes. Combined residual/metric titles and F facet labels inherit the global typography. Grid lines remain absent by default. ACL F-deviation age panels use numeric order.plot_pla(x_breaks = c(1, 5, 10, 15))selects age-bin ticks without removing heatmap cells. - The default
plot_CatL(exp_transform = FALSE)displays natural-log survey indices and labels that scale explicitly.exp_transform = TRUEdisplays original-scale survey indices; curves are fitted medians. An explicitylaboverrides the automatic label. Ridge compositions are normalized stably on the log scale, including very large or small finite log predictions; nonfinite predictions are rejected. sim_acl()saves the status of every replicate, including failures, toresult_rep_<iter>. Reusing an output directory replaces an earlier success with the current failure record; inspectconvergeanderrorbefore summarizing results. Output write failures are reported and must not be treated as saved results.simulation_to_tables(sm, pa)uses the simulation length coordinates and rejects conflicting parameter coordinates instead of relabeling observations; legacy simulations without coordinates can use matching parameter metadata.create_parameters(species = "krill", model_type = "acl")supplies a Linf start of 90 and bounds, but does not fix Linf or change M, nage or the time step. To fix it, explicitly passmap = list(log_Linf = factor(NA))with the chosen starting value. Biological settings still belong in the fitting arguments.-
Both compiled models evaluate the Baranov catch fraction stably for very small total mortality, consistently with the simulator. This prevents cancellation to zero at extreme values; ordinary-scale results may differ only at floating-point precision.
-
After standard-error calculation, the returned live TMB objective is restored to the final fitted parameters. In the fitting R session,
fit$obj$report()therefore describes the same fitted state asfit$report, including sequential standard errors and a fallback from parallel calculation. This does not change the saved estimates or standard errors. Serialized fits still require refitting before using a live TMB objective. plot_compare_residuals()andplot_compare_CatL()verify known observations and their positive-observation mask as well as time and length metadata. Pass the original fitting table; changing its values or turning a missing cell into an observation is an error. Older fits without stored observations remain usable, but their observation alignment cannot be fully verified. Zero and NA observations are omitted from the comparison points, consistently with fitting; prediction curves remain available at those positions.- Full simulations retain genuine zero and very small positive survey observations; they no longer replace values below 10⁻⁶ with 10⁻⁶. Survey biomass equals survey abundance times weight, including extinction scenarios. This changes only newly generated data that previously hit that floor; saved datasets are not rewritten. The fitting convention is unchanged: zero observations are missing with
zero_action = "missing"and rejected with"error"; an entirely zero survey contains no positive observations and cannot be fitted by the current lognormal model. - Simulation length midpoints must lie within their corresponding bins, using the same containment rules as fitting. The first and last bins absorb the tails. Invalid bin geometry is rejected during parameter preparation and rechecked before biological calculations or simulation, including manually modified inputs, before random draws or output files.
- The checked TMB versions are 1.9.21 and 1.9.25. TMB 1.9.25 passed the strict, no-fallback parallel-equivalence tests for both models and both AD frameworks in the existing Windows, macOS and Linux checks; Windows uses socket workers and skips Unix-fork tests. Other TMB versions retain the sequential safety fallback. This extends eligibility for acceleration, without promising a speed-up for small fits; inspect
fit$sd_infofor the actual method.
ALSCL 2.2.8
- Align survey observations and predictions independently of matrix names; validate residual caps and full-simulator process inputs before random draws or file writes.
- Match quick-simulation tail probabilities to the model core; validate biological inputs, generated outputs and full-simulator probability sums before saving.
- Normalize tibble and factor survey inputs consistently across fitting, diagnostics and comparison; slice time-dependent maps for retrospective peels.
- Validate all requested F/comparison uncertainty, retain numeric age ordering and matrix-position coordinates, and honor residual labels and title alignment.
- Direct F time-series comparisons to the explicit apical/mean helper instead of silently omitting F. Keep grid-free defaults and refresh affected manual figures.
- Load the same source checkout on development socket workers; check source and installed workflows in CI.
ALSCL 2.2.7
- Reject explicitly finite outer length bounds with an actionable message; the model retains tail-absorbing first/last bins, existing interval labels and default inputs.
- Align abundance plots by matrix positions and fitted time/length metadata, independent of matrix dimnames.
- Validate complete, finite, nonnegative standard errors for abundance, recruitment and deviation intervals. Estimate-only deviation plots use reported estimates without requiring a standard-error table.
- Honor ylab in every growth-plot mode and retain text sizes, breaks, themes and annotations when covariance is unavailable. Synchronize bilingual documentation, website, Wiki and help pages; retain grid-free defaults.
ALSCL 2.2.6
- Version 2.2.6 also keeps SSB, abundance, biomass, catch, deviation and fishing-mortality plots grid-free if theme loading fails. Explicit theme choices remain available. Manual ggplot exports check major and minor grids in every panel; a visible grid stops export without replacing an existing file. The 2.2.6 release archive includes the refreshed help images.
ALSCL 2.2.5
-
Refresh all manual figures, including legacy help assets, case studies, own-data and benchmark plots. Figure URLs now track image content to avoid stale cached images.
-
All package plots now omit major and minor gridlines by default; explicit theme overrides remain available.
- Use the same package installation on socket workers, validate fitted-data alignment in diagnostics, share robust comparison metrics, stabilize steep logistic curves and zero-mortality simulations, honor available biomass intervals and explain unsupported plots. Synchronize bilingual guides and executable help examples; homepage installation versions follow DESCRIPTION.
ALSCL 2.2.4
- Resolve path and parameter variables before socket batch fitting; retain diagnostics when all retrospective fits fail, including with plotting requested.
- Give same-model configurations distinct comparison labels, preserve each trajectory's calendar and validate metadata for observation-paired plots.
- Preserve missing/zero observation masks in ridges and residual plots, including portable saved results; convert recruitment ages in years to the correct model-step lag.
- Make quick-simulator mean_F match the actual trajectory mean and allow zero F. Newly generated examples change; previously bundled data retain their original truth.
- Validate burn-in and simulation durations against the time step, preserve one-period matrix dimensions and carry first.year through simulation, tables and batch fitting.
- Update English and Simplified Chinese documentation, reference pages, book and Wiki.
ALSCL 2.2.3
- Check regular time labels against
growth_stepin both fitting functions; preserve wholly missing survey periods asNAcolumns with complete weight and maturity inputs. - Verify observations and metadata before model comparison. Return numerical diagnostics and comparison eligibility; withhold automatic preferences when a fit fails screening or an older result lacks verifiable data metadata.
- Accept
retro_acl(x)andretro_alscl(x)with explicit overrides. Return full-fit and peel diagnostics, errors and screened/unscreened rho tables; do not report a screened rho when a required fit fails. - Use consistent missing-data calculations for metric plots. Plot ALSCL F against numeric length-bin midpoints with aligned intervals; retain the ACL length alias with a warning.
- Update the English and Simplified Chinese workflows while retaining existing separate-argument calls, optional F structures and acceleration settings.
ALSCL 2.2.2
- Add safeguarded Newton refinement (
polish = TRUE) and preserve every raw optimizer pass. An unchanged failed restart no longer replaces an earlier successful result. Raw convergence codes remain available. - Add
F_structure = "year"to both fitting functions, retrospectives and simulation fitting: one shared F per time step with a correctly normalized 1D AR(1) likelihood. The default remains the original group-by-time field; legacy calls and speed settings remain supported. - Add natural-scale boundaries, covariance conditioning, high parameter correlations and an independent numerical screen. Shared-F deviation plots use one series. See the complete survey example.
- Update English and Simplified Chinese documentation, website and Wiki. Refinement can change estimates at numerical precision; the old speed benchmark is not a promise of cross-version identity.
ALSCL 2.2.1
- Clarify required inputs versus estimable parameters and all map rules. The own-data script uses model-default maps (10 ACL / 13 ALSCL free scalars), with fresh diagnostics and plots; a more flexible t0-only map is documented separately.
- Add a complete executable CSV/Excel-to-input-bundle workflow, fitting both
run_acl(x)andrun_alscl(x), checking diagnostics, exporting PNG figures and saving reusable inputs and portable results. - Expand the English and Simplified Chinese own-data case, with the full script, input formats, model-specific configuration, unit conversion, fixed-parameter guidance and plots generated by the example.
- Synchronize the README, Wiki and book. The model likelihood, fitting interfaces and acceleration defaults are unchanged.
ALSCL 2.2.0
- Both
run_acl(x)andrun_alscl(x)accept input bundles or flat named argument lists. Explicit arguments override stored values; model-specific fit settings are selected automatically fromYTF_example. - Existing positional calls, named arguments and
do.call()remain supported. The new interface uses the same optimization and standard-error acceleration, with CppAD still the default. - Validate bundle names, required inputs and model configurations before fitting. Preserve explicit
NULLoverrides and keep simulation parameters separate from fitting settings. -
Update English and Simplified Chinese examples, R help, reference pages and workflow scripts. See input lists and overrides.
-
Compute a single remaining delta-method quantity sequentially, avoiding an unnecessary socket worker and a one-chunk splitting error.
ALSCL 2.1.0
Speed settings on every system
Standard errors now also use several cores on Windows and in RStudio, R.app and Positron: socket workers compute the delta method when it would take more than about 3 seconds, with identical results. Each fit records how its standard errors were computed in fit$sd_info, and alscl_speed_info() shows what the settings mean on your computer. The new speed settings article explains every setting.
Speed settings
The new alscl_speed() sets how fits compute standard errors. By default they are computed on several cores within one fit, with results identical to ALSCL 2.0.0; in the benchmark, fits were 1.13-1.24 times faster. alscl_speed(framework = "TMBad") compiles the models with TMB's TMBad library and made fits 1.25-1.68 times faster, but estimates differ slightly from the default. See the alscl_speed() reference.
Parallel fitting update
run_acl() and run_alscl() now accept nstarts separately from ncores, with the previous default behavior preserved. Returned diagnostics record actual worker PIDs and CPU time. See measured parallel performance for equal-work timings and reproducible evidence.
ALSCL 2.0.0
- Two survey catch-at-length models, ACL and ALSCL, with annual or quarterly time steps.
- Built-in YTF teaching data, full simulation workflows, Excel templates and guidance for importing observations.
- Fit diagnostics, model comparisons and retrospective analyses.
- Customizable ggsci palettes, with sequential viridis colors for time-ordered ridge plots.
Documentation website
The documentation is available in English and Simplified Chinese. Use the language link in the navigation bar to switch the current page. The website includes task-based articles, the existing worked figures, and a reference page for every exported function.
Function signatures and defaults are extracted from the R source during each build. Purpose, arguments, return values and usage notes are maintained alongside the package documentation.