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, andk_exogare read.- Return type:
- Returns:
A
(k, k)target block and a(k, width)design block whensum_of_coefficientsis set; the base class’s empty(0, k)and(0, width)blocks otherwise.- Raises:
SpecificationError – If a hyperparameter is out of range.
DimensionError – If
persistencehas the wrong length.
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)