ELEFAN_GA_boot {fishboot}R Documentation

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
)

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).

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.

References

Examples

# 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



# 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


[Package fishboot version 1.0.2 Index]