NormalGammaPrior._initial_scales#

NormalGammaPrior._initial_scales(context, reference)[source]#

Minnesota-tightness local variances; the rate that implies them.

Every \(\psi_{ij}\) starts at \(0.04\), the square of the Minnesota default tightness \(\lambda_1 = 0.2\), so the first coefficient draw is under the standardized Minnesota prior, and the rate starts at \(\lambda / 0.04\), the value whose Gamma has that as its prior mean, so the first rate draw is not fighting the starting variances.

Parameters:
  • context (_PriorContext) – The sample description; k_endog and order are read.

  • reference (NDArray[double]) – Data-driven reference scales, ignored: the Normal-Gamma does not anchor on least-squares standard errors.

Return type:

dict[str, NDArray[double]]

Returns:

{"psi"} of shape (k * p, k) and {"rate"} of shape (1,).

Raises:

SpecificationError – If a hyperparameter is out of range.

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))
>>> state["psi"]
array([[0.04, 0.04],
       [0.04, 0.04]])
>>> state["rate"]
array([2.5])