Calculates movement matrices from user specified distribution among other areas
Source:R/Movement_calcs.R
simmov2.Rd
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.
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
.
Note
Array mov
is age-specific, but currently the movement generated by simmov
is
independent of age.
Examples
if (FALSE) {
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")
}