MinnesotaPrior.dummy_observations#

MinnesotaPrior.dummy_observations(context)[source]#

The sum-of-coefficients rows, when that restriction is asked for.

One artificial observation per variable, saying that a series sitting at its pre-sample average forever should stay there. For variable \(j\) with pre-sample mean \(\bar y_j\) and centre \(\delta_j\) (its persistence), the row has target \(\lambda_5 \delta_j \bar y_j\) in column \(j\) and the same value in that variable’s column at every lag of the design, with zeros in the deterministic and exogenous columns. Regressing target on design then says the lag coefficients of variable \(j\) sum to \(\delta_j\), with weight \(\lambda_5\). That is a statement about a sum of coefficients, which no diagonal variance can make, which is why this hyperparameter alone enters as data (Doan, Litterman & Sims 1984; Sims & Zha 1998).

Parameters:

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

Return type:

tuple[NDArray[double], NDArray[double]]

Returns:

A (k, k) target block and a (k, width) design block when sum_of_coefficients is set; the base class’s empty (0, k) and (0, width) blocks otherwise.

Raises:

Example

>>> import numpy as np
>>> from cultivars.bayes.priors import PriorContext
>>> ctx = PriorContext(
...     k_endog=2, order=2, scales=np.ones(2),
...     presample_mean=np.array([10.0, 20.0]),
... )
>>> target, design = MinnesotaPrior(sum_of_coefficients=1.0).dummy_observations(ctx)
>>> target
array([[10.,  0.],
       [ 0., 20.]])
>>> design
array([[ 0., 10.,  0., 10.,  0.],
       [ 0.,  0., 20.,  0., 20.]])
>>> MinnesotaPrior().dummy_observations(ctx)[0].shape
(0, 2)