validate_all_priors: Validate User-Specified Priors for Nimble Models

View source: R/validate_prior_distributions.R

validate_all_priorsR Documentation

Validate User-Specified Priors for Nimble Models

Description

Validates a set of user-defined priors to ensure that they specify valid distributions supported by Nimble and have the correct parameters for each distribution.

Usage

validate_all_priors(priors)

Arguments

priors

A named list of priors specified as strings, where the name is the prior name (e.g., prior_mean) and the value is the prior distribution (e.g., 'dnorm(0, 0.001)').

Details

The function checks the following:

  • Whether the specified distribution is supported by Nimble.

  • Whether the correct number of parameters is provided for the distribution.

If any prior is invalid, the function throws an informative error with details about the issue.

Value

Returns TRUE if all priors are valid. Throws an error if any prior is invalid.

References

  • NIMBLE Development Team (2021). NIMBLE: An R Package for Programming with BUGS Models. https://r-nimble.org/

See Also

  • Nimble documentation for a full list of supported distributions.


MultiNMix documentation built on April 3, 2025, 6:10 p.m.