calcPercChangeMCMC: calcPercChangeMCMC

View source: R/Module_calcPercChangeMCMC.R

calcPercChangeMCMCR Documentation

calcPercChangeMCMC

Description

MCMC version of trend metric calculation This function calculates the percent change in abundances based on an exponential model of population decline, as per IUCN guidelines It esimates a distribution of percent declines over the period of the time-seris, and provides the probability of declines being greater than a specified threhold

Usage

calcPercChangeMCMC(
  vec.in,
  method = "jags",
  model.in = NULL,
  perc.change.bm = -25,
  na.skip = FALSE,
  out.type = "short",
  mcmc.plots = FALSE,
  convergence.check = FALSE
)

Arguments

vec.in

vector with numeric values

method

either "jags" (default), "rstanarm", or "rstan". For properties and discussion of strengths/limitations, refer to the MetricsCOSEWIC wiki.

model.in

if NULL, use the built in functions for each method: trend.bugs.1() for jags, ETC

perc.change.bm

benchmark for Prob(Decl>BM), default = -25

na.skip

if TRUE, skip the calculations when vec.in contains any NA

out.type

"short" or "long". "short" gives summary table of posterior plus "PercChange" and "ProbDecl" "long" also includes the full mcmc samples and the jags output object

mcmc.plots

if true, create the standard series of MCMC diagnostic plots Note that these are printed to the default device (i.e. need to external wrap the function call inside a pdf /dev.off call) To get a plot of the model fit, run this function with out.type = "long", and then use plot.trend.fit().

convergence.check

if TRUE, do an automated convergence check


SOLV-Code/MetricsCOSEWIC documentation built on Nov. 3, 2022, 8:59 p.m.