spatiotemp_censored_index_fun_sdmTMB: Compute Spatio-temporal Poisson-lognormal model-based indices...

View source: R/spatiotemp_censored_index_fun_sdmTMB.R

spatiotemp_censored_index_fun_sdmTMBR Documentation

Compute Spatio-temporal Poisson-lognormal model-based indices of relative abundance using sdmTMB See the vignette for details

Description

Compute Spatio-temporal Poisson-lognormal model-based indices of relative abundance using sdmTMB See the vignette for details

Usage

spatiotemp_censored_index_fun_sdmTMB(
  data,
  survey_boundaries,
  species,
  M = 1000,
  return = T,
  ICR_adjust = F,
  cprop = 1.1,
  keep = F,
  use_upper_bound = FALSE,
  upper_bound_quantile = 1,
  plot = T,
  allyears = F,
  station_effects = T,
  seed = 0,
  verbose = F,
  n_trajectories = 10,
  preserve_inter_regional_differences = F,
  mesh,
  sdpe,
  pixels,
  spatiotemporal = "AR1",
  covs = NULL,
  grf_priors = sdmTMBpriors()
)

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.

keep

a logical stating if you want to return the sdmTMB 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

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.

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.

mesh

an INLA::inla.mesh.2d object

pixels

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

spatiotemporal

character string "IID", "AR1", "RW", or "off". Do you want to identify temporal changes in relative abundance uniquely across space? Almost always yes.

covs

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

grf_priors

a sdmTMBpriors() object specifying pcmatern priors on al grfs.

spde

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

prev_fit

a previous sdmTMB model fit (probably returned using keep=T). Speeds up model fitting dramatically


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