simmov: Calculates movement matrices from user inputs

Description Usage Arguments Value Functions Note Author(s) Examples

View source: R/Movement_calcs.R

Description

A wrapper function for makemov used to generate movement matrices for a DLMtool operating model. Calculates a movement matrix from user-specified unfished stock biomass fraction in each area and probability of staying in the area in each time step.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
simmov(
  OM,
  dist = c(0.1, 0.2, 0.3, 0.4),
  prob = 0.5,
  distE = 0.1,
  probE = 0.1,
  prob2 = NA,
  figure = TRUE
)

plot_mov(mov, age = 1, type = c("matrix", "all"))

Arguments

OM

Operating model, an object of class OM.

dist

A vector of fractions of unfished stock in each area. The length of this vector will determine the number of areas (nareas) in the OM.

prob

Mean probability of staying across all areas (single value) or a vector of the probability of individuals staying in each area (same length as dist)

distE

Logit (normal) St.Dev error for sampling stock fractions from the fracs vector

probE

Logit (normal) St.Dev error for sampling desired probability of staying either by area (prob is same length as dist) or the mean probability of staying (prob is a single number)

prob2

Optional vector as long as prob and dist. Upper bounds on uniform sampling of probability of staying, lower bound is prob.

figure

Logical to indicate if the movement matrix will be plotted (mean values and range across OM@nsim simulations.)

mov

A four-dimensional array of dimension c(nsim, maxage, nareas, nareas) specifying movement in the operating model.

age

An age from 1 to maxage for the movement-at-age matrix figure when type = "matrix".

type

Whether to plot a movement matrix for a single age ("matrix") or the full movement versus age figure ("all")

Value

The operating model OM with movement parameters in slot cpars. The mov array is of dimension nsim, maxage, nareas, nareas.

Functions

Note

Array mov is age-specific, but currently the movement generated by simmov is independent of age.

Author(s)

T. Carruthers and Q. Huynh

Examples

1
2
3
4
movOM_5areas <- simmov(testOM, dist = c(0.01,0.1,0.2,0.3,0.39), prob = c(0.1,0.6,0.6,0.7,0.9))
movOM_5areas@cpars$mov[1, 1, , ] # sim 1, age 1, movement from areas in column i to areas in row j
plot_mov(movOM_5areas@cpars$mov)
plot_mov(movOM_5areas@cpars$mov, type = "all")

tcarruth/MSEtool documentation built on Oct. 19, 2020, 6:09 a.m.