matchPrior | R Documentation |
Attempts to determine which prior to put on a parameter based on a list of settings,
such as the output from setPriors()
. The function follows the following
search pattern: (1) looks for an exact match to the parameter name including brackets;
(2) a match to the parameter name without brackets; (3) goes through each value
supplied to ...
in order and looks for a match in the names of the
settings list. Once a match is found the function returns the corresponding
prior value.
matchPrior(parName, ..., priors)
parName |
Parameter to get a prior for, as quoted code/name, possibly including brackets/indices |
... |
Character strings that categorize the parameter and match
the names of elements in |
priors |
A named list of prior settings, e.g., as generated by
|
NIMBLE code for the matching prior.
Ken Kellner
pr <- setPriors(intercept = quote(dunif(-3, 3)), 'alpha' = quote(dunif(0,1)),
'alpha[2]' = "dnorm(0, 3)")
matchPrior(quote(alpha), priors=pr)
matchPrior(quote(alpha[2]), priors=pr)
matchPrior(quote(intercept), priors=pr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.