msom_params: Print Names of MSOM Parameters

Description Usage Arguments Details Value Examples

View source: R/msom_params.R

Description

Given a specified language and model type (as in run_msom), and the dimensions of the data (e.g., msomData), list the potential parameter names as well as the total number of parameters

Usage

1
msom_params(language, model_type, nT, Jmax, nU, nV, nS, noIndex = FALSE)

Arguments

language

The language of the MSOM model (JAGS or Stan)

model_type

The type of model (Dynamic or Static)

nT

the number of years

Jmax

the total number of unique sites ever visited

nU

the number of presence covariates

nV

the number of detection covariates

nS

the number of species (including 0's)

noIndex

logical, default FALSE; if TRUE, strip indices from parameter names and return unique values (this can return a much smaller object, and greatly reduce computation time)

Details

Currently does not include reporting covariates specified as random variables, nor do these extra parameters factor into the total parameter count. Z is only available in JAGS, as is w. JAGS is parameterized with tau's, Stan with sd's. Only dynamic models include parameters for persistence (phi) and colonization (gamma). Even though they aren't strictly parameters, all models and languages can report parameters for probability of presence (Psi) and probability of detection (Theta). Most hyperparameters are available reporting; however, parameters used strictly to generate non-centered distrubtions (used in Stan only) are not available. In addition to those already mentioned, parameters available include the following (and the pertinent variations on these parameters): alpha, beta, Omega.

Parameter names are semi-redundant: e.g., the 'w' parameter in a JAGS model is species-specific. In the output list of all possible parameters, 'w' will be listed, as will 'w[1]', 'w[2]', ..., 'w[nS]'. The interpretation here is that 'w' implies all of its indices, but that both languages accept both specifications, so both versions are included. Note that this introduces a small asymmetry between the lengths reported in n and the lengths in the other elements of the output list (see Examples).

Value

A named list with the following elements:

n a named vector with integer elements (see below)
params the names of all potential parameters
params_main the names of all main-effect parameters
params_random the names of all random-effect parameters
params_latent the names of all latent paramters

n contains the following elements

nP total parameters
n_main total main-effect parameters, including hyperparameters
n_random number of random-effect parameters
n_latent number of random-effect parameters

Examples

1
2
3
4
5
6
7
lang <- "JAGS"
mt <- "Static"
out <- msom_params(lang, mt, nT=3, Jmax=4, nU=3, nV=1, nS=5)

# In reference to the asymetry mentioned in Details
out[["n"]][2:4] == sapply(out[3:5], length) # symmetrical
out[["n"]][1] < length(out[["params"]]) # asymmetric

rBatt/trawlDiversity documentation built on Aug. 14, 2021, 1:01 p.m.