2

Is there an R-Package I could use for Bayesian parameter estimation as an alternative to JAGS? I found an old question regarding JAGS/BUGS alternatives in R, however, the last post is already 9 years old. So maybe there are new and flexible gibbs sampling packages available in R? I want to use it to get parameter estimates for novel hierarchical hidden markov models with random effects and covariates etc. I highly value the flexibility of JAGS and think that JAGS is simply great, however, I want to write R functions that facilitate model specification and am looking for a package that I can use for parameter estimation.

  • 2
    Maybe rstan is what you're looking for – Edward Mar 16 '20 at 22:29
  • I second the suggestion to look into `Stan`/`RStan`. There also exist further (perhaps more "high-level") packages that are based on Stan like `rstanarm` and `brms` that allow you to e.g. use R's formula syntax and construct models based on a range of distributions and link functions. For example, `rstanarm` provides replacements for `glm` and `lm` (named `stan_glm` and `stan_lm`) that take similar syntax to the base R functions. – Maurits Evers Mar 16 '20 at 22:32
  • There is also always the option of coding your own samplers directly. – Dason Mar 16 '20 at 23:32
  • there is a comparison here: https://nature.berkeley.edu/~pdevalpine/MCMC_comparisons/some_ARM_comparisons/election/nimble_election88_comparisons.html – G. Grothendieck Mar 16 '20 at 23:57

1 Answers1

0

There are some alternatives:

  • stan, with rstan R package. Stan looks well optimized but cannot do certain type of models (like binomial/poisson mixture model), since he cannot sample a discrete variable (or something like that...).

  • nimble

  • if you want highly optimized sampling based on C++, you may want to check Rcpp based solutions from Dirk Eddelbuettel

Tomas
  • 57,621
  • 49
  • 238
  • 373