runBootstrap: Run a bootstrap in StoX

Description Usage Arguments Details Value

View source: R/rstox_boostrap.r

Description

runBootstrap is a wrapper function for the bootstrap functions below. runBootstrap_1.6 runs the bootstrap of Rstox 1.6. The bootstrap changed from Rstox 1.6 to 1.7, by applying sorting prior to sampling, and different results (but with the same expected value) should be expected. Using runBootstrap_1.6 identical results from previous runs should be expected. runBootstrap_AcousticTrawl runs a simple bootstrap of biotic PSUs within strata. runBootstrap_SweptAreaLength runs a simple bootstrap of biotic PSUs within strata. runBootstrap_SweptAreaTotal runs a simple bootstrap of biotic PSUs within strata. getBootstrapLevels is used for extracting either a matrix of bootstrap variables and domains, or the function specified by the user. getBootstrapMethod gets the bootstrap method based on the inputs 'bootstrapMethod', 'acousticMethod' and 'bioticMethod'.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
runBootstrap(projectName, bootstrapMethod = "AcousticTrawl",
  acousticMethod = PSU ~ Stratum, bioticMethod = PSU ~ Stratum, nboot = 5,
  startProcess = "TotalLengthDist", endProcess = "SuperIndAbundance",
  seed = 1, cores = 1, msg = TRUE, sorted = TRUE, ...)

runBootstrap_1.6(projectName, bootstrapMethod = "AcousticTrawl",
  acousticMethod = PSU ~ Stratum, bioticMethod = PSU ~ Stratum, nboot = 5,
  startProcess = "TotalLengthDist", endProcess = "SuperIndAbundance",
  seed = 1, cores = 1, msg = TRUE, ...)

runBootstrap_AcousticTrawl(projectName, acousticMethod = PSU ~ Stratum,
  bioticMethod = PSU ~ Stratum, nboot = 5,
  startProcess = "TotalLengthDist", endProcess = "SuperIndAbundance",
  seed = 1, cores = 1, msg = TRUE, sorted = TRUE, ...)

runBootstrap_SweptAreaLength(projectName, acousticMethod = NULL,
  bioticMethod = PSU ~ Stratum, nboot = 5,
  startProcess = "TotalLengthDist", endProcess = "SuperIndAbundance",
  seed = 1, cores = 1, msg = TRUE, sorted = TRUE, ...)

runBootstrap_SweptAreaTotal(projectName, acousticMethod = NULL,
  bioticMethod = PSU ~ Stratum, startProcess = "SweptAreaDensity",
  endProcess = NULL, nboot = 5, seed = 1, cores = 1,
  ignore.case = TRUE, sorted = TRUE, ...)

getBootstrapLevels(x)

getBootstrapMethod(bootstrapMethod = "AcousticTrawl", acousticMethod = PSU ~
  Stratum, bioticMethod = PSU ~ Stratum, ...)

Arguments

projectName

The name or full path of the project, a baseline object (as returned from getBaseline or runBaseline, og a project object (as returned from openProject).

bootstrapMethod

The method to use for the bootstrap. Currently implemented are given in the following table:

bootstrapMethod Description AcousticTrawl Bootstrap of acoustic tralw surveys, where both acoustic and biotic data are resampled
SweptAreaLength Bootstrap only biotic data with length information
SweptAreaTotal For surveys with information only about total catch (count or weight), bootstrap biotic stations
acousticMethod, bioticMethod

Specification of the method to use for bootstrapping the acoustic and biotic data. Currently only one method is available for acoustic and one for biotic data: acousticMethod = PSU~Stratum, bioticMethod = PSU~Stratum. Other methods are planned in later versions, involving the levels of the data given in the below table.

Level Acoustic Biotic
Survey Survey Survey
Stratum Stratum Stratum
Assignment Not relevant Assignment of biotic station groups to acoustic PSUs
PSU Acoustic data averaged over e.g. one tansect Biotic station group
EDSU Acoustic data averaged over e.g. one nmi Biotic station
Sample Ping Individal catch sample
nboot

Number of bootstrap replicates.

startProcess

The start process of the bootstrapping, being the first process before which biostations has been assigned and NASC values have been calculated.

endProcess

The end process of the bootstrapping, being the process returning a matrix containing the following columns: "Stratum", "Abundance", "weight", and grouping variables such as "age", "SpecCat", "sex".

seed

The seed for the random number generator (used for reproducibility).

cores

An integer giving the number of cores to run the bootstrapping over.

msg

Logical: if TRUE print messages from runBaseline().

sorted

Should the data be sorted prior to sampling?

...

Used for backwards compatibility.

ignore.case

Logical: If TRUE, ingore case when splitting by species category SpecCat.

Details

Resample (bootstrap) trawl stations based on swept area data and possibly also acoustic data to estimate uncertainty in estimates. By the default method (bootstrapMethod="AcousticTrawl"), the acoustic transect values (mean NASC along transects) and biotic stations (trawls) are resampled with replacement within each stratum for each bootstrap replicate, and the StoX project rerun and super individual abundance recalculated (or the output from a different process given by endProcess).

Value

list with (1) the abundance by length in the orginal model, (2) the abundance by length in the bootstrap run, (3) the abundance by super individuals in the orginal model, (4) the abundance by super individuals in the bootstrap run


Sea2Data/Rstox documentation built on April 18, 2018, 11:11 p.m.