This class encapsulates the structure of prior distributions used in hierarchical Bayesian modelling. It stores both subject-level and population-level (hyperparameter) priors for a model’s parameters, and is used in Bayesian inference workflows, particularly with models from the lbaModel or ddModel packages.
An S4 object of class "prior", used in computing prior
densities and visualising prior distributions.
nparameterInteger. Number of free parameters in the model.
pnamesCharacter vector. Names of the free parameters.
p_priorList. Represents the joint prior distribution at the subject level, usually constructed from standard or truncated distributions.
h_priorList. Representing the joint prior at the population level, typically containing location and scale parameters for hierarchical models. The 'h' prefix refers to hyperparameters.
An object of class "prior" contains the following components:
nparameterNumber of free parameters.
pnamesNames of the model's free parameters.
p_priorSubject-level prior specification. Conceptually analogous to the model likelihood in a hierarchical Bayesian model.
h_priorHyperparameter-level (group-level) prior specification.
Used to define priors for hierarchical Bayesian cognitive models. This
class allows structured specification of priors at both individual and
group levels. Prior objects are commonly constructed using
set_priors, which integrates multiple BuildPrior
outputs into a single prior structure.
BuildPrior