DummyInitialObservationPrior.dummy_observations#

DummyInitialObservationPrior.dummy_observations(context)[source]#

A single artificial observation at the pre-sample means.

The target is \(\delta \bar y^\top\); the design row carries \(\delta\) in every deterministic column, supplied by the context’s _lead so that a constant, a constant and trend, and a panel’s fixed effects are all switched on alike, then \(\delta \bar y^\top\) at each lag, and zeros under any exogenous regressors. With no deterministic terms the row is the lag part alone.

Parameters:

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

Return type:

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

Returns:

A (1, k) target block and a (1, width) design block.

Raises:

SpecificationError – If tightness is not positive.

Example

Under a constant and a trend both deterministic columns are set to the tightness:

>>> import numpy as np
>>> from cultivars.bayes.priors import PriorContext
>>> ctx = PriorContext(
...     k_endog=2, order=1, scales=np.ones(2),
...     presample_mean=np.array([10.0, 20.0]), n_deterministic=2,
... )
>>> DummyInitialObservationPrior(tightness=0.5).dummy_observations(ctx)[1]
array([[ 0.5,  0.5,  5. , 10. ]])