Bayesian Regression with Time-Varying Coefficients

Bayesian dynamic regression models where the regression coefficients can vary over time as random walks. Gaussian, Poisson, and binomial observations are supported. The Markov chain Monte Carlo computations are done using Hamiltonian Monte Carlo provided by Stan, using a state space representation of the model in order to marginalise over the coefficients for efficient sampling. For non-Gaussian models, walker uses the importance sampling type estimators based on approximate marginal MCMC as in Vihola, Helske, Franks (2017, ).


Build Status cran version downloads codecov

Walker provides a method for fully Bayesian generalized linear regression where the regression coefficients are allowed to vary over "time" as a first or second order integrated random walk.

The Markov chain Monte Carlo (MCMC) algorithm uses Hamiltonian Monte Carlo provided by Stan, using a state space representation of the model in order to marginalise over the coefficients for accurate and efficient sampling. For non-Gaussian models the MCMC targets approximate marginal posterior based on Gaussian approximation, which is then corrected using sequential Monte Carlo as in Vihola, Helske, Franks (2018).

See the package vignette for details and an examples.

NEWS

04.03.2019

  • Added methods fitted and coef for extracting the posterior means and and regression coefficents from the walker_fit object.
  • Fixed issue with Makevars and clang4 per request by CRAN.
  • Added option to predict on mean-scale, e.g, probabilities instead of 0/1 in Bernoulli case.
  • Fixed a bug in the Gaussian predictions, last time point was missing the observational level noise.

25.02.2019

  • Issue with upcoming staged installation in CRAN fixed by Tomas Kalibera.

14.02.2019

  • Dimension bug in GLM case fixed.

8.11.2018

  • Fixed StanHeaders search in Makevars.

22.10.2018

  • Pull request by Ben Goodrich for fixing the issue with clang4. New version on it's way to CRAN.

15.10.2018

  • Missing values in response variable are now supported.
  • Added gamma variables to models which can be used to damp the variance of the random walks.
  • Tidied some Stan codes in order to reduce deep copying.
  • Moved stan codes under src.
  • Increased the iteration counts in examples in order to pass CRAN tests. <

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("walker")

0.2.5 by Jouni Helske, 5 months ago


https://github.com/helske/walker


Report a bug at https://github.com/helske/walker/issues


Browse source code at https://github.com/cran/walker


Authors: Jouni Helske [aut, cre]


Documentation:   PDF Manual  


GPL (>= 2) license


Imports dplyr, ggplot2, KFAS, methods

Depends on Rcpp, bayesplot, rstan

Suggests diagis, gridExtra, knitr, rmarkdown, testthat

Linking to StanHeaders, rstan, BH, Rcpp, RcppArmadillo, RcppEigen

System requirements: C++14, GNU make


See at CRAN