NoPrior#

class cultivars.bayes.priors.NoPrior[source]#

The absence of shrinkage, which is unrestricted least squares.

Present so that “no prior” is something a caller passes rather than something they express by passing nothing, and so that a stack assembled in a loop needs no special first case: it is the identity of composition.

The identity holds for the moments, the dummy rows, and the component list, but not for the type: prior + _NoPrior() is a _CompositePrior holding prior, not prior itself. For an _AdaptivePrior the difference matters, because the samplers refuse an adaptive prior inside a composition.

See also

  • NoPrior – the public name of this class.

Example

>>> import numpy as np
>>> context = _PriorContext(
...     k_endog=2, order=1, scales=np.ones(2), presample_mean=np.zeros(2)
... )
>>> prior = _NoPrior()
>>> bool(np.all(np.isinf(prior.coefficient_variance(context))))
True
>>> prior._label(), prior._components()
('none', ())

Methods#

coefficient_mean(context)

Zero, which no infinite variance will ever pull toward.

coefficient_variance(context)

Infinite everywhere: no opinion about any coefficient.

dummy_observations(context)

Artificial rows this prior contributes, for restrictions on sums.