Builds the catchability matrix from where stocks live and where (and how) metiers fish, instead of writing it by hand:
Arguments
- cells
data frame with
depth,substrateandarea(any units).- species
data frame with
species,depth_mean,depth_sdand one column per substrate level (weights, e.g.mud,sand,hard; missing levels get weight 0, all missing = 1).- metiers
data frame with
metier,depth_min,depth_maxand optionalsubstrate(levels separated by;, empty = all).- selectivity
gear selectivity: a matrix (metiers x species, with dimnames) or a data frame with a
metiercolumn and one column per stock. Values 0-1.- q0
catchability at average density and selectivity 1.
Value
A catchability matrix (metiers x stocks) with attributes
distribution (cells x stocks), ground (cells x metiers, 0/1) and
overlap (share of each stock on each ground).
Details
the seabed is a set of
cellswith a depth, a substrate and an area;each stock's habitat suitability in a cell is a normal depth preference times a substrate weight; its distribution over the cells is suitability x area, normalised to 1;
each metier fishes a ground (a depth range and a set of substrates) with a gear selectivity for each stock.
The catchability of metier j for stock s is
i.e. q0 x selectivity x the stock's density on the ground relative to its
average density. A stock spread evenly over the whole seabed has
q = q0 x sel on every ground. The level of each stock's column is usually
set afterwards by ms_condition(); the landscape gives its shape (which
metiers catch the stock, and how strongly relative to each other).
Examples
cells <- expand.grid(depth = seq(2.5, 77.5, 5), substrate = c("mud", "sand"))
cells$area <- 1
sp <- data.frame(species = c("A", "B"), depth_mean = c(15, 60), depth_sd = 10,
mud = c(1, 0.2), sand = c(0.2, 1))
mt <- data.frame(metier = c("inner", "outer"), depth_min = c(0, 40), depth_max = c(40, 80))
sel <- matrix(1, 2, 2, dimnames = list(mt$metier, sp$species))
round(ms_landscape(cells, sp, mt, sel), 5)
#> A B
#> inner 0.00199 0.00004
#> outer 0.00001 0.00196
#> attr(,"distribution")
#> A B
#> [1,] 8.137464e-02 2.248003e-09
#> [2,] 1.341641e-01 3.516468e-08
#> [3,] 1.722701e-01 4.283935e-07
#> [4,] 1.722701e-01 4.064484e-06
#> [5,] 1.341641e-01 3.003270e-05
#> [6,] 8.137464e-02 1.728263e-04
#> [7,] 3.843866e-02 7.745536e-04
#> [8,] 1.414079e-02 2.703458e-03
#> [9,] 4.051405e-03 7.348760e-03
#> [10,] 9.039906e-04 1.555732e-02
#> [11,] 1.570900e-04 2.564969e-02
#> [12,] 2.125982e-05 3.293486e-02
#> [13,] 2.240769e-06 3.293486e-02
#> [14,] 1.839335e-07 2.564969e-02
#> [15,] 1.175847e-08 1.555732e-02
#> [16,] 5.854200e-10 7.348760e-03
#> [17,] 1.627493e-02 1.124001e-08
#> [18,] 2.683282e-02 1.758234e-07
#> [19,] 3.445402e-02 2.141967e-06
#> [20,] 3.445402e-02 2.032242e-05
#> [21,] 2.683282e-02 1.501635e-04
#> [22,] 1.627493e-02 8.641313e-04
#> [23,] 7.687732e-03 3.872768e-03
#> [24,] 2.828158e-03 1.351729e-02
#> [25,] 8.102809e-04 3.674380e-02
#> [26,] 1.807981e-04 7.778662e-02
#> [27,] 3.141800e-05 1.282485e-01
#> [28,] 4.251964e-06 1.646743e-01
#> [29,] 4.481537e-07 1.646743e-01
#> [30,] 3.678670e-08 1.282485e-01
#> [31,] 2.351695e-09 7.778662e-02
#> [32,] 1.170840e-10 3.674380e-02
#> attr(,"ground")
#> inner outer
#> [1,] 1 0
#> [2,] 1 0
#> [3,] 1 0
#> [4,] 1 0
#> [5,] 1 0
#> [6,] 1 0
#> [7,] 1 0
#> [8,] 1 0
#> [9,] 0 1
#> [10,] 0 1
#> [11,] 0 1
#> [12,] 0 1
#> [13,] 0 1
#> [14,] 0 1
#> [15,] 0 1
#> [16,] 0 1
#> [17,] 1 0
#> [18,] 1 0
#> [19,] 1 0
#> [20,] 1 0
#> [21,] 1 0
#> [22,] 1 0
#> [23,] 1 0
#> [24,] 1 0
#> [25,] 0 1
#> [26,] 0 1
#> [27,] 0 1
#> [28,] 0 1
#> [29,] 0 1
#> [30,] 0 1
#> [31,] 0 1
#> [32,] 0 1
#> attr(,"overlap")
#> A B
#> inner 0.993836581 0.0221124
#> outer 0.006163419 0.9778876