Learn R Programming

fishboot (version 1.0.2)

ELEFAN_GA_boot: Bootstraped ELEFAN_GA

Description

This function performs a bootstrapped fitting of a von Bertalanffy growth function (VBGF) via the ELEFAN_GA function. Most of the arguments are simply passed to the function within many permutations (resampling) of the original lfq data. As the original function, ELEFAN_GA also conducts Electronic LEngth Frequency ANalysis using a genetic algorithm (GA) to estimate growth parameters. Partial (repeated fitting on original data) and full bootstrap (with resampling) routines are possible, depending on resample.

Usage

ELEFAN_GA_boot(
  lfq,
  seasonalised = FALSE,
  low_par = NULL,
  up_par = NULL,
  popSize = 50,
  maxiter = 100,
  run = maxiter,
  parallel = FALSE,
  pmutation = 0.1,
  pcrossover = 0.8,
  elitism = base::max(1, round(popSize * 0.05)),
  MA = 5,
  addl.sqrt = FALSE,
  agemax = NULL,
  ...,
  seed = NULL,
  nresamp = 10,
  resample = TRUE,
  outfile = NA
)

Value

An object of class lfqBoot containing 2 levels:

$bootRaw

A data.frame of fitted VBGF parameters (columns) by resampling (rows).

$seed

A numeric vector of seed values set prior to each resampling call to lfqResample.

Arguments

lfq

a length frequency object of the class lfq (see lfqCreate).

seasonalised

logical; indicating if the seasonalised von Bertalanffy growth function should be applied (default: FALSE).

low_par

a list providing the minimum of the search space in case of real-valued or permutation encoded optimizations. When set to NULL the following default values are used:

  • Linf length infinity in cm (default is calculated from maximum length class in the data),

  • K curving coefficient (default: 0.01),

  • t_anchor time point anchoring growth curves in year-length coordinate system, corresponds to peak spawning month (range: 0 to 1, default: 0),

  • C amplitude of growth oscillation (range: 0 to 1, default: 0),

  • ts summer point (ts = WP - 0.5) (range: 0 to 1, default: 0);

up_par

a list providing the maximum of the search space in case of real-valued or permutation encoded optimizations. When set to NULL the following default values are used:

  • Linf length infinity in cm (default is calculated from maximum length class in the data),

  • K curving coefficient (default: 1),

  • t_anchor time point anchoring growth curves in year-length coordinate system, corresponds to peak spawning month (range: 0 to 1, default: 1),

  • C amplitude of growth oscillation (range: 0 to 1, default: 1),

  • ts summer point (ts = WP - 0.5) (range: 0 to 1, default: 1);

popSize

the population size. Default: 50

maxiter

the maximum number of iterations to run before the GA search is halted. default:100

run

the number of consecutive generations without any improvement in the best fitness value before the GA is stopped. Default: equals maxiter.

parallel

Whether a logical or integer argument specifying the configuration of parallel computing. See ga for details.

pmutation

the probability of mutation in a parent chromosome. Usually mutation occurs with a small probability, and by default is set to 0.1.

pcrossover

the probability of crossover between pairs of chromosomes. Typically this is a large value and by default is set to 0.8.

elitism

the number of best fitness individuals to survive at each generation. By default the top 5% individuals will survive at each iteration.

MA

number indicating over how many length classes the moving average should be performed (default: 5, for more information see lfqRestructure)

addl.sqrt

additional square root transformation of positive values according to Brey et al. (1988) (default: FALSE, for more information see lfqRestructure)

agemax

maximum age of species; default NULL, then estimated from \(L_{inf}\).

...

additional parameters to pass to ga.

seed

seed value for random number reproducibility.

nresamp

numeric, the number of permutations to run (by default nresamp = 10).

resample

logical. Do you want that lfq object be resampled (TRUE by default).

outfile

character; path of the file which will register the progress of the permutation completions. If it is set as false, NA or NULL, no file will be created.

Details

If resample = TRUE, a full non-parametric bootstrap is performed with resampling from the original length-frequencies by using the function lfqResample. Otherwise, if resample = FALSE, a partial bootstrap is performed, reflecting solution variation due only to the search algorithm, with repeated fitting to the original data (no resampling is performed).

References

  • Brey, T., Soriano, M., and Pauly, D. 1988. Electronic length frequency analysis: a revised and expanded user's guide to ELEFAN 0, 1 and 2.

  • Efron, B., & Tibshirani, R. (1986). Bootstrap methods for standard errors, confidence intervals, and other measures of statistical accuracy. Statistical Science, 54-75.

  • Mildenberger, T., Taylor, M. H., & Wolff, A. M., 2017. TropFishR: an R package for fisheries analysis with length-frequency data. Methods in Ecology and Evolution, 8(11), 1520-1527.

  • Pauly, D. 1981. The relationship between gill surface area and growth performance in fish: a generalization of von Bertalanffy's theory of growth. Meeresforsch. 28:205-211.

  • Pauly, D. and N. David, 1981. ELEFAN I, a BASIC program for the objective extraction of growth parameters from length-frequency data. Meeresforschung, 28(4):205-211.

  • Schwamborn, R., Mildenberger, T. K., & Taylor, M. H., 2019. Assessing sources of uncertainty in length-based estimates of body growth in populations of fishes and macroinvertebrates with bootstrapped ELEFAN. Ecological Modelling, 393, 37-51.

  • Schwamborn, R., Freitas, M. O., Moura, R. L., & Aschenbrenner, A. 2023. Comparing the accuracy and precision of novel bootstrapped length-frequency and length-at-age (otolith) analyses, with a case study of lane snapper (Lutjanus synagris) in the SW Atlantic. Fisheries Research, 264, 106735.

  • Scrucca, L., 2013. GA: a package for genetic algorithms in R. Journal of Statistical Software, 53(4), 1-37.

  • von Bertalanffy, L., 1938. A quantitative theory of organic growth. Human Biology 10, 181-213.

Examples

Run this code
# load data
data("alba", package = "TropFishR")

# Define settings (for demo only, fast settings)
MA        <- 7
low_par   <- list(Linf = 9, K = 0.4, t_anchor = 0.5, C = 0, ts = 0)
up_par    <- list(Linf = 11, K = 0.6, t_anchor = 0.8, C = 1, ts = 1)
popSize   <- 12
maxiter   <- 5
run       <- 4
pmutation <- 0.1
nresamp   <-  2

# Non-parallel version
res <- ELEFAN_GA_boot(lfq = alba, MA = MA, seasonalised = FALSE,
                      up_par = up_par, low_par = low_par,
                      parallel = FALSE,
                      popSize = popSize, maxiter = maxiter,
                      run = run, pmutation = pmutation,
                      nresamp = nresamp)

res


# \donttest{
# Define settings (for demo only)
MA        <- 7
low_par   <- list(Linf = 8, K = 0.2, t_anchor = 0, C = 0, ts = 0)
up_par    <- list(Linf = 12, K = 0.9, t_anchor = 1, C = 1, ts = 1)
popSize   <- 40
maxiter   <- 30
run       <- 10
pmutation <- 0.2
nresamp   <-  3

# Parallel version
res <- ELEFAN_GA_boot(lfq = alba, MA = MA, seasonalised = FALSE,
                      up_par = up_par, low_par = low_par,
                      parallel = TRUE,
                      popSize = popSize, maxiter = maxiter,
                      run = run, pmutation = pmutation,
                      nresamp = nresamp)

res
# }

Run the code above in your browser using DataLab