spatiotemp_censored_index_fun: Fit spatio-temporal indices using the GMRF-SPDE approximation...

View source: R/spatiotemp_censored_index_fun.R

spatiotemp_censored_index_funR Documentation

Fit spatio-temporal indices using the GMRF-SPDE approximation of lindgren et al 2011 See the vignette for details

Description

Fit spatio-temporal indices using the GMRF-SPDE approximation of lindgren et al 2011 See the vignette for details

Usage

spatiotemp_censored_index_fun(
  data,
  survey_boundaries,
  species,
  M = 1000,
  return = T,
  ICR_adjust = F,
  cprop = 1.1,
  nthreads = 1,
  keep = F,
  use_upper_bound = FALSE,
  upper_bound_quantile = 1,
  plot = T,
  allyears = F,
  station_effects = T,
  prior_event = HT.prior(),
  prior_station = HT.prior(),
  init_vals = NULL,
  n_knots = 8,
  seed = 0,
  verbose = F,
  covs = NULL,
  spatiotemporal = F,
  mesh,
  spde,
  pixels,
  n_trajectories = 10,
  preserve_inter_regional_differences = F
)

Arguments

data

a sf points object containing the IPHC data

survey_boundaries

a sf polygons object containing the survey boundary definitions

species

a character name of the species (linked to the variables 'N_it' in the dataframe)

M

the number of independent Monte Carlo samples from the posterior used to compute indices

return

logical stating whether or not to return indices as a data.frame

ICR_adjust

A logical determining if the ICR-based scale-factor adjustment should be used

cprop

the minimum proportion of baits needed to be removed to induce censorship. If >1 no censorship.

nthreads

how many cores do you want to run in parallel when fitting the model?

keep

a logical stating if you want to return the INLA model object. Useful for inspecting DIC, properties etc.,

use_upper_bound

a logical stating if right-censored or interval-censored response (with concervative upper bound derived using Baranov Catch equation) is desired.

upper_bound_quantile

a proportion stating which quantiles of observation to remove censorship from. If greater than 1, do not remove censorship from any observation

plot

logical. Do you want to return a ggplot of the indices along with the data.frame?

allyears

logical determining if upper bound quantile is computed uniquely for each year (if False) or over all years (if TRUE)

station_effects

logical stating if IID station-station random effects wanted

prior_event

a prior distribution for the event-event IID random effect standard deviation (see HT.prior for default half t_7(0,1) distribution)

prior_station

a prior distribution for the station-station IID random effect standard deviation (see HT.prior for default half t_7(0,1) distribution)

init_vals

initial values for fitting model. If NULL let INLA choose them.

n_knots

the number of knots used for the temporal 'spline'. Default is 8. More knots means a 'wigglier' temporal effect is allowed, at a risk of higher variance.

seed

the seed used for Monte Carlo sampling. Note that 0 means the result is non-reproducible, but the code can be significantly faster.

verbose

logical. If TRUE, print INLA diagnostics on the console as the model fits. Can help to diagnose convergence issues.

covs

Currently not implemented. Please let me know if (spatio-temporal) environmental covariate functionality is wanted in a future version.

spatiotemporal

Logical. Do you want to identify temporal changes in relative abundance uniquely across space? Almost always yes.

mesh

An INLA inla.mesh.2d object (e.g. 'mesh' created in 'make_spatial_objects()')

spde

An INLA inla.spde2 or inla.rgeneric object (e.g. 'spde_mod' created in 'make_spatial_objects()')

pixels

A sf points (pixels) object used for plotting the maps of relative abundance

n_trajectories

integer specifying how many Monte Carlo sampled relative abundance indices to plot on a spaghetti plot. This can help with interpreting uncertainty. Suggested value 10.

preserve_inter_regional_differences

Logical if TRUE estimated inter-regional differences in mean abundance are shown at a cost of higher variance. Does not affect coastwide index.


pbs-assess/hookCompetition documentation built on April 27, 2023, 12:47 p.m.