R/sim_dist_spde.R
sim_ays_covar_spde.Rd
sim_ays_covar_spde(
sd = 2.8,
range = 300,
model = "spde",
phi_age = 0.5,
phi_year = 0.9,
group_ages = 5:20,
group_years = NULL,
mesh,
barrier.triangles
)
Variance of the process (can be age-specific).
Decorrelation range.
Either "barrier"
or "spde"
; determines how the precision matrix Q
is generated.
Autocorrelation through ages. Can be a single value or a vector the same length as ages
.
Autocorrelation through years. Can be a single value or a vector the same length as years
.
Ages to group together for shared space-age-year variance.
Years to group together for shared space-age-year variance.
The mesh used to generate the precision matrix.
The set of mesh triangles that define the barrier (used only in the barrier model).
A function that can be passed to sim_distribution()
as the ays_covar
argument.
Returns a function for use inside sim_distribution()
to generate the error term.
# \donttest{
if (requireNamespace("INLA")) {
# Make a grid
my_grid <- make_grid(res = c(10, 10))
# Make a mesh based on the grid
my_mesh <- make_mesh(my_grid)
# Simulate and plot
sim <- sim_abundance(ages = 1:10, years = 1:10) |>
sim_distribution(
grid = my_grid,
ays_covar = sim_ays_covar_spde(
phi_age = 0.8,
phi_year = 0.1,
model = "spde",
mesh = my_mesh
),
depth_par = sim_parabola(mu = 200, sigma = 50)
)
plot_distribution(sim, ages = 1:5, years = 1:5, type = "heatmap")
}
# }