sim_distribution | R Documentation |
Provided an abundance at age matrix and a survey grid to populate, this function applies correlated space, age and year error to simulate the distribution of the population. The ability to simulate distributions by length is yet to be implemented.
sim_distribution(
sim,
grid = make_grid(),
ays_covar = sim_ays_covar(),
depth_par = sim_parabola()
)
sim |
A list with ages, years and an abundance at age matrix like
produced by |
grid |
A stars object defining the survey grid, like |
ays_covar |
Closure for simulating age-year-space covariance,
like |
depth_par |
Closure for defining relationship between abundance and depth,
like |
This function simulates the probability of simulated fish inhabiting a cell as a function of a parabolic relationship with depth and space, age, and year autocorrelated errors. WARNING: it make take a long time to simulate abundance in a large grid across many ages and years - start small first.
Appends three objects to the sim
list:
grid
- A stars object with the grid details
grid_xy
- Grid details as a data.table in xyz format
sp_N
- A data.table with abundance split by age, year and cell
sim <- sim_abundance(ages = 1:5, years = 1:5) %>%
sim_distribution(grid = make_grid(res = c(20, 20)),
ays_covar = sim_ays_covar(phi_age = 0.8,
phi_year = 0.1),
depth_par = sim_parabola(mu = 200,
sigma = 50))
head(sim$sp_N)
head(sim$grid_xy)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.