Package: SPoRC 0.1.0

Matthew Cheng

SPoRC: A Generalized Stochastic (S) Population (Po) Model Over Regional (R) Components (C)

A generalized spatial population model for stock assessment, written in RTMB.

Authors:Matthew Cheng [aut, cre], Dan Goethel [ctb], Pete Hulson [ctb], Curry Cunningham [ctb]

SPoRC_0.1.0.tar.gz
SPoRC_0.1.0.zip(r-4.7)SPoRC_0.1.0.zip(r-4.6)SPoRC_0.1.0.zip(r-4.5)
SPoRC_0.1.0.tgz(r-4.6-any)SPoRC_0.1.0.tgz(r-4.5-any)
SPoRC_0.1.0.tar.gz(r-4.6-any)
SPoRC_0.1.0.tgz(r-4.5-emscripten)
manual.pdf |manual.html
DESCRIPTION
card.svg |card.png
SPoRC/json (API)

# Install 'SPoRC' in R:
install.packages('SPoRC', repos = c('https://jimianelli.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/chengmatt/sporc/issues

Pkgdown/docs site:https://chengmatt.github.io

Datasets:

On CRAN:

Conda:

6.03 score 51 scripts 58 exports 53 dependencies

Last updated from:8060533a38. Checks:7 WARNING, 2 OK. Indexed: yes.
A new build is currently in progress.

TargetResultTimeFilesSyslog
linux-devel-x86_64WARNING321
source / vignettesOK365
linux-release-x86_64WARNING222
macos-release-arm64WARNING161
macos-oldrel-arm64WARNING177
windows-develWARNING203
windows-releaseWARNING187
windows-oldrelWARNING196
wasm-releaseOK228

Exports:bisection_Fcondition_closed_loop_simulationsdo_francis_reweightingdo_jitterdo_likelihood_profileDo_Population_Projectiondo_retrospectivedo_runs_testfit_modelget_biological_plotget_catch_fits_plotget_closed_loop_reference_pointsget_comp_propget_data_fitted_plotget_idx_fitsget_idx_fits_plotget_key_quantsget_logistN_Sigmaget_model_rep_from_mcmcget_nLL_plotget_osaget_par_est_infoGet_Reference_Pointsget_retrospective_plotget_retrospective_relative_differenceget_selex_plotget_ts_plotmarg_AICplot_all_basicplot_residspost_optim_sanity_checksrho_transrun_annual_cyclerun_francisset_data_indicator_unusedSetup_Mod_BiologicalsSetup_Mod_Catch_and_FSetup_Mod_DimSetup_Mod_FishIdx_and_CompsSetup_Mod_Fishsel_and_QSetup_Mod_MovementSetup_Mod_RecSetup_Mod_SrvIdx_and_CompsSetup_Mod_Srvsel_and_QSetup_Mod_TaggingSetup_Mod_WeightingSetup_Sim_BiologicalsSetup_Sim_ContainersSetup_Sim_DimSetup_sim_envSetup_Sim_FishingSetup_Sim_RecSetup_Sim_SurveySetup_Sim_TaggingSimulate_Pop_Staticsimulation_data_to_SPoRCsimulation_self_testtheme_sablefish

Dependencies:abindclicodetoolscowplotcpp11data.tabledigestdplyrfarverfuturefuture.applygenericsggplot2globalsgluegridExtragtablehereisobandlabelinglatticelifecyclelistenvmagrittrMASSMatrixparallellypillarpkgconfigplyrprogressrpurrrR6randtestsRColorBrewerRcppRcppEigenreshape2rlangrprojrootRTMBS7scalesstringistringrtibbletidyrtidyselectTMButf8vctrsviridisLitewithr

Random Effects (Selectivity Example; Eastern Bering Sea Pollock)

Last update: 2025-11-27
Started: 2025-10-03

Setting up a Single Region Model (Eastern Bering Sea Pollock)
Setup Model Dimensions | Setup Recruitment Dynamics | Setup Biological Dynamics | Setup Movement and Tagging | Setup Catch and Fishing Mortality | Setup Fishery Indices and Compositions | Setup Survey Indices and Compositions | Setting up Fishery Selectivity and Catchability | Setting up Survey Selectivity and Catchability | Setup Model Weighting | Fit Model and Plot

Last update: 2025-11-24
Started: 2025-07-08

Run Closed Loop Simulations
Define Operating Model | Define Management Options | Define Estimation Model | Define and Run Closed-Loop Simulation

Last update: 2025-11-24
Started: 2025-05-24

Deriving Reference Points, Catch Advice, and Projections
Reference Points | Single Region | Spawning Potential Ratio | Maximum Sustainable Yield (Beverton-Holt) | Multi-Region | Independent | Global | Local | Deriving Catch Advice and Projections | Code Demonstration | Getting Reference Points | Multi Region | Conducting Catch Projections to Derive Catch Advice (Deterministic Recruitment) | Conducting Stochastic Population Projections | References

Last update: 2025-11-24
Started: 2025-06-18

Testing Management Procedures via Closed Loop Simulations (Dusky Rockfish)
Overview | Estimation Model | Projection Options | Functions to Determine Catch | Management Procedures | Simulation Loop (Single Replicate) | Simulation Loop (Parrallelized) | Condition Closed Loop Simulation | Run Simulations | Process Results | Visualize

Last update: 2025-11-24
Started: 2025-10-13

Description of Model and Data Dimensions
Data Inputs for Defining Model Dimensions | Data Inputs for Defining Recruitment Processes | Data Inputs for Defining Biological Processes | Data Inputs for Defining Movement Processes | Data Inputs for Defining Tagging Processes | Data Inputs for Defining Catch and Fishing Mortality Processes | Data Inputs for Defining Fishery Indices and Compositions | Data Inputs for Defining Survey Indices and Compositions | Data Inputs for Defining Fishery Selectivity and Catchability | Data Inputs for Defining Survey Selectivity and Catchability | Data Inputs for Defining Model Weighting

Last update: 2025-10-27
Started: 2025-04-29

Description of Model Equations
Process Equations | Population Initialization | Recruitment Processes | Population Projection | Observation Equations | Fishery Observation Model | Survey Observation Model | Tagging Observation Model | Fishery and Survey Selectivity | Likelihoods | Observation Likelihoods | Fishery Catches | Fishery and Survey Indices | Fishery and Survey Compositions | Structuring Compositions and Ageing Error | Tagging | Parameter Priors and Process Error Penalties | Parameter Priors | Natural Mortality | Fishery and Survey Catchability | Steepness | Recruitment Proportions | Movement | Tag Reporting Rates | Process Error Penalties | Initial Age Deviations | Recruitment Deviations | Fishing Mortality Deviations | Joint Likelihood | References

Last update: 2025-10-27
Started: 2025-04-29

Description of Simulation Dimensions
Simulation Settings | Population, Recruitment, and Biological Processes | Fishery Processes | Survey Processes | Tagging

Last update: 2025-10-23
Started: 2025-10-02

Setting up a Spatial Model (Alaska Sablefish)
Setup Model Dimensions | Setup Recruitment Dynamics | Setup Biological Dynamics | Setup Movement and Tagging Dynamics | Setup Catch and Fishing Mortality | Setup Index and Composition Data (Fishery and Survey) | Setup Selectivity and Catchability (Fishery and Survey) | Setup Model Weighting | Fit Model and Plot

Last update: 2025-10-16
Started: 2025-04-29

Simulation Testing (Cross and Self Tests)
Simulation Cross-Testing in SPoRC | Define Model Dimensions | Fishing Processes | Survey Processes | Biological Dynamics | Tagging and Movement | Recruitment | Run the Operating Model | Define Estimation Model | Run Cross-Test Analysis | Self Testing

Last update: 2025-10-15
Started: 2025-09-30

Running a Simple Assessment (The Basics)
Load data and packages | Setup model | Setup Recruitment Dynamics | Setup biological dynamics | Setup Movement and Tagging | Setup Catch and Fishing Mortality | Setup Fishery Indices and Compositions | Setup Survey Indices and Compositions | Setup Fishery Selectivity and Catchability | Setup Survey Selectivity and Catchability | Setup Model Weighting | Fit model | Fit model (Without Francis) | Fit model (With Francis) | Check Model Results | Convergence | Time Series Results | Catch and Index Fits | Composition Fits | Fishery Ages | Fishery Lengths | Survey Ages | Retrospectives | Retrospectives (Without Francis) | Retrospectives (With Francis) | Likelihood Profiles | Jitter Analysis | MCMC | Reference Points and Projections | Reference Points | Projections | Spawning Biomass Projections | Catch Projections | Catch Advice under $F_{40%}$ | Fishing Mortality Projections

Last update: 2025-10-15
Started: 2025-07-18

Description of Model Parameters
Fishery Removals | Fishery Selectivity | Fishery Catchability | Fishery Composition Likelihoods | Survey Selectivity | Survey Catchability | Survey Composition Likelihoods | Natural Mortality | Recruitment | Movement | Tagging

Last update: 2025-10-06
Started: 2025-04-29

Description of Model Report
Biological Processes | Fishery Processes | Survey Processes | Tagging Processes | Likelihoods | Parameter Deviations | Derived Quantities

Last update: 2025-10-06
Started: 2025-05-19

Setting up a Single Region Model (Alaska Sablefish)
Setup Model Dimensions | Setup Recruitment Dynamics | Setup Biological Dynamics | Setup Movement and Tagging Dynamics | Setup Catch and Fishing Mortality | Setup Index and Composition Data (Fishery and Survey) | Setup Selectivity and Catchability (Fishery and Survey) | Setup Model Weighting | Fit Model and Plot

Last update: 2025-09-30
Started: 2025-04-29

Starting Values and Fixing (and Sharing) Parameters
Starting Values | Mapping | Fixing Parameters | Sharing Parameters

Last update: 2025-09-30
Started: 2025-07-01

Defining Priors
Steepness | Natural Mortality | Catchability | Selectivity | Movement | Tag Reporting Rates | Recruitment Proportions

Last update: 2025-09-30
Started: 2025-07-16

Readme and manuals

Help Manual

Help pageTopics
Go from TAC to Fishing Mortality using bisectionbisection_F
Set up simulation list for closed-loop projectionscondition_closed_loop_simulations
Get Francis Weightsdo_francis_reweighting
Run Jitter Analysisdo_jitter
Run Likelihood Profiledo_likelihood_profile
Do Population ProjectionsDo_Population_Projection
Run retrospective analyses for RTMB modelsdo_retrospective
Runs test function taken from SS3 diags.do_runs_test
Dusky model outputs from single regino modeldusky_rtmb_model
Run RTMB modelfit_model
Get Plots of Biological Quantitiesget_biological_plot
Title Get Catch Fits Plotget_catch_fits_plot
Get Closed Loop Reference Pointsget_closed_loop_reference_points
Gets composition data proportions normalized according to the assessment specifications from RTMBget_comp_prop
Get Data Fitted to Plotget_data_fitted_plot
Gets index fits resultsget_idx_fits
Get Index Fits Plotget_idx_fits_plot
Generate Key Projection Quantities and Table Plotget_key_quants
Construct logistic-normal covariance matrixget_logistN_Sigma
Extract model report from MCMC posterior samplesget_model_rep_from_mcmc
Get plot of negative log likelihood valuesget_nLL_plot
Compute OSA residuals for composition dataget_osa
Helper function for extracting parameter information and names from TMBget_par_est_info
Wrapper function to get reference pointsGet_Reference_Points
Get Retrospective Plotget_retrospective_plot
Derive relative difference from terminal year from a retrospective analysis.get_retrospective_relative_difference
Get Fishery and Survey Selectivity Plotsget_selex_plot
Get Time Series Plotsget_ts_plot
Calculate the Corrected marginal AIC (AICc) from Optimization Resultsmarg_AIC
Sablefish data for multi region (5 area) case studymlt_rg_sable_data
Sablefish report for 5 region case studymlt_rg_sable_rep
Plotting function for all basic quantitiesplot_all_basic
Plots OSA residuals from outputs from get_osa. Much of this code is taken from the afscOM package, but with modificaitons to plot features.plot_resids
Post Optimization Model Convergence Checkspost_optim_sanity_checks
Title Constrains value between -1 and 1rho_trans
Run Annual Cycle in Simulation Environmentrun_annual_cycle
Run Iterative Francis Reweighting Procedurerun_francis
Set Data Indicators to Unused for Specified Yearsset_data_indicator_unused
Setup biological inputs for estimation modelSetup_Mod_Biologicals
Setup fishing mortality and catch observationsSetup_Mod_Catch_and_F
Set up model dimensionsSetup_Mod_Dim
Setup observed fishery indices and composition data (age and length comps)Setup_Mod_FishIdx_and_Comps
Setup fishery selectivity and catchability specificationsSetup_Mod_Fishsel_and_Q
Setup Movement Processes for SPoRCSetup_Mod_Movement
Setup model objects for specifying recruitment module and associated processesSetup_Mod_Rec
Setup observed survey indices and composition data (age and length comps)Setup_Mod_SrvIdx_and_Comps
Setup survey selectivity and catchability specificationsSetup_Mod_Srvsel_and_Q
Setup tagging processes and parametersSetup_Mod_Tagging
Set up SPoRC model weightingSetup_Mod_Weighting
Set up simulation containers and inputs for biological parametersSetup_Sim_Biologicals
Setup containers for simulation and outputSetup_Sim_Containers
Initialize Simulation Dimension SettingsSetup_Sim_Dim
Constructs simulation objects in a new simulation environment for use in simulation functionsSetup_sim_env
Setup values and dimensions of fishing processesSetup_Sim_Fishing
Set up recruitment dynamics for simulationSetup_Sim_Rec
Setup values for survey parameterizationSetup_Sim_Survey
Set up simulated tagging dynamicsSetup_Sim_Tagging
Dusky data for single region assessment case studysgl_rg_dusky_data
EBS Walleye Pollock data for single region case studysgl_rg_ebswp_data
Sablefish data for single region case studysgl_rg_sable_data
Sablefish report for single region case studysgl_rg_sable_rep
Simulates a static spatial, sex, and age-structured population (no feedback loop)Simulate_Pop_Static
Extract simulation data into SPoRC formatsimulation_data_to_SPoRC
Conduct a Simulation Self Testsimulation_self_test
ggplot theme for sablefishtheme_sablefish
Sablefish data for multi region (3 area) case studythree_rg_sable_data