survey-spatial-modelling: Spatial modeling of survey data

fit_survey_setsR Documentation

Spatial modeling of survey data

Description

Implements geostatistical models of trawl or longline survey data.

Usage

fit_survey_sets(
  dat,
  years,
  survey = NULL,
  density_column = "density_kgpm2",
  required_obs_percent = 0.05,
  utm_zone = 9,
  include_depth = TRUE,
  survey_boundary = NULL,
  premade_grid = NULL,
  tmb_knots = 200,
  cell_width = 2,
  family = sdmTMB::tweedie(),
  ...
)

Arguments

dat

Output from gfdata::get_survey_sets().

years

The year to include in the model. Should be a single year.

survey

The survey abbreviation. Should match the contents of the column survey_abbrev in the data frame returned by gfdata::get_survey_sets().

density_column

The name of the column that includes the relative biomass density to use. E.g. "density_kgpm2" for trawl surveys or "density_ppkm2" for the long line surveys.

required_obs_percent

A required fraction of positive sets before a model is fit.

utm_zone

The UTM zone to perform the modeling in. Defaults to zone 9.

include_depth

Logical: should depth be included as a predictor? If FALSE then the model will only have a spatial random field as the predictor.

survey_boundary

If not NULL, a data frame with the survey boundary defined in columns X and Y in longitude and latitude coordinates. If NULL, the functions will search for a matching element in the included the data object gfplot::survey_boundaries based on the survey argument (after removing "SYN" from the name).

premade_grid

If not NULL, a list object with an element grid that contains a data frame with columns X, Y, and depth, and another element cell_area the content a single numeric value describing the grid size in kilometers. The package includes a survey grid for the HBLL surveys in gfplot::hbll_grid.

tmb_knots

The number of knots to pass to sdmTMB::sdmTMB().

cell_width

The cell width if a prediction grid is made on the fly.

family

Family

...

Any other arguments to pass on to the modelling function.

Examples

## Not run: 
set.seed(123)
# pop_surv <- gfdata::get_survey_sets("pacific ocean perch")
# or use built-in data:
fit <- fit_survey_sets(pop_surv,
  years = 2015,
  survey = "SYN QCS")
names(fit)
plot_survey_sets(fit$predictions, fit$data, fill_column = "combined")

## End(Not run)

pbs-assess/gfplot documentation built on March 14, 2024, 3:20 p.m.