Skip to contents

This is an S4 object that contains a model written in CmdStan and compiled as an R6 class object.

A call to this function will source and compile the latest version of the southern hemisphere seabird risk assessment model. The model is written in CmdStan and can be run using sampler or directly using $sample() from the cmdstanr package.

Usage

sefraModel(object, ...)

# S4 method for class 'sefraData'
sefraModel(object, write_to, read_from, ...)

Arguments

object

sefraData object. See sefraData.

...

(not used).

write_to

Write model code to file.

read_from

Read model code from file.

Value

A CmdStanModel object returned by cmdstan_model. If write_to is specified, the model code is written to file.

Details

Compilation of the model is achieved using cmdstan_model and implements stan_threads = TRUE. This allows for multiple threads per chain when fitting the model.

Slots

.Data

character string containing model name.

model

R6 environment.

initial_values

list of initial values.

mcmc

R6 environment.

Examples

dat <- sefraData(c('DIQ'))
#> species codes input: including all species-dependent capture codes
#> constructed 'sefraData' object
mdl <- sefraModel(dat)
#> Warning: Distributions for adult survival are not specified
#> Warning: Distributions for number of breeding pairs are not specified
#> Warning: Distributions for probability of breeding are not specified
#> Warning: Distributions for age at first breeding are not specified
#> SEFRA-seabird model v3.0.1