Questions tagged [rstanarm]

An R package providing an interface for building and running inference for Bayesian regression models.

Estimates previously compiled regression models using the rstan package, which provides the R interface to the Stan C++ library for Bayesian estimation. Users specify models via the customary R syntax with a formula and data.frame plus some additional arguments for priors.

http://mc-stan.org/rstanarm/

66 questions
12
votes
2 answers

Not able to install rstanarm on Ubuntu 18.04 LTS

I'm not able to install rstanarm on R 3.5.3 running on Ubuntu 18.04 LTS. I used the following commands: install.packages("rstanarm") and devtools::install_github("stan-dev/rstanarm", build_vignettes = FALSE) and both throws the following…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
8
votes
3 answers

Plotting posterior parameter estimates from multiple models with bayesplot

I am using the great plotting library bayesplot to visualize posterior probability intervals from models I am estimating with rstanarm. I want to graphically compare draws from different models by getting the posterior intervals for coefficients…
gfgm
  • 3,627
  • 14
  • 34
7
votes
1 answer

How to extract stan code from rstanarm object

Is there a possibility to extract the stan code used for the MCMC sampling in rstanarm? I would like to compare my own parametrisation of a model and prior choices to the one used in rstanarm.
snaut
  • 2,261
  • 18
  • 37
6
votes
1 answer

How to specify random coefficients priors in rstanarm?

Suppose I have a following formula for a mixed effects model: Performance ~ 1 + WorkingHours + Tenure + (1 + WorkingHours + Tenure || JobClass) then I can specify priors for fixed slopes and fixed intercept as: prior = normal(c(mu1,mu2),…
5
votes
0 answers

sampling from posterior predictive distribution (stan vs inla)

I'm trying to implement functions from bayesplot package on a INLA object and a little unsure of how to draw from the posterior predictive distribution. I think I almost have it but rstan draws are more variable than the INLA ones. In rstan, using…
user63230
  • 4,095
  • 21
  • 43
5
votes
1 answer

Why `parameters::model_parameters` throws an error for negative binomial `rstanarm` model

I am trying to create a table for stan_glmer.nb (rstanarm) output, but model_parameters from the package parameters throws an odd error, that I am unsure how to solve. Perhaps this is a bug. Shortened sessionInfo() output for version info: R version…
Dylan_Gomes
  • 2,066
  • 14
  • 29
5
votes
1 answer

Get model estimates from another reference level, without running new model?

I am wondering if there is a simple way to change what values are in the intercept, perhaps mathematically, without re-running large models. As an example: mtcars$cyl<-as.factor(mtcars$cyl) summary( lm(mpg~cyl+hp,data=mtcars) ) Output: …
Dylan_Gomes
  • 2,066
  • 14
  • 29
4
votes
1 answer

Specifying priors for each predictor in rstanarm

I'm developing a Bayesian regression model through rstanarm that combines multinomial, binomial, and scale predictors on a scale dependent variable. As a regular model, my model would look as it does below: ```` * deaths - scale gender -…
r_user
  • 317
  • 3
  • 11
4
votes
1 answer

Optimizing Gaussian Process in Stan/rstan

I have recently encountered Gaussian process models and happen to think that they may be the solution to a problem I have been working on in my lab. I have an open and related question on Cross Validated, but I wanted to separate out my…
Matt Barstead
  • 235
  • 1
  • 8
3
votes
0 answers

library(tidymodels) not loading and not able to install rstanarm

Error received while trying to load tidymodels Error: package or namespace load failed for ‘tidymodels’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘rstanarm’ Error received while…
3
votes
0 answers

Is there a way to install tidymodels in R Version 3.6.1?

I'm also currently running an older version of Rstudio (Version 1.1.463) as my mac is running El Capitan (not enough memory to update). When trying to install and run 'tidymodels' I receive: Error: package or namespace load failed for ‘tidymodels’…
Olli
  • 85
  • 1
  • 3
3
votes
0 answers

rstanarm: Visualise/extract data of evidence accumulation (shift from prior to posterior)

I would like to visualise the shift from the prior to the posterior as data is gathered (for each new data point). I can visualise both the prior and the posterior: library(ggplot2) library(rstanarm) library(insight) library(bayestestR) model <-…
Dominique Makowski
  • 1,511
  • 1
  • 13
  • 30
2
votes
0 answers

Can I specify a random intercept in a conditional logit model?

In conditional logit models, global intercepts cannot be estimated as they do not influence the conditional probability of a positive outcome within groups. I understand the intercept term gets cancelled out in the derivation of the equation, just…
Olifa
  • 21
  • 3
2
votes
0 answers

Specifying priors from different distributions in rstanarm

Is there a way in rstanarm to specify priors over model parameters (e.g. model coefficents) that are drawn from different probability distribution families (e.g. Cauchy, Gaussian, Geometric, etc.) rather than simply letting the scale and location…
socialscientist
  • 3,759
  • 5
  • 23
  • 58
2
votes
2 answers

Why is Shiny giving an error when trying to deploy an app with the rstanarm package

Have been using the rstanarm package in Shiny apps on the Shiny server site for a long time and with a number of apps I've written. Recently, Shiny gives an error when trying to upload a new app that uses rstanarm. No problems if I do not use…
LPA
  • 21
  • 3
1
2 3 4 5