bsm: Fit a Bayesian Selectivity Model

Description Usage Arguments Details Value Methods (by generic) Author(s)

Description

Creates and fits a selection curve to the supplied bsmdata object. The correct data list is created, the JAGS model constructed, and the model is run with default settings. It is also possible to suppress the running of the JAGS and simply output the model and data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
bsm(x, family = "binomial", curve = "logistic", check.od = TRUE,
  od = FALSE, combine = FALSE, random = NULL, L50 = ~1, SR = ~1,
  phi = if (attr(x, "paired")) ~1 else NULL, delta = if (curve ==
  "richards") ~1 else NULL, priors = NULL, inits = NULL,
  length.dist = "iid", parameters = par$summary.parameters,
  extra.pars = NULL, file = NULL, fit = TRUE, include.lambda = FALSE,
  n.samples = 1000, n.thin = 1, n.burn = n.samples * n.thin,
  n.chains = 3, max.attempts = 10, quiet = FALSE, progress.bar = "text",
  show.info = TRUE, ...)

## S3 method for class 'bsmfit'
print(x, model = FALSE, coda = FALSE, ...)

## S3 method for class 'bsmfit'
summary(object, p.values = FALSE, formula.values = FALSE,
  predict.values = NULL, ...)

Arguments

x

an object of class bsmdata, from the bsmData function

family

"logistic" (default) or "poisson", the family for the likelihood

curve

"logistic" or "richards", the type of selection curve to be fitted (will likely allow other options, for example "Bspline", future)

check.od

logical, if TRUE, then overdispersion estimates will be produced

od

logical, if TRUE, the model will be fit allowing for overdispersion

combine

logical, if TRUE, then the 'combined hauls' approach is used, otherwise a hierarchical approach is used.

random

vector of parameters to have hierarchical or random effects

L50

the formula for L50, default is L50 = ~1

SR

the formula for SR, default is SR = ~1

phi

the formula for phi, default is phi = ~1

delta

the formula for delta, default is delta = ~1

priors

the prior distributions for specified parameters. See details.

inits

initial values for parameters

length.dist

'iid' or "multinomial", the type of length distribution for the lambda parameters. See details for more information.

parameters

the parameters to save in the JAGS output. NOTE: only use this if you really really only want these parameters - may cause errors in summary output and plots depending on parameters selected.

extra.pars

additional parameters to be tracked as well as parameters. Lets you keep the default parameters.

file

the file name to save the JAGS model in. If NULL, then a temporary file is created

fit

logical, if TRUE then the JAGS model is fit, otherwise only the model and data are returned.

include.lambda

logical, if TRUE, the lambda parameter will be saved as well

n.samples

the total number of samples to obtain (excludes burnin and thin)

n.thin

the thinning interval

n.burn

the burn in period

n.chains

the number of chains

max.attempts

the maximum number of times bsm will attempt to fit the JAGS model (often due to bad initial values, the model cannot be initiated and fails)

quiet

suppress all output messages from JAGS?

progress.bar

one of "none", "text" or "gui" for the JAGS progress bar

show.info

logical, if FALSE, the package information will not be printed

...

additional arguments

model

logical, if TRUE, then the JAGS model is printed, otherwise summary information is provided

coda

logical, if TRUE, then the summary from the coda package is used

object

a bsmfit object

p.values

logical, include significance tests for parameters != 0?

formula.values

logical, display values in formulae?

predict.values

values to be included in the prediction

Details

There are going to be a lot of details ...

Value

an object of class bsmfit

Methods (by generic)

Author(s)

Tom Elliott


tmelliott/bsm documentation built on May 31, 2019, 4:38 p.m.