grolenage_boot {fishboot}R Documentation

Bootstrapped length-at-age analysis

Description

This function obtains growth parameter estimates from length-at-age data. Since it internally uses the function growth_length_age, this function allows to perform different methods: Gulland and Holt, Ford Walford, Chapman, Bertalanffy, or non linear least squares method (LSM).

This function performs bootstrapped fitting of the von Bertalanffy growth function with estimated growth parameters (L_{inf}, K and t_0) from length-at-age data, based on the function growth_length_age. The output is an object containing the parameters L_{inf}, K and t_0 (named here t_anchor) as well as the growth performance index Phi’ (named PhiL).

Usage

grolenage_boot(
  param,
  method = "LSM",
  Linf_est = NA,
  Linf_init = 100,
  K_init = 0.1,
  t0_init = 0,
  seed = NULL,
  nresamp = 200,
  nan_action = c("nothing", "nanrm", "narm", "force"),
  time_lim = 5 * 60
)

Arguments

param

a list (or data.frame) consisting of following parameters (levels/columns):

  • age: age measurements (e.g. from otoliths),

  • length: corresponding length measurements.

method

indicating which of following methods should be applied: "GullandHolt", "FordWalford", "Chapman", "BertalanffyPlot", or "LSM" (it corresponds to the non-linear least squares fitting method, and is the default, which is recommended for bootstrapping growth).

Linf_est

BertalanffyPlot requires an estimate for L_{inf} to derive K and t_0 (for more information see Details).

Linf_init

initial parameter of L_{inf} for non-linear squares fitting (default 100).

K_init

initial parameter of K for non-linear squares fitting (default 0.1).

t0_init

initial parameter of L_0 for non-linear squares fitting (default 0).

seed

seed value for random number reproducibility (if it NULL by default, it will set internally as seed = as.numeric(Sys.time())).

nresamp

numeric; the number of permutations to run (Default: nresamp = 200).

nan_action

character that defines the action that the function will execute if there is a row with NaN (growth rate parameters inestimable for that resample):

  • nothing: the function will return the results including the NaNs (default).

  • nanrm or narm: after having the results, it will only returns the rows without NaNs. For this case narm and nanrm are equivalent, but it should be noted that the function will look for and omit the NaNs (and not the NAs). See Details.

  • force: The function will start an iterative process changing the internal seed values until it fulfills the nresamp. It only works together with the time_lim argument. See Details.

time_lim

If nan_action = "force", it defines the maximum time (in seconds) that the function will last resampling until it achieves a result output with no-NaN rows.

Details

It is important to take into account the particular considerations of each method regarding the required parameters, so it is recommended to read the Details of the documentation of growth_length_age.

CI and plotting arguments (of growth_length_age) are set as FALSE for each bootstrap call here. By default, growth_length_age generates a plot when it is called, so internally grolenage_boot executes a dev.off call in order to prevent it.

nan_action = "force" should be used carefully, as estimated NaN VBGF parameter values are not always a result of bootstrap data selection factors. Few resamples should first be tested with different Linf_init, K_init and t0_init values. No selection of the realistic initial parameters may also result in NaN values being obtained. The search time may depend on the size of the input set. For example, if you have many thousands of individuals or if (in addition) the value of nresamp is too high, it is possible that the function will take a long time before obtaining complete results. Even though time_lim avoids falling into an infinite loop by limiting the time used by this process to 5 minutes, this value is referential and might be insufficient due to the factors mentioned above.

t_anchor is the true t_0 estimate in the case of true length-at-age data, but it will only be available from "BertalanffyPlot" or "LSM" methods. For the other methods, a vector of NAs will be returned instead.

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.

References

Examples

# Synthetical length at age data
dat <- list(age = rep(x = 1:7,each = 15),
            length = c(rnorm(n = 15, mean = 4.6, sd = 4),
                       rnorm(n = 15, mean = 22.8, sd = 7),
                       rnorm(n = 15, mean = 35, sd = 7),
                       rnorm(n = 15, mean = 43, sd = 7),
                       rnorm(n = 15, mean = 49, sd = 5),
                       rnorm(n = 15, mean = 53, sd = 5),
                       rnorm(n = 15, mean = 57, sd = 3)))

# Perform bootstrapped curve fitting with grolenage_boot
res <- grolenage_boot(param = dat, nresamp = 70)

# Plot scatter histograms of Linf and K
LinfK_scatterhist(res = res)

# Plot univariate density plots of all parameters
univariate_density(res = res)

# Plot swarm plots of all n bootstraps
vbgfCI_time(res = res)

# Extract data.frame with all parameter estimates
# for comparisons of posterior distributions
print(res$bootRaw)

[Package fishboot version 1.0.2 Index]