Description Usage Arguments Details Value See Also Examples
View source: R/prep_init_list.R
Generates a list, of length chains
, where each element of the list is
a named list giving the initialization values for each model parameter.
Initialization values are randomly drawn from the prior distribution, and are
drawn independently for each chain.
1 2 | prep_init_list(prior_file, tails = c("none", "left", "right", "mirror",
"ind"), chains, type = c("pheno", "geno"))
|
prior_file |
Path to the |
tails |
Which type of tails for the model: "none", "left", "right", "mirror", or "ind"? |
chains |
The number of chains to be used in Stan. Integer. |
type |
Are the intial values for a phenotypic cline or genetic cline: "pheno", or "geno"? Only affects limit checking for the pmin and pmax initial values, which must be between 0 and 1 for genetic clines. |
Currently supported distributions are: normal, uniform, exponential.
This function calls init_single_chain
for each chain.
init_single_chain
does all the work of making the expression
which will yield the proper starting values for a chain of this model.
This function also provides checks that the specified starting values will work with Stan. If the priors are poorly specified such that some initial values are inappropriate (e.g., width initial values are negative), it will re-do the initialization, up to 100 times per chain. If, after 100 tries, it fails to generate an appropriate starting chain, it will generate a warning and provide some guidance on which parameters are causing the problem.
A list of lists containing initialization values for the Stan model.
init_single_chain
, fit_geno_cline
1 2 3 4 | ## Not run:
prep_init_list("path/to/priors.yaml", tails = "none", chains = as.integer(3))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.