mmmstan: Fit A Hidden Markov Movement Model via CmdStan and CmdStanR

mmmstanR Documentation

Fit A Hidden Markov Movement Model via CmdStan and CmdStanR

Description

The Stan model data may be specified by individual arguments or by passing a suitable data argument. The data argument takes precedence when it is non-null.

Usage

mmmstan(
  tag_data,
  list_regions,
  list_sizes,
  year_start,
  year_end,
  step_interval = "quarter",
  step_duration_max = NULL,
  days_duration_min = 90,
  colname_date_released = "date_released",
  colname_date_recovered = "date_recovered",
  colname_region_released = "region_released",
  colname_region_recovered = "region_recovered",
  colname_size_released = "size_released",
  movement_pattern = 2,
  movement_allow = NULL,
  movement_disallow = NULL,
  mu_movement_step_diag = NULL,
  sd_movement_step_diag = NULL,
  mu_fishing_rate = NULL,
  cv_fishing_rate = NULL,
  mu_selectivity = NULL,
  cv_selectivity = NULL,
  mu_fishing_weight = NULL,
  sd_fishing_weight = NULL,
  mu_natural_mortality_rate = NULL,
  sd_natural_mortality_rate = NULL,
  mu_reporting_rate = NULL,
  sd_reporting_rate = NULL,
  mu_initial_loss_rate = 0.1,
  sd_initial_loss_rate = 0.01,
  mu_ongoing_loss_rate = 0.02,
  sd_ongoing_loss_rate = 0.001,
  mu_dispersion = 1,
  sd_dispersion = 0.5,
  tolerance_expected = 1e-12,
  tolerance_fishing = 1e-12,
  data = NULL,
  chains = 1,
  step_size = 0.01,
  adapt_delta = 0.95,
  iter_warmup = 250,
  iter_sampling = 750,
  max_treedepth = 10,
  use_reduce_sum = FALSE,
  threads_per_chain = parallel::detectCores()/(2 * chains),
  refresh = 100,
  ...
)

Arguments

tag_data

data.frame()

list_regions

list()

list_sizes

list()

year_start

integer() year of initial tag released

year_end

integer() year of final tag recovered

step_interval

character() one of "month", "quarter", "year"

step_duration_max

integer()

days_duration_min

integer() minimum number of days before recovery

colname_date_released

character()

colname_date_recovered

character()

colname_region_released

character()

colname_region_recovered

character()

colname_size_released

character()

movement_pattern

integer()

movement_allow

integer()

movement_disallow

integer()

mu_movement_step_diag

numeric()

sd_movement_step_diag

numeric()

mu_fishing_rate

numeric()

cv_fishing_rate

numeric()

mu_selectivity

numeric()

cv_selectivity

numeric()

mu_fishing_weight

numeric()

sd_fishing_weight

numeric()

mu_natural_mortality_rate

numeric()

sd_natural_mortality_rate

numeric()

mu_reporting_rate

numeric()

sd_reporting_rate

numeric()

mu_initial_loss_rate

numeric()

sd_initial_loss_rate

numeric()

mu_ongoing_loss_rate

numeric()

sd_ongoing_loss_rate

numeric()

mu_dispersion

numeric()

sd_dispersion

numeric()

tolerance_expected

numeric()

tolerance_fishing

numeric()

data

list() See details

chains

integer() number of chains

step_size

numeric() initial step size

adapt_delta

numeric() the adaptation target acceptance statistic

iter_warmup

integer() number of warmup iterations

iter_sampling

integer() number of sampling iterations

max_treedepth

integer()

use_reduce_sum

logical() use within chain parallel threading

threads_per_chain

integer() number of threads per chain

refresh

integer()

...

additional arguments to pass to $sample() method

Details

When the model data are specified by individual arguments, a number of helper functions with sensible defaults are used to assemble the data object. This is usually preferable for user convenience.

Passing the data object directly may be preferred for example when the data object is the output of a simulation model, or when greater flexibility is desired. In either event, care must be taken to ensure the data object matches the requirements of the underlying Stan model.

TBD

Value

mmmstan()


luke-a-rogers/mmmstan documentation built on Aug. 9, 2024, 3:13 a.m.