Priors

class brmp.priors.Prior(path, prior)

A Prior instance associates a prior distribution with one or more parameters of a model. One or more such instances may be passed to brm() to override its default choice of priors.

The parameters of the model to which a prior should be applied are specified using a path. The following examples illustrate how this works:

Path Selected Parameters
('b',) All population level coefficients
('b', 'intercept') The population level intercept
('b', 'x') The population level coefficient x
('sd',) All standard deviations in all groups
('sd', 'a') All standard deviations in the group which groups by column a
('sd', 'a:b') All standard deviations in the group which groups by columns a and b
('sd', 'a', 'intercept') The standard deviation of the intercept in the group which groups by column a
('cor',) All correlation matrices
('cor', 'a') The correlation matrix of the group which groups by column a
('cor', 'a:b') The correlation matrix of the group which groups by columns a and b
('resp', `sigma`) The sigma parameter of the response distribution

Example:

Prior(('b', 'intercept'), Normal(0., 1.))
Parameters:
  • path (tuple) – A path describing one or more parameters of the model.
  • prior (brmp.family.Family) – A prior distribution, given as a Family with all of its parameters specified.