View source: R/Movement_calcs.R
simmov | R Documentation |
A wrapper function for makemov used to generate movement matrices for the 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.
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"), year = 1, qval = 0.9)
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 ( |
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 |
mov |
A four-dimensional array of dimension |
age |
An age from 0 to maxage for the movement-at-age matrix figure when |
type |
Whether to plot a movement matrix for a single age ( |
year |
If |
qval |
The quantile to plot or report the range of values among simulations. |
The operating model OM
with movement parameters in slot cpars
.
The mov
array is of dimension nsim
, maxage
, nareas
, nareas
.
simmov()
: Estimation function for creating movement matrix.
plot_mov()
: Plotting function.
Array mov
is age-specific, but currently the movement generated by simmov
is
independent of age.
T. Carruthers and Q. Huynh
## Not run:
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")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.