init_single_chain: Make the expression of init values for a single chain in Stan

Description Usage Arguments Details Value

View source: R/init_single_chain.R

Description

This function it a bit complicated. It reads in the prior_file, and parses both (1) the prior distribution for a parameter, and (2) the value(s) which describe that distribution. From that information, it creates for each parameter an rlang expression of the appropriate R distribution function (rnorm, runif, etc.) that will generate a single random starting value from the prior. Finally, it assembles the expressions for each parameter into a a single list using only the parameters needed for the chosen model as specified by the tails argument. That single list will eventually be evaluated by the prep_init_list function to create the list of initial values for Stan.

Usage

1
2
init_single_chain(prior_file, tails = c("none", "left", "right",
  "mirror", "ind"))

Arguments

prior_file

Path to the yaml file containing the prior specifications.

tails

Which type of tails for the model: "none", "left", "right", "mirror", or "ind"?

Details

Currently supported distributions are: normal, uniform, exponential.

Used internally, in prep_init_list.

Value

An rlang expression of the initialization values for a single chain


tjthurman/BAHZ documentation built on May 30, 2020, 8:28 a.m.