fit_model: Fit the cowbird-host co-occurrence models

View source: R/fit_model.R

fit_modelR Documentation

Fit the cowbird-host co-occurrence models

Description

Fit the cowbird-host co-occurrence models described in Patton et al. (Year TBD) using package rjags.

Usage

fit_model(
  model = c("model_1", "model_2", "model_3"),
  data_list,
  params_to_monitor = NULL,
  n.chains = 1,
  n.adapt = 100,
  n.burn = 10,
  n.iter = 10,
  n.thin = 1,
  mcmc_params_paper = FALSE,
  fix_seed = FALSE
)

Arguments

model

string indicating which model is to be fit.

data_list

list of data from make_data_list()

params_to_monitor

character vector indicating which parameters should be saved from the MCMC samples

n.chains

integer representing the number of MCMC chains to run

n.adapt

integer representing the number of MCMC iterations to adapt the sampler

n.burn

integer representing the number of MCMC iterations to discard before saving samples

n.iter

integer representing the number of MCMC iterations to save

n.thin

integer representing the number of MCMC iterations to thin

mcmc_params_paper

logical. should we fit the model using the MCMC parameters described in the paper?

fix_seed

logical. should the seed be set for reproducible results?

Details

The default MCMC parameters are set for quick model fitting. To use the MCMC parameters described in the papers, use mcmc_params_paper = TRUE.

Value

list, elements of class rjags::mcarray

See Also

rjags documentation for fitting models with rjags


philpatton/cowbird documentation built on March 2, 2023, 3:05 a.m.