rstanarm 2.21.3
CRAN release: 2022-04-08
Bug fixes
Fix bug where
loo()withk_thresholdargument specified would error if the model formula was a string instead of a formula object. (#454)Fix bug where
loo()withk_thresholdargument specified would error for models fit withstan_polr(). (#450)Fix bug where
stan_aov()would use the wrongsingular.oklogic. (#448)Fix bug where contrasts info was dropped when subsetting the model matrix in
stan_glm(). (#459)Fix bug where
stan_glmer()would error ifprior_aux=NULL. (#482)posterior_predict()andposterior_epred()don’t error withnewdatafor intercept only models by allowing data frames with 0 columns and multiple rows. (#492)
New features
New vignette on AB testing. (#409)
stan_jm()gains an offset term for the longitudinal submodel. (#415, @pamelanluna)Effective number of parameters are computed for K-fold CV not just LOO CV. (#462)
stan_clogit()now allows outcome variable to be a factor. (#520)
rstanarm 2.21.1
CRAN release: 2020-07-20
- Compatible with rstan v2.21.1
- Consistent with new book Regression and Other Stories
Backwards incompatible changes
stan_jm()is not available for 32bit Windows-
Some improvements to prior distributions, as described in detail in the vignette Prior Distributions for rstanarm Models and book Regression and Other Stories. These changes shouldn’t cause any existing code to error, but default priors have changed in some cases:
- default prior on intercept is still Gaussian but the way the location and scale are determined has been updated (#432)
-
autoscaleargument to functions likenormal(),student_t(), etc., now defaults toFALSEexcept when used by default priors (default priors still do autoscalinng). This makes it simpler to specify non-default priors. (#432)
Bug fixes
- Fixed error in
kfold()forstan_gamm4()models that usedrandomargument (#435) - Fixed error in
posterior_predict()andposterior_linpred()when usingnewdatawithfamily = mgcv::betar(#406, #407) -
singular.oknow rules out singular design matrices instan_lm()(#402) - Fix a potential error when
datais adata.tableobject (#434, @danschrage)
New functions
New method
posterior_epred()returns the posterior distribution of the conditional expectation, which is equivalent to (and may eventually entirely replace) setting argumenttransform=TRUEwithposterior_linpred(). (#432)Added convenience functions
logit()andinvlogit()that are just wrappers forqlogis()andplogis(). These were previously provided by thearmpackage. (#432)
rstanarm 2.19.2
CRAN release: 2019-10-03
Bug fixes
src/Makevars{.win} now uses a more robust way to find StanHeaders
Fixed bug where
ranef()andcoef()methods forglmer-style models printed the wrong output for certain combinations of varying intercepts and slopes.Fixed a bug where
posterior_predict()failed forstan_glmer()models estimated withfamily = mgcv::betar.Fixed bug in
bayes_R2()for bernoulli models. (Thanks to @mcol)loo_R2()can now be called on the same fitted model object multiple times with identical (not just up to rng noise) results. (Thanks to @mcol)
New features and improvements
New vignette on doing MRP using rstanarm. (Thanks to @lauken13)
4x speedup for most GLMs (
stan_glm()) and GAMs (stan_gamm4()withoutrandomargument). This comes from using Stan’s new compound_glmfunctions (normal_id_glm,bernoulli_logit_glm,poisson_log_glm,neg_binomial_2_log_glm) under the hood whenever possible. (Thanks to @avehtari and @VMatthijs)compare_models()is deprecated in favor ofloo_compare()to keep up with the loo package (loo::loo_compare())The
kfold()method now has acoresargument and parallelizes by fold rather than by Markov chain (unless otherwise specified), which should be much more efficient when many cores are available.For
stan_glm()withalgorithm='optimizing', Pareto smoothed importance sampling (arxiv.org/abs/1507.02646, mc-stan.org/loo/reference/psis.html) is now used to diagnose and improve inference (see https://avehtari.github.io/RAOS-Examples/BigData/bigdata.html). This also now means that we can use PSIS-LOO also whenalgorithm='optimizing'. (Thanks to @avehtari)For
stan_glm()the"meanfield"and"fullrank"ADVI algorithms also include the PSIS diagnostics and adjustments, but so far we have not seen any example where these would be better than optimzation or MCMC.
rstanarm 2.18.1
CRAN release: 2018-10-21
Bug fixes
-
stan_clogit()now works even when there are no common predictors -
prior.info()works better with models produced bystan_jm()andstan_mvmer()
New features and improvements
-
stan_glm()(only) gets amean_PPDargument that whenFALSEavoids drawing from the posterior predictive distribution in the Stan code -
posterior_linpred()now works even if the model was estimated withalgorithm = "optimizing"
rstanarm 2.17.4
CRAN release: 2018-04-13
Bug fixes
-
stan_jm()andstan_mvmer()now correctly include the intercept in the longitudinal submodel
New features and improvements
Compatible with loo package version
>= 2.0QR = TRUEno longer ignores theautoscaleargument and has better behavior whenautoscale = FALSEposterior_linpred()now has a draws argument like forposterior_predict()Dynamic predictions are now supported in
posterior_traj()forstan_jmmodels.More options for K-fold CV, including manually specifying the folds or using helper functions to create them for particular model/data combinations.
rstanarm 2.17.3
CRAN release: 2018-02-18
Minor release for build fixes for Solaris and avoiding a test failure
rstanarm 2.17.2
CRAN release: 2017-12-21
Lots of good stuff in this release.
Bug fixes
-
stan_polr()andstan_lm()handle theK = 1case better
Important user-facing improvements
The prior_aux arguments now defaults to exponential rather than Cauchy. This should be a safer default.
The Stan programs do not drop any constants and should now be safe to use with the bridgesampling package
hs()andhs_plus()priors have new defaults based on a new paper by Aki Vehtari and Juho Piironenstan_gamm4()is now more closely based onmgcv::jagam(), which may affect some estimates but the options remain largely the sameThe
product_normal()prior permitsdf = 1, which is a product of … one normal variateThe build system is more conventional now. It should require less RAM to build from source but it is slower unless you utilize parallel make and LTO
Big new features
stan_jm()andstan_mvmer()contributed by Sam Brillemanbayes_R2()method to calculate a quantity similar to \(R^2\)stan_nlmer(), which is similar tolme4::nlmerbut watch out for multimodal posterior distributionsstan_clogit(), which is similar tosurvival::clogitbut accepts lme4-style group-specific termsThe
mgcv::betarfamily is supported for the lme4-like modeling functions, allowing for beta regressions with lme4-style group terms and / or smooth nonlinear functions of predictors
rstanarm 2.15.3
CRAN release: 2017-04-29
Bug fixes
Fix to
stan_glmer()Bernoulli models with multiple group-specific intercept terms that could result in draws from the wrong posterior distributionFix bug with contrasts in
stan_aov()(thanks to Henrik Singmann)Fix bug with
na.actioninstan_glmer()(thanks to Henrik Singmann)
rstanarm 2.14.1
CRAN release: 2017-01-17
Bug fixes
VarCorr()could return duplicates in cases where astan_{g}lmermodel used grouping factor level names with spacesThe pairs()function now works with group-specific parametersThe
stan_gamm4()function works better nowFix a problem with factor levels after estimating a model via
stan_lm()
New features
New model-fitting function(s)
stan_betareg()(andstan_betareg.fit()) that uses the same likelihoods as those supported by thebetareg()function in the betareg package (Thanks to Imad Ali)New choices for priors on coefficients:
laplace(),lasso(),product_normal()The
hs()andhs_plus()priors now have newglobal_dfandglobal_scaleargumentsstan_{g}lmer()models that only have group-specific intercept shifts are considerably faster nowModels with Student t priors and low degrees of freedom (that are not 1, 2, or 4) may work better now due to Cornish-Fisher transformations
Many functions for priors have gained an
autoscaleargument that defaults toTRUEand indicates that rstanarm should make internal changes to the prior based on the scales of the variables so that they default priors are weakly informativeThe new
compare_models()function does more extensive checking that the models being compared are compatible
rstanarm 2.13.1
CRAN release: 2016-11-20
Bug fixes
- Fix bug in
reloo()if data was not specified - Fix bug in
pp_validate()that was only introduced on GitHub
New features
Uses the new bayesplot and rstantools R packages
The new
prior_summary()function can be used to figure out what priors were actually usedstan_gamm4()is better implemented, can be followed byplot_nonlinear(),posterior_predict()(with newdata), etc.Hyperparameters (i.e. covariance matrices in general) for lme4 style models are now returned by
as.matrix()andas.data.frame()pp_validate()can now be used if optimization or variational Bayesian inference was used to estimate the original model
rstanarm 2.12.1
CRAN release: 2016-09-13
Bug fixes
Fix for bad bug in
posterior_predict()when factor labels have spaces in lme4-style modelsFix when weights are used in Poisson models
New features
-
posterior_linpred()gains anXZargument to output the design matrix
rstanarm 2.11.1
CRAN release: 2016-07-29
New features
stan_biglm()function that somewhat supportsbiglm::biglmas.array()method for stanreg objects
rstanarm 2.10.1
CRAN release: 2016-06-25
Bug fixes
posterior_predict()with newdata now works correctly for ordinal modelsstan_lm()now works when intercept is omittedstan_glmer.fit()no longer permit models with duplicative group-specific terms since they don’t make sense and are usually a mistake on the user’s partposterior_predict()with lme4-style models no longer fails if there are spaces or colons in the levels of the grouping variablesposterior_predict()with ordinal models outputs a character matrix now
New features
pp_validate()function based on the BayesValidate package by Sam Cookposterior_vs_prior()function to visualize the effect of conditioning on the dataWorks (again) with R versions back to 3.0.2 (untested though)
rstanarm 2.9.0-3
CRAN release: 2016-02-13
Bug fixes
Fix problem with models that had group-specific coefficients, which were mislabled. Although the parameters were estimated correctly, users of previous versions of rstanarm should run such models again to obtain correct summaries and posterior predictions. Thanks to someone named Luke for pointing this problem out on stan-users.
Vignettes now view correctly on the CRAN webiste thanks to Yihui Xie
Fix problem with models without intercepts thanks to Paul-Christian Buerkner
Fix problem with specifying binomial ‘size’ for posterior_predict using newdata
Fix problem with lme4-style formulas that use the same grouping factor multiple times
Fix conclusion in rstanarm vignette thanks to someone named Michael
New features
Group-specific design matrices are kept sparse throughout to reduce memory consumption
The
log_lik()function now has anewdataargumentNew vignette on hierarchical partial pooling