Simulations: Generate simulations for stochastic modeling of population...

Description Usage Arguments Value Examples

View source: R/model_functions.R

Description

Simulate environmental stochasticity for surivial, spawning, and number of eggs using age-specific empirical data. Simulated data are used by PopProjections to calculate population trajections (lambda).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
Simulations(
  data,
  prob,
  std,
  recruitment = 5,
  minb = 0,
  maxb = NULL,
  iters = 10,
  seed = NULL,
  type = c("survival", "spawning", "numeggs")
)

Arguments

data

Dataframe containing age-specific probabilities for survival, spawning, or number of eggs along with standard deviations (errors)

prob

Column name in data containing age-specific probabilities or count.

std

Column name in data containing error of probabilities.

recruitment

Used only for "survival" option. Value (default = 5) denotes period of successful recruitment.

minb

Used only for "numeggs" option. Value passed on to stretchbetaval; default = 0.

maxb

Used only for "numeggs" option. Value passed on to stretchbetaval; default = NULL; if NULL value will be 3 times data[[prob]]

iters

Scalar integer. Number of iterations to perform. Default 10; function will slow with higher (i.e., > 5000) value.

seed

Numeric value passed to set.seed to ensure repeatability.

type

Scalar character as one of three options: "survival"; "spawning"; or "numeggs". Choose one based on desired simulation. Default = "survival".

Value

A matrix of model simulations (varies depending on argument supplied to type). Matrix is of class simulations.

Examples

1
# code here

jasondubois/spopmodel documentation built on Dec. 4, 2019, 9:12 p.m.