Comparison of different implementations of the same stochastic volatility model (stochvol, JAGS, Stan)
Archived repo.
Comparison of different implementations of the same stochastic volatility model (stochvol
, JAGS
, Stan
).
The goal is to see when and why one needs to develop a model-specific algorithm even if fast prototyping is easy using existing software packages.
The model in its standard parameterization is
y[t] ~ N(0,exp(h[t])),
h[t] ~ N(mu+phi*(h[t-1]-mu),sigma^2),
where, in order to be able to do Bayesian inference, one needs to put a prior distribution on the parameters mu
, sigma
, and phi
, and on the initial latent state h[0]
.
The R package stochvol
uses several tricks to improve the sampling efficiency of the latent vector, most notably ASIS (ancillarity-sufficiency interweaving strategy) and AWOL (all without a loop).Stan
is the state-of-the-art probabilistic programming language, and JAGS
is a language for graphical models.
References: