Package: sspm 1.0.3

Valentin Lucet

sspm: Spatial Surplus Production Model Framework for Northern Shrimp Populations

Implement a GAM-based (Generalized Additive Models) spatial surplus production model (spatial SPM), aimed at modeling northern shrimp population in Atlantic Canada but potentially to any stock in any location. The package is opinionated in its implementation of SPMs as it internally makes the choice to use penalized spatial gams with time lags. However, it also aims to provide options for the user to customize their model. The methods are described in Pedersen et al. (2022, <https://www.dfo-mpo.gc.ca/csas-sccs/Publications/ResDocs-DocRech/2022/2022_062-eng.html>).

Authors:Valentin Lucet [aut, cre, cph], Eric Pedersen [aut]

sspm_1.0.3.tar.gz
sspm_1.0.3.zip(r-4.5)sspm_1.0.3.zip(r-4.4)sspm_1.0.3.zip(r-4.3)
sspm_1.0.3.tgz(r-4.5-any)sspm_1.0.3.tgz(r-4.4-any)sspm_1.0.3.tgz(r-4.3-any)
sspm_1.0.3.tar.gz(r-4.5-noble)sspm_1.0.3.tar.gz(r-4.4-noble)
sspm_1.0.3.tgz(r-4.4-emscripten)sspm_1.0.3.tgz(r-4.3-emscripten)
sspm.pdf |sspm.html
sspm/json (API)
NEWS

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

Bug tracker:https://github.com/pedersen-fisheries-lab/sspm/issues

Pkgdown site:https://pedersen-fisheries-lab.github.io

Datasets:

On CRAN:

gammodelspatialsurplus

5.28 score 3 stars 21 scripts 10 downloads 84 exports 39 dependencies

Last updated 9 days agofrom:c3f25bf4c5. Checks:8 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKFeb 13 2025
R-4.5-winOKFeb 13 2025
R-4.5-macOKFeb 13 2025
R-4.5-linuxOKFeb 13 2025
R-4.4-winOKFeb 13 2025
R-4.4-macOKFeb 13 2025
R-4.3-winOKFeb 13 2025
R-4.3-macOKFeb 13 2025

Exports:%>%as_discretization_methodformula_typeformula_type<-formula_varsformula_vars<-is_fittedis_fitted<-is_mappedis_mapped<-is_splitis_split<-method_funcmethod_func<-plotpredictpredict_intervalsraw_formularaw_formula<-smooth_lagsmooth_spacesmooth_space_timesmooth_timespmspm_aggregatespm_aggregate_catchspm_as_boundaryspm_as_datasetspm_biomass_varsspm_biomass_vars<-spm_boundariesspm_boundaries<-spm_boundaryspm_boundary_areaspm_boundary_area<-spm_boundary<-spm_coords_colspm_coords_col<-spm_dataspm_data<-spm_datasetsspm_datasets<-spm_density_varsspm_density_vars<-spm_discret_methodspm_discret_method<-spm_discretizespm_formulasspm_formulas<-spm_get_fitspm_get_fit<-spm_lagspm_lagged_varsspm_lagged_vars<-spm_methodsspm_namespm_name<-spm_patchesspm_patches_areaspm_patches_area<-spm_patches<-spm_pointsspm_points<-spm_responsespm_response<-spm_smoothspm_smooth_methodsspm_smoothed_dataspm_smoothed_data<-spm_smoothed_fitspm_smoothed_fit<-spm_smoothed_varsspm_smoothed_vars<-spm_splitspm_timespm_time<-spm_unique_IDspm_unique_ID<-sspmsummarytesselate_voronoitranslated_formulatranslated_formula<-triangulate_delaunay

Dependencies:backportscheckmateclassclassIntclicpp11DBIdplyre1071fansigenericsglueKernSmoothlatticelifecyclemagrittrMASSMatrixmgcvnlmepillarpkgconfigproxypurrrR6Rcpprlangs2sfstringistringrtibbletidyrtidyselectunitsutf8vctrswithrwk

An example with simulated data

Rendered fromAn_example_with_simulated_data.Rmdusingknitr::rmarkdownon Feb 13 2025.

Last update: 2023-05-15
Started: 2022-04-19

Package and workflow design

Rendered fromPackage_and_workflow_design.Rmdusingknitr::rmarkdownon Feb 13 2025.

Last update: 2023-05-15
Started: 2022-04-19

Readme and manuals

Help Manual

Help pageTopics
Extract methods$,sspm-method $,sspm_boundary-method $,sspm_dataset-method $,sspm_discrete_boundary-method extract
Cast into a 'discretization_method' objectas_discretization_method as_discretization_method,character,ANY-method as_discretization_method,missing,function-method
Simulated biomass databorealis_simulated
Simulated catch datacatch_simulated
sspm discretization method classdiscretization_method-class
Accessing OR replacing 'discretization_method' model elementsmethod_func method_func,discretization_method-method method_func<- method_func<-,discretization_method-method spm_name,discretization_method-method spm_name<-,discretization_method-method
Plot 'sspm' objectsplot plot,sspm_boundary,missing-method plot,sspm_dataset,missing-method plot,sspm_fit,missing-method plot.sspm
Simulated predator datapredator_simulated
Predict with a SPM modelpredict predict,sspm_dataset-method predict,sspm_fit-method predict.sspm
GAM confidence and prediction intervalspredict_intervals
Accessing OR replacing 'sspm_formula' model elementsformula_type formula_type,sspm_formula-method formula_type<- formula_type<-,sspm_formula-method formula_vars formula_vars,sspm_formula-method formula_vars<- formula_vars<-,sspm_formula-method is_fitted is_fitted,sspm_formula-method is_fitted<- is_fitted<-,sspm_formula-method raw_formula raw_formula,sspm_formula-method raw_formula<- raw_formula<-,sspm_formula-method spm_lagged_vars spm_lagged_vars,sspm_formula-method spm_lagged_vars<- spm_lagged_vars<-,sspm_formula-method spm_response spm_response,sspm_formula-method spm_response<- spm_response<-,sspm_formula-method translated_formula translated_formula,sspm_formula-method translated_formula<- translated_formula<-,sspm_formula-method
SFA boundaries datasfa_boundaries
sspm Smoothing functionssmooth_lag smooth_lag,ANY,sf,sspm_discrete_boundary-method smooth_space smooth_space,sf,sspm_discrete_boundary-method smooth_space_time smooth_space_time,sf,sspm_discrete_boundary-method smooth_time smooth_time,sf,sspm_discrete_boundary-method
Fit an SPM modelspm spm,sspm,formula-method spm,sspm,missing-method
Aggregate a dataset or fit data variable based on a boundaryspm_aggregate spm_aggregate,sspm_dataset,missing-method spm_aggregate,sspm_dataset,sspm_discrete_boundary-method
Update biomass value from catch adtaspm_aggregate_catch spm_aggregate_catch,sspm_dataset,sspm_dataset,character,character-method
Create a sspm_boundary objectspm_as_boundary spm_as_boundary,ANY,missing,ANY,ANY-method spm_as_boundary,missing,ANY,ANY,ANY-method spm_as_boundary,sf,character,ANY,ANY-method spm_as_boundary,sf,character,missing,missing-method
Create a 'sspm_dataset' dataset structurespm_as_dataset spm_as_dataset,data.frame,ANY,ANY,ANY,character-method spm_as_dataset,data.frame,ANY,ANY,ANY,list-method spm_as_dataset,data.frame,ANY,ANY,ANY,missingOrNULL-method spm_as_dataset,sf,ANY,ANY,ANY,ANY-method
Accessing OR replacing 'sspm_boundary' model elementsspm_boundaries,sspm_boundary-method spm_boundaries<-,sspm_boundary-method spm_boundary spm_boundary,sspm_boundary-method spm_boundary<- spm_boundary<-,sspm_boundary-method spm_boundary_area spm_boundary_area,sspm_boundary-method spm_boundary_area<- spm_boundary_area<-,sspm_boundary-method spm_discret_method spm_discret_method,sspm_discrete_boundary-method spm_discret_method<- spm_discret_method<-,sspm_discrete_boundary-method spm_patches spm_patches,sspm_discrete_boundary-method spm_patches<- spm_patches<-,sspm_discrete_boundary-method spm_patches_area spm_patches_area,sspm_discrete_boundary-method spm_patches_area<- spm_patches_area<-,sspm_discrete_boundary-method spm_points spm_points,sspm_discrete_boundary-method spm_points<- spm_points<-,sspm_discrete_boundary-method
Accessing OR replacing 'sspm_dataset' model elementsis_mapped is_mapped,sspm_dataset-method is_mapped<- is_mapped<-,sspm_dataset-method spm_biomass_vars spm_biomass_vars,sspm_dataset-method spm_biomass_vars<- spm_biomass_vars<-,sspm_dataset-method spm_boundaries,sspm_dataset-method spm_boundaries<-,sspm_dataset-method spm_coords_col spm_coords_col,sspm_dataset-method spm_coords_col<- spm_coords_col<-,sspm_dataset-method spm_data spm_data,sspm_dataset-method spm_data<- spm_data<-,sspm_dataset-method spm_density_vars spm_density_vars,sspm_dataset-method spm_density_vars<- spm_density_vars<-,sspm_dataset-method spm_formulas spm_formulas,sspm_dataset-method spm_formulas<- spm_formulas<-,sspm_dataset-method spm_name,sspm_dataset-method spm_name<-,sspm_dataset-method spm_smoothed_data,sspm_dataset-method spm_smoothed_data<-,sspm_dataset-method spm_smoothed_fit spm_smoothed_fit,sspm_dataset-method spm_smoothed_fit<- spm_smoothed_fit<-,sspm_dataset-method spm_smoothed_vars spm_smoothed_vars,sspm_dataset-method spm_smoothed_vars<- spm_smoothed_vars<-,sspm_dataset-method spm_time,sspm_dataset-method spm_time<-,sspm_dataset-method spm_unique_ID,sspm_dataset-method spm_unique_ID<-,sspm_dataset-method
Discretize a 'sspm' model objectspm_discretize spm_discretize,sspm_boundary,ANY,missing-method spm_discretize,sspm_boundary,character,ANY-method spm_discretize,sspm_boundary,discretization_method,ANY-method spm_discretize,sspm_boundary,function,ANY-method spm_discretize,sspm_boundary,missing,ANY-method
Create lagged columns in a sspm smoothed data slotspm_lag spm_lag,sspm-method spm_lag,sspm_fit-method
Get the list of available discretization methodsspm_methods
Accessing OR replacing 'sspm' model elementsis_split is_split,sspm-method is_split<- is_split<-,sspm-method spm_ spm_boundaries spm_boundaries,sspm-method spm_boundaries<- spm_boundaries<-,sspm-method spm_datasets spm_datasets,sspm-method spm_datasets<- spm_datasets<-,sspm-method spm_name spm_name<- spm_smoothed_data spm_smoothed_data,sspm-method spm_smoothed_data<- spm_smoothed_data<-,sspm-method spm_time spm_time,sspm-method spm_time<- spm_time<-,sspm-method spm_unique_ID spm_unique_ID,sspm-method spm_unique_ID<- spm_unique_ID<-,sspm-method
Smooth a variable in a sspm datasetspm_smooth spm_smooth,sspm_dataset,formula,sspm_discrete_boundary-method
Get the list of available smoothing methodsspm_smooth_methods
Split data in test and train setsspm_split spm_split,sspm-method
Accessing OR replacing 'sspm_fit' model elementsspm_boundaries,sspm_fit-method spm_boundaries<-,sspm_fit-method spm_boundary,sspm_fit-method spm_boundary<-,sspm_fit-method spm_formulas,sspm_fit-method spm_formulas<-,sspm_fit-method spm_get_fit spm_get_fit,sspm_fit-method spm_get_fit<- spm_get_fit<-,sspm_fit-method spm_smoothed_data,sspm_fit-method spm_smoothed_data<-,sspm_fit-method spm_time,sspm_fit-method spm_time<-,sspm_fit-method spm_unique_ID,sspm_fit-method spm_unique_ID<-,sspm_fit-method
Create a 'sspm' model objectsspm sspm,sspm_dataset,list-method sspm,sspm_dataset,missing-method sspm,sspm_dataset,sspm_dataset-method
sspm boundary structuresspm_boundary-class
sspm dataset structuresspm_dataset-class
sspm discrete boundary structuresspm_discrete_boundary-class
sspm fitsspm_fit-class
sspm formula objectsspm_formula-class
sspm model classsspm-class
Summarises 'sspm_fit' objectssummary summary,sspm_fit-method summary.sspm
Perform voronoi tesselationtesselate_voronoi
Perform delaunay triangulationtriangulate_delaunay