Plot posterior draws for a given parameter against a known marginal prior distribution.
Source:R/plot_prior_posterior.R
plot_prior_posterior.RdPlot posterior draws for a given parameter against a known marginal prior distribution.
Arguments
- draws_long
long-format posterior draws, as the output of
tidybayes::gather_draws()with auxiliary metadata columns as below.- prior_params
Named list of prior hyperparameter values, as the output of
wwinference::get_params()- fit_id_col
Name of a column in
draws_longthat uniquely identifies individual model fits within a facet. Default"forecast_date".- model_type_col
Name of a column in
draws_longthat identifies model types, so thatscale_fill_model()can be applied. Default"model_type".- variable_name
Name for the variable column. Default
".variable", matchingtidybayes::gather_draws().- value_name
Name for the value column. Default
".value", matchingtidybayes::gather_draws().- row_facet
Column to facet rows by. Default
"location".- custom_x_transform
Optional named list mapping parameter names to custom x transforms to use for that parameter's panels in the plot. If a parameter name is not matched, the identity transform will be used. Default
list(), which implies using the identity transform for all panels.- custom_xlim
Optional named list mapping parameter names to vectors specifying custom x limits to use for that parameter's panels in the plot. If a parameter name is not matched, x limits will be deferred to ggplot. Default
list(), which implies deferring limits for all parameters.