I have been doing some testing with Stan for a while now in order to make some comparison with HMC and pseudo-marginal based MCMC algorithms, and as a byproduct (which is not related to pseudo-marginal stuff at all) I ended up creating an R package called walker
, which can be used for Bayesian inference of dynamic regression models. These models are essentially standard linear regression models, except that the regression coefficients are allowed to vary over “time” according to independent random walks. Compared to most obvious implementation, here the idea is to marginalise over the regression coefficients using Kalman filter, leading to faster algorithm which mixes and scales better as well.
Package with a short vignette can be found in Github: https://github.com/helske/walker and I will likely submit it to CRAN soon as well. Comments and especially pull requests are welcome, the interface for analyzing the results are still pretty rough, as I haven’t built custom methods for the post-processing), and the time series aspect of the model/results need sometimes bit special consideration when using standard methods (extract
, summary
etc) of stanfit
objects.
Enjoy.