create_fields | R Documentation |
create_fields
parametrises and returns the
spatio-temporal fields used for the spatial distribution of fish populations
and movement in space and time for the simulations.
The spatio-temporal fields are generated using
spate.sim
function from the spate package
using an advective-diffusion Stochastic Partial Differential Equation
(SPDE). See Lindgren 2011 and Sigrist 2015 for further detail.
create_fields(
npt = 1000,
t = 1,
seed = 123,
n.spp = NULL,
spp.ctrl = NULL,
plot.dist = FALSE,
plot.file = getwd()
)
npt |
Numeric integer with the dimensions of the field in npt * npt |
t |
Numeric integer with the number of time-steps in the simulation |
seed |
(Optional) Numeric integer with the seed for the simulation |
n.spp |
Numeric integer with the number of species to be simulated. Each species must have an individual control list as detailed below. |
spp.ctrl |
List of controls to generate each species spatio-temporal distribution. Must be of the form spp.ctrl = list(spp.1 = c(rho0 = 0.001, ...), spp.2 = c(rho0 = 0.001, ..),..) and contain the following:
|
plot.dist |
Boolean, whether to plot the distributions to file |
plot.file |
path to save the plots of the species distributions |
Silently returns a list of spatial distributions with first level of
the list being the population (1 -> n.spp) and the second being time (1 ->
t). If plot.dist = TRUE
it produces an image of the spatial
distributions at each time step for each of the populations saved to the
working directory (unless specified otherwise in plot.file
)
fields <- create_fields(n.spp = 1, t = 2,
spp.ctrl = list(
'spp.1' = c('rho0' = 0.1, 'sigma2' = 1, 'zeta' = 0.1,
'rho1' = 0.01, 'gamma' = 0.3, 'alpha' = pi/4,
'muX' = -0.05, 'muY' = -0.05, 'tau2' = 0, 'nu' = 1.5)),
plot.dist = TRUE, plot.file = getwd())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.