fcs2WriteModel: Write BUGS Model File

Description Usage Arguments Note See Also

View source: R/fcs2WriteModel.R

Description

Creates a BUGS model file that describes the structure of the full FCS2 statistical model. This can be used by WinBUGS or OpenBUGS to fit the model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fcs2WriteModel(
  filename = "model.bug",
  muLinearVars = c(),
  muRWVars = c(),
  muSpatialVar = NULL,
  rhoLinearVars = c(),
  rhoRWVars = c(),
  rhoSpatialVar = NULL,
  multiRun = FALSE,
  catchTotal = TRUE,
  catchRange = FALSE,
  qUnif = FALSE
)

Arguments

filename

the name or the BUGS model file to create.

muLinearVars

a character vector of linear terms in the abundance regression

muRWVars

a character vector of variables with first or second-order random walk terms in the abundance regression.

muSpatialVar

the name of the abundance spatial variable, if present.

rhoLinearVars

a character vector of linear terms in the abundance regression

rhoRWVars

a character vector of variables with first or second-order random walk terms in the prevalence regression.

rhoSpatialVar

the name of the prevalence spatial variable, if present.

multiRun

whether the multiple-run extension to the FCS2 model is required.

catchTotal

whether catch total data are present in the model.

catchRange

whether catch total range data are present in the model.

qUnif

whether to use a uniform prior for the catch probability q rather than the default beta prior. Although the uniform is a special case of the beta, this option may help BUGS fit the model.

Note

The user would not usually call this function directly as it is called if required by fcs2FitModel. However, it may be useful for creating a BUGS model file to be run by WinBUGS or OpenBUGS extenally.

See Also

fcs2FitModel


aquaMetrics/fcs2 documentation built on Aug. 21, 2021, 12:55 p.m.