sampling: Sampling

View source: R/sampling.R

samplingR Documentation

Sampling

Description

sampling samples from the current population to update the Count array.

Usage

sampling(
  t,
  cr,
  fdr,
  Delta,
  Gamma,
  Abundance,
  Transects = 24,
  X,
  Count,
  NuS,
  A = 5,
  Ind_sampled = "all"
)

Arguments

t

temporary numeric value, the current time step.

cr

temporary numeric value, the current control rule.

fdr

temporary numeric value, the current final target density ratio.

Delta

numeric value, the proportion of positive transects divided by depletion, also known as the constant of proportionality

Gamma

numeric value, the average value of a positive transect divided by depletion

Abundance

numeric array, the total number of all and/or mature individuals in each area, at each timestep, under all control rules, with all estimates of natural mortality.

Transects

numerical value, the number of sampling transects conducted in each area to estimate density ratio. Default value is 24.

X

numeric value, the average value of individuals seen during positive transects.

Count

numeric array, the number of individuals estimated to be in each area, at each timestep, under each control rule, for each estimate of natural mortality, for both all individuals and just mature individuals.

NuS

numeric array, the sampling normal variable pulled from a normal distribution with mean 0 and sd Sigma_S.

A

numeric value, the number of total areas in the model. Default value is 5.

Ind_sampled

character value, the individuals to be sampled to calculate density ratio. Values can be: 'all' - sample all individuals. 'mature' - sample only mature individuals. Default value is 'all'.

Value

a two-dimentional numeric array with updated observed counts for the fished species in this particular area, at this particular timestep, under this particular control rule.

Examples

n = 34; A = 5; TimeT = 70; CR = 6; FDR = 4; Transects = 24
Abundance <- array(rep(340, A*TimeT*CR*FDR*1), c(A, TimeT, CR, FDR, 1))
Count <- array(rep(50, A*TimeT*Transects*2*CR*FDR),
   c(A, TimeT, Transects, 2, CR, FDR))
NuS <- array(rnorm(A*TimeT*Transects*1*CR*FDR, 0, 0.89),
   c(A, TimeT, Transects, 1, CR, FDR))
sampling(t = 51, cr = 1, fdr = 1, Delta = 1.6, Gamma = 31.6,
   Abundance, Transects, X = 15.42, Count, NuS, A, Ind_sampled = 'all')

vquennessen/densityratio documentation built on Aug. 28, 2022, 5:36 p.m.