RandomWalkVolatilityPrior#

class cultivars.bayes.priors.RandomWalkVolatilityPrior(*, vol_of_vol=(3.0, 0.04))[source]#

The prior on a random-walk log-variance law with an estimated step variance.

\(h_{t+1} = h_t + \gamma \eta_t\) carries one hyperparameter, the variance of the step, and the unobserved-components stochastic- volatility model states its prior on it through this record: an inverse-gamma on \(\gamma^2\) for each of its two volatility paths. The walk has no mean and no persistence to put a prior on; a model that fixes gamma outright does not read this record at all.

Variables:

vol_of_vol (tuple[float, float]) – (shape, rate) of the inverse-gamma prior on the step variance \(\gamma^2\), both positive.

Raises:

SpecificationError – If vol_of_vol is not a pair of finite, positive numbers.

See also

References

Stock, J. H., & Watson, M. W. (2007). Why has U.S. inflation become harder to forecast? Journal of Money, Credit and Banking, 39(s1), 3-33.

Example

>>> prior = _RandomWalkVolatilityPrior()
>>> prior.vol_of_vol, prior.vol_of_vol_mean
((3.0, 0.04), 0.02)
>>> _RandomWalkVolatilityPrior(vol_of_vol=(1.0, 0.04)).vol_of_vol_mean
inf

Attributes#

vol_of_vol

(shape, rate) of the inverse-gamma prior on the step variance \(\gamma^2\).

vol_of_vol_mean

Prior mean of gamma2, rate / (shape - 1); inf for a shape of one or less.