Skip to content

Modeling Size at Maturity Using Morphometric Data

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

rmk118/morphmat

Repository files navigation

morphmat

Hex sticker logo for morphmat package

Lifecycle: experimental Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.

A compilation of methods used to estimate size at (sexual) maturity based on morphometric data, most commonly applied to crabs, lobsters, and other crustaceans. Approaches include modeling approaches based on piecewise/segmented linear regression as well as numerous clustering-based methods.

morphmat is intended to help fisheries scientists and managers to implement the multitude of computational methods that have been developed for estimating crustacean size at maturity. This package is being developed as part of my graduate work at the University of Maine. This is still a work in progress and should not yet be used for research purposes.

morphmat will include user-friendly functions for estimating size at morphometric maturity, along with guidelines for choosing the optimal method for a given dataset and correctly interpreting results. Both novel and historically popular (e.g., broken-stick regression) methods will be included, and users will be able to obtain SM50 estimates from nearly a dozen different approaches with a single function call. By combining code for the various models within a single package, morphmat will enable the application of multi-model inference to SM50 estimation, avoiding the arbitrary selection of a single “best” model (Katsanevakis 2006). By increasing the accessibility of modern statistical methods for estimating SM50, I hope to facilitate the widespread adoption of improved SM50 modeling procedures.

morphmat will include versions of the methods implemented in these existing GitHub repositories:

Type Authors GitHub repository Description/notes
Package Josymar Torrejon-Magallanes ejosymart/sizeMat sizeMat: An R Package to Estimate Size at Sexual Maturity
Package Rodrigo Sant’Ana, Fernando Mayer rodrigosantana/Regrans: Fits Segmented Linear Regression Models Older repository: fernandomayer/Regrans
Package Derek Sonderegger siZer Conduct size at morphometric maturity analysis (SMM) and plot results using the SiZer extension package by Olson, Andrew P., Siddon, Chris E., and Eckert, Ginny L.
Package Vito M. R. Muggeo segmented package reference manual
Package Youyi Fong chngpt Fitting Threshold Regression Models Using chngpt (vignette)
Package Tobie Surette TobieSurette/gulf.stats See files morphometric.maturity.R and morphometry.R
R scripts Bradley Stevens Crabman52/Crustacean_Sensation Include three different methods for separating mature from immature crabs based on allometric growth of body parts, with code based on Somerton’s (1980) program MATURE

The following scripts do not use morphometric data and require individuals to already be classified as mature or immature. They provide various examples of how to fit maturity~length binomial models to estimate SM50 and obtain confidence intervals. These tools can also be used to calculate size at maturity for non-crustacean fisheries. For a comprehensive examination of this type of model, see Mainguy et al (2024).

Type Authors GitHub repository Description/notes
R scripts Lucas Rodrigues lvcasrodrigues/maturity_at_size Does not use morphometric data; takes size classes with known numbers of mature individuals per size class and fits a binomial model (frequentist or Bayesian). Finds SM50 by generating new data from the model rather than from ratio of parameters
R scripts Mainguy et al. rafamoral/L50: Monitoring reproduction in fish: Assessing the adequacy of ogives and the predicted uncertainty of their L50 estimates for more reliable biological inferences Over a dozen methods for estimating L50 values and obtaining confidence intervals from (frequentist or Bayesian) binomial models (Delta, Fieller, bootstrap resampling, profile-likelihood, etc.). See accompanying manuscript by Mainguy et al. (2024).
R script Alastair V. Harry Alharry/Maturity.ogive.R Includes bootstrap resampling to obtain 95% CIs

Installation

You can install the development version of morphmat from GitHub with:

# install.packages("devtools")
devtools::install_github("rmk118/morphmat")

Articles/vignettes

Basic Examples

library(morphmat)

set.seed(12) # for reproducibility when generating the simulated data

# Generate a simulated dataset with known size at maturity
fc <- fake_crustaceans(
  error_scale = 17,
  slope = 9,
  L50 = 75,
  n = 800,
  allo_params = c(0.9, 0.25, 1.05, 0.2),
  x_mean = 85
)

Compare estimates from all piecewise regression methods:

piecewise_mods(fc, xvar = "x", yvar = "y", method = "all")
#>                chngpt             segmented               REGRANS 
#>              67.68312              63.95451              67.67091 
#>               Stevens   Two_line.breakpoint Two_line.intersection 
#>              68.33387              75.43651              56.76587

Clustering methods

Compare all clustering methods

all_clusters <- cluster_mods(fc, xvar = "x", yvar = "y", method = c("all"), plot = TRUE)

Somerton method:

out_df <- somerton(fc, xvar = "x", yvar = "y")[[1]]
mod <- glm(data = out_df, pred_mat_num ~ x, family = binomial(link = "logit"))
unname(-coef(mod)[1] / coef(mod)[2])
#> [1] 77.70282

References

Katsanevakis, Stelios. 2006. “Modelling Fish Growth: Model Selection, Multi-Model Inference and Model Selection Uncertainty.” Fisheries Research 81 (2): 229–35. https://doi.org/10.1016/j.fishres.2006.07.002.

Mainguy, Julien, Martin Bélanger, Geneviève Ouellet-Cauchon, and Rafael de Andrade Moral. 2024. “Monitoring Reproduction in Fish: Assessing the Adequacy of Ogives and the Predicted Uncertainty of Their L50 Estimates for More Reliable Biological Inferences.” Fisheries Research 269 (January): 106863. https://doi.org/10.1016/j.fishres.2023.106863.