Breaking changes and deprecations:
add_predicted_draws(), etc) functions have been substantially restructured:
fitted_draws()are now deprecated, along with the
scaleargument. Several years’ teaching experience has demonstrated that “fitted” is a very confusing name for students. Use the more-specific [
linpred_draws()if you want draws from the linear predictor or the new [
epred_draws()if you want draws from the expectation of the posterior predictive (which is what
fitted_draws()was most typically used for).
value, but retain function-specific default column names. E.g. the
predicted_draws()is now spelled
valuebut has a default of
".prediction". One breaking change is that the default output column for
".value". This should make it easier to combine outputs across multiple functions while also making it easier to remember the name of the argument that changes the output column name.
nargument is now spelled
ndrawsto be more consistent with terminology in the
posteriorpackage and to prevent partial argument name matching bugs with
model, in order to match with argument names in
posterior_predict(), etc. This was necessary to prevent partial argument name matching bugs with certain model types in
rstanarmthat have an
margument to their prediction functions.
_rvarscounterparts to the
_drawsfamily of functions, including
predicted_rvars(), which add columns of
posterior::rvar()objects to data frames instead of long-format columns of draws. These can be easier to read and take up less memory than the long-format data frames of draws. See
unnest_rvars()functions for converting between data frames of
rvars and long format data frames of draws.
tidy_draws()has been rebuilt on top of
posterior::as_draws_df(), which means it should support even more model types and benefit from efficiency improvements in
posterior. This means that
cmdstanris now supported, for example.
posterior::summarise_draws()for grouped data frames of draws:
compare_levels()now supports data frames of
predicted_draws()functions should now support any models that implement
posterior_predict()so long as they take a
seedwhen subsampling to several functions (#276).
vignette("tidy-posterior")describing the use of
posterior, and particularly the
posterior::rvar()data type. This vignette also includes an updated version of the ordinal regression example from
vignette("tidy-brms"), now with an illustration of the relationship between the latent linear predictor and the category-level probabilities.
ggdistnow contains all stats/geoms from tidybayes (except deprecated ones), all support functions for stats/geoms (such as
tidybayesretains all other functions, and re-exports all
ggdistfunctions for now.
ggplot2. If needed, this can be overridden using the existing
h-suffix geoms are now deprecated. The
h-suffix geoms have been left in
tidybayesand give a deprecation warning when used; they cannot be used from
point_interval()functions are also deprecated, since they are not needed in tidybayes nor in
geom_lineribbon()no longer automatically set the
.upperare present in the data. This allows them to work better with automatic orientation detection (and was a bad feature to have existed in the first place anyway). The deprecated
tidybayes::geom_pointintervalh()still automatically set those aesthetics, since they are deprecated anyway (so supporting the old behavior is fine in these functions).
stat_lineribbon()now supports a
stepargument for creating stepped lineribbons (#249). H/T to Solomon Kurz for the suggestion.
ggdistnow has its own implementation of the scaled and shifted Student’s t distribution (
qstudent_t(), etc), since it is very useful for visualizing confidence distributions. That is re-exported in
Various minor forward and backward compatibility fixes:
stat_slabinterval()“meta-geom” (#84). This has enabled a bunch of new geoms to be created (see
vignette("slabinterval")and fixed a number of outstanding issues:
position = "dodge"correctly (#180)
geom_dotsinterval()(#210). These include a
quantilesparameter on the stats to make it easy to create quantile dotplots.
stat_dist_...family of geoms for both the
parse_dist(), which parses distribution specifications (like
normal(0,1)) into tidy columns, can be combined with the
stat_dist_...family of geoms to easily to visualize priors (e.g. from
dlkjcorr_marginal()and company), combined with
stat_dist_...family make it easy to visualize the marginal LKJ prior on a cell in a correlation matrix. (#191 #192)
vignette("freq-uncertainty-vis"), also made possible by the new
stat_dist_...family of geoms (#188)
tidy_draws()can now be applied to already-tidied data frames, allowing dependent functions (like
gather_draws()) to also be applied to data frames directly (#82). This can be a useful optimization in workflows where the initial tidying is slow but spreading/gathering is fast (see discussion in #144)
stat_dist_slabh(). An example of this usage is in
hdi()now uses trimmed densities by default to avoid odd behavior with bounded distributions (#165).
compare_levels(comparison = )now uses a modern tidy approach to dealing with unevaluated expressions, so
rlang::exprs()can be used in place of
geom_lineribbon()now works with
predicted_draws()give more helpful error messages on unsupported models (#177)
New features and documentation:
New features and documentation:
gather_pairsmethod for creating custom scatterplot matrices (and more!)
NAvalues are now better supported in
point_interval, and it has an