VolatilityPrior#

class cultivars.bayes.priors.VolatilityPrior(*, mu=(0.0, 10.0), phi=(20.0, 1.5), sigma2=(2.5, 0.025))[source]#

The Kim-Shephard-Chib prior on a stationary log-AR(1) volatility law.

\(h_{t+1} = \mu + \phi (h_t - \mu) + \sigma \eta_t\) carries three hyperparameters, and every model in the package whose volatility follows this law – the univariate stochastic-volatility model, the volatility-identified SVAR, the factor stochastic-volatility model – states its prior through this one record: Gaussian on mu, Beta on \((\phi + 1) / 2\), inverse-gamma on sigma2. The defaults are Kim, Shephard and Chib’s (1998), which put the persistence near 0.86 a priori and keep the innovation variance small; a model that pins mu for identification says so and leaves that entry unread.

Variables:
  • mu (tuple[float, float]) – (mean, variance) of the Gaussian prior on the log-variance mean.

  • phi – (a, b) of the Beta prior on \((\phi + 1) / 2\), both positive.

  • sigma2 (tuple[float, float]) – (shape, rate) of the inverse-gamma prior on the log-variance innovation variance, both positive.

Raises:

SpecificationError – If a field is not a pair of finite numbers, or if a variance, Beta parameter, shape, or rate is not positive.

Note

“Rate” is the rate of the gamma distribution on the precision \(1 / \sigma^2\), which is the scale of the inverse-gamma itself: the density is proportional to \((\sigma^2)^{-(\mathrm{shape} + 1)} \exp(-\mathrm{rate} / \sigma^2)\).

See also

References

Kim, S., Shephard, N., & Chib, S. (1998). Stochastic volatility: Likelihood inference and comparison with ARCH models. The Review of Economic Studies, 65(3), 361-393.

Example

>>> prior = _VolatilityPrior()
>>> prior.mu, prior.phi, prior.sigma2
((0.0, 10.0), (20.0, 1.5), (2.5, 0.025))
>>> round(prior.phi_mean, 4), round(prior.sigma2_mean, 4)
(0.8605, 0.0167)
>>> _VolatilityPrior(phi=(5, 5)).phi_mean
0.0

Attributes#

mu

(mean, variance) of the Gaussian prior on the log-variance mean mu.

phi

(a, b) of the Beta prior on \((\phi + 1) / 2\), both positive.

sigma2

(shape, rate) of the inverse-gamma prior on the innovation variance, both positive.

phi_mean

The prior mean of the persistence, \(2a / (a + b) - 1\).

sigma2_mean

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