dr_fit: Fit Detection Range Model

View source: R/fit.R

dr_fitR Documentation

Fit Detection Range Model

Description

Fit detection range model using JAGS. If the number of stations is < min_random, a fixed-effects model is fit. Otherwise, a mixed-effects model is fit with random slope for each station. If random_intercept = TRUE, a random intercept is also fit for each station.

Usage

dr_fit(
  data,
  nthin = 10,
  min_random_slope = 5,
  min_random_intercept = 5,
  priors = NULL,
  quiet = TRUE,
  seed = .rndm_seed()
)

Arguments

data

A data.frame of the detection range data (see range_obs)

nthin

A whole number of the number of thins.

min_random_slope

A whole number of the minimum number of Stations required to fit slope parameter as a random effect.

min_random_intercept

A whole number of the minimum number of Stations required to fit intercept parameter as a random effect.

priors

A named list of the parameter names and priors (in BUGS language) including some subset of the parameters required by the model. Any parameters not included will fall back to defaults in priors(). If NULL, all default priors are used.

quiet

A flag indicating whether to suppress messages and progress bars.

seed

A positive whole number of the seed.

Value

A list of the jags model object and mcmcr samples.


Freshwater-Fish-Ecology-Laboratory/detrange documentation built on Oct. 30, 2024, 1:10 p.m.