simmov2: Calculates movement matrices from user specified distribution...

View source: R/Movement_calcs.R

simmov2R Documentation

Calculates movement matrices from user specified distribution among other areas

Description

A wrapper function for makemov2 used to generate movement matrices for the operating model. Calculates a movement matrix from user-specified relative movement to other areas and probability of staying in the area in each time step.

Usage

simmov2(
  OM,
  dist = c(0.05, 0.6, 0.35),
  distE = 0.01,
  frac_other = matrix(c(NA, 2, 1, 3, NA, 1, 1, 4, NA), nrow = 3, byrow = T),
  frac_otherE = 0.01,
  prob = 0.8,
  probE = 1,
  figure = TRUE
)

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.

distE

Logit (normal) St.Dev error for sampling desired fraction in each area

frac_other

A matrix (nareas rows from, nareas columns to) of relative fractions moving to other areas (the positive diagonal (staying) is unspecified).

frac_otherE

Logit (normal) St.Dev error for sampling desired fraction moving to other areas.

prob

the mean probability of staying in the same area among all areas

probE

Logit (normal) St.Dev error for sampling desired probability of staying in each area

figure

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

Value

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

Functions

  • simmov2(): Estimation function for creating movement matrix.

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

## Not run: 
movOM_3areas <- simmov2(testOM, frac_other = matrix(c(NA,2,1, 2,NA,1, 1,2,NA),
nrow=3, byrow=T), frac_otherE = 0.01, prob = 0.8, probE = 0.3)
# sim 1, age 1, movement from areas in column i to areas in row j
movOM_3areas@cpars$mov[1, 1, , ] 
plot_mov(movOM_3areas@cpars$mov)
plot_mov(movOM_3areas@cpars$mov, type = "all")


## End(Not run)

Blue-Matter/MSEtool documentation built on Dec. 23, 2024, 7:23 a.m.