Plots a prior density after applying the same deterministic coefficient transformation used for formula-scale back-transforms. The helper supports continuous densities and point-mass priors in the same plot. The density is that of the monitored coefficient: a prior's multiply_by scaling applies only to the linear predictor and is not applied here.

plot_transformed_prior(
  prior_list,
  column_names,
  formula_scale = NULL,
  parameter,
  n_points = 1000,
  x_range = NULL,
  transformation = NULL,
  transformation_arguments = NULL,
  transformation_settings = FALSE,
  plot_type = c("base", "ggplot"),
  par_name = NULL,
  ...
)

Arguments

prior_list

named list of prior distributions.

column_names

character vector of coefficient column names defining the fitted parameter space.

formula_scale

optional nested formula-scale metadata: the formula_scale attribute of the fitted model (attr(fit, "formula_scale")), which carries the fitted design of each formula. Standardization information without the fitted design stops with a BayesTools_formula_transform_unavailable error.

parameter

coefficient name to plot.

n_points

number of plotting points. A prior density that needs numerical integration (a Gaussian convolution, a scale mixture, or a sum of two non-normal terms) is plotted at no more than 200 equally spaced points plus its support bounds, jumps, peaks and atoms.

x_range

optional plotting range on the untransformed scale.

transformation

optional output transformation passed to the prior plotting machinery.

transformation_arguments

optional list of transformation arguments.

transformation_settings

whether x_range is supplied on the transformed scale.

plot_type

either "base" or "ggplot".

par_name

optional plotting label.

...

additional plotting arguments.

Value

For plot_type = "base", invisibly returns base-plot metadata. For plot_type = "ggplot", returns a ggplot object. Returns NULL when the requested parameter is an identity transform and no output transformation was requested. A parameter without a prior in prior_list stops with an error. A prior density that is unavailable stops with an error of class BayesTools_formula_measure_unavailable; in particular, the standard deviation of a random-effect block with a scaled column has no density on this route (it needs the fitted design of the block) and is refused rather than returned as an identity.