How the JABBA3 app works
Source:vignettes/jabba3app-00-how-it-works.Rmd
jabba3app-00-how-it-works.RmdThis article is the app’s own guide (its Start here
step). To install the app and start it see
vignette("jabba3app-01-install"); to repeat an app run in a
script see vignette("jabba3app-02-user-guide"). The model
itself, its options and diagnostics are described in the JABBA3 user
guide.
jabba3() and outputs. Age-structured priors
from fishery selectivity, seasonal and spatial models are available in
JABBA3 scripts; the app does not take them yet.What JABBA3 does
JABBA3 (Just Another Bayesian Biomass Assessment, version 3) is a Bayesian state-space surplus production model. It follows the exploitable biomass of a stock from the catch and one or more abundance indices: each year the biomass grows by its surplus production, which depends on how large the stock is relative to its unfished size (carrying capacity, K) and on its growth rate (r), and falls by the catch. The indices tell the model how biomass changed. From these, JABBA3 estimates stock status (B/Bmsy and F/Fmsy) with its uncertainty, and the catch that would keep or bring the stock to its target.
JABBA3 builds on JABBA (Winker, Carvalho and Kapur 2018), which has been used widely in tuna RFMO and other assessments, and reimplements it in RTMB (Kristensen et al. 2016): a fit takes seconds, with full posteriors by NUTS when needed. It adds what age-structured populations need and JABBA lacked:
- process error from life history: the harvest rate at MSY (Hmsy) sets its size, generation time its persistence (AR(1)), and the age at maturity a production lag;
- priors that stay consistent: r = m × Hmsy for the chosen shape (Bmsy/K), so changing the shape keeps the same Hmsy and process error;
- diagnostics for the fit (residuals, runs tests), its consistency (retrospective) and its prediction skill (hindcast), ensembles across runs, and projections with Kobe II matrices and harvest control rules.
JABBA3 is an R package built on RTMB and FLR, so its results can go straight into management strategy evaluation.
The app
The app runs a JABBA3 assessment step by step: load the data, set up the model from life history, run it, check the fit, compare runs, read stock status and forecast. Every step calls a JABBA3 function, so a run in the app can be repeated in a script (see the user guide article on the app’s website).
By default the app fits standard JABBA (Bmsy/K = 0.4, no production lag, independent process error), with the priors on r, K and the process error derived from life history. The recommended starting point of the JABBA3 manuscript (a production lag at the age at maturity and persistent AR(1) process error) is one setting away, for a sensitivity run.
Steps marked * in the left panel are required. Steps 4 to 8 show results once the model has run.
| Step | What happens | JABBA3 functions |
|---|---|---|
| 1 Data * | load catch and indices | jb3_data() |
| 2 Explore data | look at the data; common trend and joint index |
jbplot_data(), jb3_trend(),
jb3_jointindex()
|
| 3 Model setup * | Priors: life history, shape, r, Hmsy, process error, K, starting biomass, q, status priors. Settings: starting point, lag, persistence, fishing mortality process, catch and observation error. Summary |
jb3_leslie(), jb3_rho_gt(),
jb3_priors(), jb3_kr(),
jb3_bprior(), jb3_model()
|
| Run model | fit, save the run, go to the results | jabba3() |
| 4 Model results * | summary plot, fits, tables |
jabbaplot3(), jbplot_fits(),
jb3_partable()
|
| 5 Check the fit | convergence, residuals, prior vs posterior, retrospective, hindcast |
jb3_convergence(), jb3_diags(),
jbplot_priorpost(), jb3_retro()
|
| 6 Compare runs | up to six runs side by side; ensembles |
jbplot_trj() on a list of fits,
jb3_weights(), jb3_ensemble()
|
| 7 Stock status | advice trajectories with Bthr and Blim; Kobe plot or biplot in any year |
jbplot_advice(), jbplot_kobe(),
jbplot_biplot()
|
| 8 Forecast | projections, Kobe II matrix, harvest control rule |
jb3_project(), jb3_kobematrix(),
jb3_advice()
|
Assumptions
Process. Biomass relative to K, P = B/K, follows a Pella-Tomlinson surplus production model with shape m (Bmsy/K = m^(1/(1−m)); Schaefer m = 2, Bmsy/K 0.5; Fox m → 1, Bmsy/K 0.37; JABBA3 default Bmsy/K 0.4, m ≈ 1.19). Production in a year depends on the biomass L years earlier (the production lag; L = 0 in standard JABBA), and the catch is removed. Process deviations are lognormal with SD σ and follow an AR(1) process with persistence ρ (ρ = 0 is the independent process error of standard JABBA and SPiCT). Fishing mortality is conditioned on the catch, or follows a random walk (SPiCT-like). Catch is observed with lognormal error (CV 0.1 by default).
Observation. Each index is proportional to biomass, I = q B, with lognormal error. Additive form (as JABBA): total SD = sqrt(se² + extra SD²), with the input standard errors and an extra SD estimated for each index; SPiCT form: SD = sdi × se.
Priors, from life history.
- Hmsy, the harvest rate at MSY, is the common currency: Hmsy = r / m.
-
r = m × Hmsy, with Hmsy approximated by Leslie r /
2 (Fmsy ≈ rmax / 2) from life history (
jb3_leslie()), or entered; lognormal with a CV (default 0.5). - Process error SD: σ_LH = σR × min(0.9 Hmsy, 1.15), the process SD expected from recruitment variability alone, placed at the 2.5th percentile of a lognormal prior with log-SD 0.3, so the prior median is 1.8 σ_LH (σR = 0.5 when unknown). Fitted across 486 bony-fish species of the FAO SOFIA list (JABBA3 manuscript).
- Persistence ρ = exp(−2.2 / GT), with GT the generation time; the production lag is the age at 50% maturity, rounded.
-
K: one-sided, flat below the median predicted from
r across 73 ICES stocks (
jb3_kr()) and lognormal above (CV 1); B1/K: 0.9 (CV 0.25); q: flat on log q, or lognormal.
Estimation. The states are random effects integrated out by the Laplace approximation, and the parameters are estimated at the posterior mode (RTMB); NUTS (tmbstan) samples the full posterior for final runs. Estimates are reported with 95% intervals from draws.
What the app does not do (yet). Age-structured
priors from fishery selectivity (jb3_asem_prior()),
seasonal time steps and spatial or multispecies models are available in
JABBA3 scripts but not in the app.
Workflow
The workflow has five stages, as in the diagram on the Start here page. The step numbers are those in the left panel.
Inputs
Data (step 1)
Upload one csv file of catch and indices (see Data format). Leave out
years with no observation rather than entering zero. Catch must be given
for every year of the catch series. Once loaded, the data are previewed
in two tabs: Catch (the catch by year, with a bar plot)
and Index (each index as value ± standard error, with
the indices scaled to their mean). The blank template and the bigeye
example can be downloaded here, or copied with
jabba3app_templates(). Ticking Use example
data loads Atlantic bigeye tuna (ICCAT, from the
iccat dataset in JABBA3) and fills in approximate bigeye
biology in Model setup.
Biology (step 3, Priors)
Life history is entered at the top of Model setup › Priors, because
it is the starting point of the priors. Linf, k, M, L50 and the
weight-length parameters a and b are required; t0, L95, steepness and
the maximum age are optional (defaults: t0 = −0.5, L95 = L50 + 0.2 Linf,
steepness 0.7, maximum age where 1% of a cohort survives). Lengths are
in cm, and a and b give weight in kg from length in cm. A completed
life-history template can be uploaded instead of typing.
Calculate gives Leslie r (rmax, the intrinsic rate of
increase), the Hmsy proxy Leslie r / 2, the generation time, the age at
50% maturity (the production lag, rounded) and the suggested persistence
ρ = exp(−2.2/GT) (jb3_leslie(), jb3_rho_gt()).
Sources: FishBase and SeaLifeBase, FishLife (predicted parameters for
any fish species, from its taxonomy), regional assessments and published
growth and maturity studies; natural mortality can come from empirical
estimators (for example, Then et al. 2015).
Model setup (step 3)
Priors
Model setup has three tabs: Priors, Settings and Summary. JABBA3 is Bayesian: every estimate combines the data with the priors. Every prior has a median and a CV, prefilled with the default and editable; CVs are converted to log-scale SDs, sqrt(log(1 + CV²)).
Shape, r and Hmsy. The three are linked: Hmsy = r / m, where m is the Pella-Tomlinson shape that gives the chosen Bmsy/K.
| Prior | Choices | Default |
|---|---|---|
| Bmsy/K (shape) | 0.4 (Pella-Tomlinson, m ≈ 1.19); Schaefer, 0.5 (m = 2); Fox, 0.37 (m = 1); Enter manually | 0.4, fixed |
| Uncertainty on the shape | Fixed; or a CV, which puts a lognormal prior on m so the shape is
estimated (jb3_priors(m = ); not for Fox) |
Fixed |
| Growth rate, r | From life history: r = m × Leslie r / 2 (Fmsy ≈ rmax / 2), so r changes with the shape; or Enter manually | life history, CV 0.5 |
| Hmsy = r / m | follows from r and the shape; not a separate prior |
Leslie r / 2 is a rough, life-history-only proxy for Hmsy: it ignores
which ages the fishery takes, and can be wrong by a factor of two. An r
from an age-structured equilibrium (for example
jb3_asem_prior() in a script) can be entered manually.
Process error, from Hmsy. The process error SD is predicted from Hmsy (JABBA3 manuscript): σ_LH = σR × min(0.9 Hmsy, 1.15) is the process SD expected from recruitment variability alone, and is placed at the 2.5th percentile of a lognormal prior with log-SD 0.3 (CV 0.31), so the median is 1.8 σ_LH. σR is 0.5 when unknown. A different CV keeps σ_LH at the 2.5th percentile, so the median moves with it; the median can also be entered. Because the prior follows Hmsy, a change of the r prior or of the shape carries over to the process error. Persistence ρ and the lag from life history are shown here and applied in Settings with the Recommended starting point.
Scale and starting biomass.
| Prior | Choices | Default |
|---|---|---|
| Carrying capacity, K | From r, one-sided: flat below the median predicted from r across 73
ICES stocks (jb3_kr()), CV on the upper side; 8 × max
catch, one-sided (the JABBA3 default); 8 × max catch, two-sided (JABBA);
Enter manually |
from r, CV 1 |
| Biomass at start, B1/K | 0.9 (near unfished); Enter as B/K or as B/Bmsy, with a CV | 0.9, CV 0.25 |
| Catchability, q | flat on log q (default); or a lognormal prior with one median per index (catchability group) and a CV. The median is in index units per unit of biomass (catch units), so the app suggests mean(index) / (0.5 × K prior median), the index at half of K on average | flat |
The default B1/K of 0.9 assumes the catch series starts near the beginning of the fishery. If fishing was already heavy before the first year, a lower value is needed.
Status priors (optional) add independent information
on status in a given year (B/Bmsy, B/K or F/Fmsy, with a median and a
CV), for example from a survey or expert judgement
(jb3_bprior()).
Errors and structure (Settings)
| Setting | Choices | Default |
|---|---|---|
| Starting point | Standard JABBA (no lag, independent process error); Recommended (lag + persistent process error) | Standard JABBA |
| Production lag (years) | 0 with Standard JABBA; with Recommended, the age at 50% maturity, rounded, or Enter manually | 0 |
| Persistence, ρ | 0 with Standard JABBA; with Recommended, from generation time, or Enter manually | 0 |
| Fishing mortality | Catch-conditioned (as JABBA); random walk on log F from the first
index year; random walk in all years (SPiCT-like), with a lognormal
prior on its SD sdf (median 0.3, CV 1.3)
(jb3_model(frw = )) |
catch-conditioned |
| Catch error | on (SD 0.1) or off | on |
| Observation error form | Additive: total SD = sqrt(se² + extra SD²), as JABBA; SPiCT form: SD = sdi × se | Additive |
| Additional variance (additive) | Estimate an extra SD per index (or variance group); Fixed: input SEs
only (sdi.est = FALSE) |
Estimate |
| Minimum observation SD | JABBA default (0.001 with SEs, 0.1 without); Enter value
(se.min) |
JABBA default |
| Prior on sdi (SPiCT form) | Off (flat on log sdi); On, with a median and a CV for all indices
(jb3_priors(sdi = )) |
Off |
| Draws for intervals | 200 to 5000 | 1000 |
Guidance for ρ by generation time (jb3_rho_table()): up
to 3 years, 0.3 to 0.4; 3 to 6 years, 0.6; 6 to 10 years, 0.75; over 10
years, 0.8.
Use Recommended as a sensitivity run: the JABBA3 manuscript found that the lag and persistent process error removed optimistic bias in simulations. Switch catch error off only when catch is known exactly, as in simulation testing. Raise the minimum observation SD to stop an index with very small standard errors from dominating the fit. Use the SPiCT form when the supplied standard errors are unreliable, or to compare with a SPiCT assessment.
A random walk on F makes the harvest rate smooth from year to year; this identifies the scale K when the data say little about it, as in SPiCT. Use it with catch error on.
Advanced options are for experienced users: random-walk or depletion-dependent process error, and catchability or variance groups shared by several indices. Change one at a time, as a new run, and compare it with the previous run.
Summary shows every prior of the next run as a card with its median and CV (r, Bmsy/K, m, Hmsy, process error SD, ρ, lag, K, B1/K, q, the SPiCT sdi prior when on, and status priors), and the main settings, including the fishing mortality process.
Fit
Explore data (step 2)
This step looks at the data before any model is fitted. It changes the model only when the joint index is ticked.
- Catch and indices: the series, and each index scaled to its mean with 95% intervals. Warning signs: indices flat while catch changes (r and K are then hard to separate), indices that disagree where they overlap, very small standard errors (below 0.05), and gaps or reconstructed early catch.
-
Index agreement: fits one shared trend to all
indices (
jb3_trend(), the JARA method built into JABBA3; variance weighting Model (default: an extra SD per index), Equal or Fixed), with the correlation between indices and the catchability of each index relative to the first. A shift in relative catchability often points to a change in vessels, gear or fishing method. -
Joint index: combines the indices into one series
with its own standard errors (
jb3_jointindex()). Ticking Use the joint index replaces the separate indices in the fit; the data loaded in step 1 stay as they are.
Run and results (step 4)
The left panel shows a checklist of what is still missing.
Run model fits the model with jabba3() (a
few seconds), saves the run under the name typed above the button (or
Run 1, Run 2, …) and opens Model results. Up to six runs are kept;
Replace last run overwrites the latest one. The bar at
the top shows which run is displayed, whether it converged, and whether
settings have changed since the last run (Model out of date).
Start over clears everything.
-
Summary: B/Bmsy, F/Fmsy and MSY in the final year,
and the JABBA3 summary plot (
jabbaplot3()): catch, biomass, fishing mortality, fits and the Kobe plot on one page (green: not overfished and no overfishing; red: overfished and overfishing), downloadable as a png for reports. - Fit and production: the model fit to each index (over all years by default; untick to show only the years with data), the surplus production curve with the stock path, and the process deviations over time.
- Tables: parameters, reference points and the time series, each downloadable as csv.
Estimates are the posterior mode with 95% intervals. Check the fit (step 5) before relying on them.
Diagnostics
Check the fit (step 5)
A fit can look plausible and still be wrong, so step 5 asks three questions: how good is the fit (residuals), how consistent is it as years are added (retrospective), and can it predict data it has not seen (hindcast). The Summary tab lists every check as Pass or Check; Check means look more closely, not that the model is wrong.
| Check | What it asks | Warning sign |
|---|---|---|
| Convergence | did the optimiser reach a proper mode with a positive-definite Hessian? | convergence other than ok |
| Residuals and runs tests | are residuals random around zero? | trends over time, long runs on one side |
| Residual tests (OSA) | bias, autocorrelation, normality of one-step-ahead residuals | tests failed |
| Process deviations | do the process deviations wander around zero? | long runs above or below zero |
| Prior vs posterior | how much did the data change each prior? | posterior almost equal to the prior |
| Retrospective | do estimates shift consistently as years are removed? | Mohn’s rho of B/Bmsy outside −0.15 to 0.2 (the range used by
jb3_weights()) |
| Hindcast | can the model predict index values it has not seen? | MASE above 1 (worse than a naive forecast) |
Residuals
How good is the fit? Residuals are the differences between the observed and the fitted index values, on the log scale. If the model and its error assumptions are right, they scatter randomly around zero. The runs test checks for long runs on one side of zero (a pattern the model misses); one-step-ahead (OSA) residuals test for bias, autocorrelation and non-normality. The process deviations show how far biomass had to depart from the production curve each year: long runs above or below zero suggest the production function misses part of the dynamics, for example a production lag or a regime shift. Residual tests check the error assumptions; they can miss structural problems such as an omitted lag.
Retrospective
How consistent is the fit as years are added? The model is refitted several times, each time with the last year of data removed (a peel). If the estimates of B/Bmsy and F/Fmsy shift in the same direction with every peel, the assessment is systematically revised as new data arrive. Mohn’s rho summarises the average relative shift; values of B/Bmsy outside −0.15 to 0.2 call for a closer look.
Hindcast
Can the model predict? Each retrospective peel
projects the stock one year ahead and predicts the index of the first
removed year, which the peel has not seen. The mean absolute scaled
error (MASE) compares these predictions with a naive forecast (this
year’s index equals last year’s): below 1, the model predicts better
than the naive forecast. Retrospective and hindcast share one set of
refits, run when either button is pressed; a refit is needed only for a
different number of peels. The hindcast plot shows the 95% intervals of
the observations by default. On bigeye, the MASE from the peels agrees
within 0.02 with jb3_hindcast(), which refits with only the
index removed.
Compare runs (step 6)
Each run is kept with its settings, and the table lists what changed from the run before. The bin symbol removes a run (not the run shown). Settings carry over between runs, so a sensitivity run only needs the changed setting. Selected runs can be plotted together.
An ensemble combines converged runs into one result, so advice reflects uncertainty about model choices as well as about the data. Weights are equal, or score-based: runs that pass the runs tests and residual checks (and, where run for every selected run, the retrospective and hindcast checks) get more weight. The ensemble updates as runs are selected, and is shown by run (each run with the ensemble) or as the joint ensemble only. It can be used in Forecast.
Advice
Stock status (step 7)
-
Trajectories (advice plot): B/Bmsy, F/Fmsy and
catch with their uncertainty (
jbplot_advice()). The threshold Bthr (default 0.5 Bmsy) and the limit Blim (default 0.3 Bmsy) can be shown or hidden and changed; bands are nested 60% and 90% (JABBA style) or 95%; the last year of F and catch can be dropped; panels stacked or side by side. -
Kobe plot: B/Bmsy against F/Fmsy with the stock
path and the uncertainty in a chosen year, as points with 50/80/95%
contours or as filled regions (
jbplot_kobe()); or the biplot with the zones of a hockey-stick harvest control rule (jbplot_biplot(), target 0.8 Fmsy and threshold 0.2 Bmsy by default).
Forecast (step 8)
- Projections: scenarios of fishing mortality relative to Fmsy or of constant catch (TAC), over a chosen number of years, with the years between the data and the first scenario year (default 1), and the threshold (default 0.5 Bmsy) and limit (default 0.3 Bmsy). The plot can be stacked (3 rows) or side by side (1 × 3, normal or taller).
- Kobe II matrix: the probability of meeting management objectives for each scenario and year, in ICCAT, IOTC, GFCM or ICES style.
- Harvest control rule: fishing at the target F while biomass is above the trigger, reduced in a straight line below it. The advised catch is a lower percentile of the catch the rule gives (the ICES rule uses the 35th percentile).
Projections carry the model uncertainty forward, so results are probabilities, not single numbers. As with any data-limited assessment, they should support management decisions, not be their only basis.
Data format
Upload one csv file in long format: one row per record, with five columns.
| Column | Content |
|---|---|
| year | the year of the record |
| type |
Catch or Index
|
| series | a name for each catch series or index (catch series are summed) |
| value | catch, or the index value |
| se | log-scale standard error of an index value; may be left blank |
Leave out years with no observation rather than entering zero. Catch
must be given for every year of the catch series. The blank template and
the Atlantic bigeye tuna example can be downloaded in step 1, or copied
with jabba3app_templates(). The life-history template
(parameter, value) can be uploaded in Model setup › Priors.
References
Kristensen, K., Nielsen, A., Berg, C. W., Skaug, H. and Bell, B. M. (2016). TMB: automatic differentiation and Laplace approximation. Journal of Statistical Software 70(5), 1–21.
Pella, J. J. and Tomlinson, P. K. (1969). A generalized stock production model. Inter-American Tropical Tuna Commission Bulletin 13, 419–496.
Schaefer, M. B. (1954). Some aspects of the dynamics of populations important to the management of the commercial marine fisheries. Inter-American Tropical Tuna Commission Bulletin 1, 27–56.
Thorson, J. T., Cope, J. M., Branch, T. A. and Jensen, O. P. (2012). Spawning biomass reference points for exploited marine fishes, incorporating taxonomic and body size information. Canadian Journal of Fisheries and Aquatic Sciences 69, 1556–1568.
Then, A. Y., Hoenig, J. M., Hall, N. G. and Hewitt, D. A. (2015). Evaluating the predictive performance of empirical estimators of natural mortality rate using information on over 200 fish species. ICES Journal of Marine Science 72, 82–92.
Winker, H. (2026). JABBA3 user guide. https://henning-winker.github.io/JABBA3/
Winker, H., Carvalho, F. and Kapur, M. (2018). JABBA: Just Another Bayesian Biomass Assessment. Fisheries Research 204, 275–288.
Winker, H., Carvalho, F., Thorson, J. T., Kell, L. T., Parker, D., Kapur, M., Sharma, R., Booth, A. J. and Kerwath, S. E. (2020). JABBA-Select: incorporating life history and fisheries’ selectivity into surplus production models. Fisheries Research 222, 105355.
Screenshots
The app with the bigeye example (Use example data in step 1), all other settings at their defaults (Bmsy/K 0.4, standard JABBA).









