MinnesotaPrior._persistence#

MinnesotaPrior._persistence(context)[source]#

Broadcast the prior mean of the own first lags to one value per variable.

A scalar persistence is repeated k_endog times; a sequence is taken as given after its length is checked. Called by coefficient_mean() and dummy_observations(), the two places the centre enters, so the two cannot disagree.

Parameters:

context (_PriorContext) – The sample description; only k_endog is read.

Return type:

NDArray[double]

Returns:

(k,) prior means, one per variable in column order.

Raises:

DimensionError – If persistence is a sequence whose length is not k_endog.

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)
... )
>>> MinnesotaPrior(persistence=0.9)._persistence(ctx)
array([0.9, 0.9])
>>> MinnesotaPrior(persistence=(1.0, 0.0))._persistence(ctx)
array([1., 0.])