make_prior: Generate a prior for use in the Humpback SIR

View source: R/prior_specification.R

make_priorR Documentation

Generate a prior for use in the Humpback SIR

Description

Convenient way to generate a prior that can be used to generate samples for the SIR.

Usage

make_prior(rfn = NA, par1 = NULL, par2 = NULL, use = TRUE,
  label = NULL)

Arguments

rfn

Function to be used to generate samples from the prior distribution, such as rnorm or runif. Can also be set to a single number in order to hold that parameter constant.

par1

First parameter of the prior distribution. For rnorm this is the mean, for runif this is the lower bound.

par2

Second parameter of the prior distribution. For rnorm this is the standard deviation, for runif this is the upper bound.

use

Boolean, indicates whether this prior is to be used. Defaults to TRUE.

label

Text label of the distribution. If not set, will try to label based on the function passed in rfn Recognizes rnorm rlnorm runif, and rlunif. Otherwise will label "User defined".

Value

A list containing the function rfn for generating a sample from the prior distribution, a vector pars containing the parameters of the distribution, and a boolean use flag.

Examples

make_prior(rnorm, 0, 1, TRUE)
make_prior(runif, 0, 1, TRUE)
make_prior(rlunif, 0.01, 0.2, "Log-uniform(0.01, 0.2)")

antarctic-humpback-2019-assessment/HumpbackSIR documentation built on Nov. 6, 2023, 6:07 p.m.