ELEFAN_SA_boot {fishboot}R Documentation

Bootstraped ELEFAN_SA

Description

This function performs a bootstrapped fitting of a von Bertalanffy growth function (VBGF) via the ELEFAN_SA function. Most of the arguments are simply passed to the function within many permutations (resampling) of the original lfq data. Partial (repeated fitting on original data) and full bootstrap (with resampling) routines are possible, depending on resample.

Usage

ELEFAN_SA_boot(
  lfq,
  seasonalised = FALSE,
  init_par = list(Linf = 50, K = 0.5, t_anchor = 0.5, C = 0, ts = 0),
  low_par = NULL,
  up_par = NULL,
  SA_time = 60 * 1,
  maxit = NULL,
  nb.stop.improvement = NULL,
  SA_temp = 1e+05,
  MA = 5,
  addl.sqrt = FALSE,
  agemax = NULL,
  seed = NULL,
  nresamp = 10,
  resample = TRUE,
  parallel = FALSE,
  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).

init_par

a list providing the Initial values for the components to be optimized. When set to NULL the following default values are used:

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

  • K curving coefficient (default: 0.5),

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

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

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

low_par

a list providing the lower bounds for components. 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 upper bounds for components. 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);

SA_time

numeric; Maximum running time in seconds (default : 60 * 1).

maxit

Integer. Maximum number of iterations of the algorithm. Default is NULL.

nb.stop.improvement

Integer. The program will stop when there is no any improvement in 'nb.stop.improvement' steps. Default is NULL

SA_temp

numeric; Initial value for temperature (default : 1e5).

MA

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

addl.sqrt

Passed to lfqRestructure. Applied an 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}.

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

parallel

Whether a logical or integer argument specifying the configuration of parallel computing. If parallel = TRUE, the number of threads will be defined as parallel::detectCores() - 2.

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)
init_par <- list(Linf = 10, K = 0.5, t_anchor = 0.6, C = 0.5, ts = 0.5)
SA_time  <- 1.5
SA_temp  <- 1e5
nresamp  <- 2

# Non-parallel bootstrapped curve fiting
res <- ELEFAN_SA_boot(lfq = alba, MA = MA, seasonalised = FALSE,
                      init_par = init_par, up_par = up_par, low_par = low_par,
                      SA_time = SA_time, SA_temp = SA_temp,
                      nresamp = nresamp)

res


# Define settings (for demo only)
MA       <- 7
low_par  <- list(Linf = 8, K = 0.1, t_anchor = 0, C = 0, ts = 0)
init_par <- list(Linf = 12, K = 0.5, t_anchor = 0.5, C = 0.5, ts = 0.5)
up_par   <- list(Linf = 15, K = 5, t_anchor = 1, C = 1, ts = 1)
SA_time  <- 10
SA_temp  <- 1e5
nresamp  <- 12

# parallel version
res <- ELEFAN_SA_boot(lfq = alba, MA = MA, seasonalised = FALSE,
                      init_par = init_par, up_par = up_par, low_par = low_par,
                      SA_time = SA_time, SA_temp = SA_temp,
                      nresamp = nresamp,
                      parallel = TRUE)

res


[Package fishboot version 1.0.2 Index]