get_classic: Retrieve nimbleCode for spatial capture-recapture models

View source: R/localSCR.R

get_classicR Documentation

Retrieve nimbleCode for spatial capture-recapture models

Description

Creates model code using the nimbleCode function.

Usage

get_classic(
  dim_y,
  enc_dist = "binomial",
  sex_sigma = FALSE,
  hab_mask = FALSE,
  trapsClustered = FALSE
)

Arguments

dim_y

An integer of either 2 (the default) or that defines what dimensional format the encounter history data are in.

enc_dist

Either "binomial" or "poisson". Default is "binomial".

sex_sigma

A logical value indicating whether the scaling parameter ('sigma') is sex-specific

hab_mask

A logical value indicating whether a habitat mask will be used. Default is FALSE.

trapsClustered

A logical value indicating if traps are clustered in arrays across the sampling area.

Details

This function provides templates that could be copied and easily modified to include further model complexity such as covariates explaining detection probability. The models include different encounter probability distributions, sex-specific scaling parameters, and habitat masking.

Value

A nimbleCode object from the nimble package.

Author(s)

Daniel Eacker

Examples

# get model for 2D encounter data, binomial encounter distribution, 
# non-sex-specific scaling parameter, and no habitat mask
scr_model = get_classic(dim_y = 2,enc_dist = "binomial",sex_sigma = FALSE,
                         hab_mask = FALSE,trapsClustered = FALSE)

# inspect model
scr_model

sitkensis22/localSCR documentation built on May 15, 2022, 5:26 p.m.