NormalGammaPrior._tracked#

NormalGammaPrior._tracked(scales, context)[source]#

The local scale per lag coefficient.

\(\sqrt{\psi_{ij}}\), the prior standard deviation of the standardized coefficient under the current state, with the global rate already folded in through the variance conditional: near zero means the coefficient is being shrunk away, order one or larger means it is left free. The sampler averages this over kept sweeps into the result’s shrinkage; deterministic and exogenous rows are reported as zero because they are not shrunk.

Parameters:
  • scales (dict[str, NDArray[double]]) – The current latent state.

  • context (_PriorContext) – The sample description; width, k_endog, order, and lag_offset are read.

Return type:

NDArray[double]

Returns:

A (width, k) array, zero off the lag block.

Example

>>> import numpy as np
>>> from cultivars.bayes.priors import PriorContext
>>> ctx = PriorContext(
...     k_endog=2, order=1, scales=np.ones(2), presample_mean=np.zeros(2)
... )
>>> prior = NormalGammaPrior()
>>> state = prior._initial_scales(ctx, prior._unit_ratio(ctx))
>>> prior._tracked(state, ctx)
array([[0. , 0. ],
       [0.2, 0.2],
       [0.2, 0.2]])