prior-class: An S4 Class to Represent a Joint Prior Distribution

prior-classR Documentation

An S4 Class to Represent a Joint Prior Distribution

Description

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.

Value

An S4 object of class "prior", used in computing prior densities and visualising prior distributions.

Slots

nparameter

Integer. Number of free parameters in the model.

pnames

Character vector. Names of the free parameters.

p_prior

List. Represents the joint prior distribution at the subject level, usually constructed from standard or truncated distributions.

h_prior

List. Representing the joint prior at the population level, typically containing location and scale parameters for hierarchical models. The 'h' prefix refers to hyperparameters.

Structure

An object of class "prior" contains the following components:

nparameter

Number of free parameters.

pnames

Names of the model's free parameters.

p_prior

Subject-level prior specification. Conceptually analogous to the model likelihood in a hierarchical Bayesian model.

h_prior

Hyperparameter-level (group-level) prior specification.

Usage

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.

See Also

BuildPrior


ggdmcPrior documentation built on Aug. 8, 2025, 7:13 p.m.