HorseshoePrior._tracked#
- HorseshoePrior._tracked(scales, context)[source]#
The local-global scale
tau * lambdaper lag coefficient.\(\tau \lambda_{ij}\) is the prior standard deviation of the standardized coefficient under the current state: 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; the deterministic and exogenous rows are reported as zero because they are not shrunk.- Parameters:
- Return type:
- 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 = HorseshoePrior() >>> state = prior._initial_scales(ctx, prior._unit_ratio(ctx)) >>> state["tau2"][0] = 0.25 >>> prior._tracked(state, ctx) array([[0. , 0. ], [0.5, 0.5], [0.5, 0.5]])