Plot prior and posterior distributions of model hyperparameters
plot_prior_posterior.RdPlot posterior draws, analytical prior distributions, and (optionally) true values of hyperparameters in a fitted salmonIPM model.
Arguments
- object
An object of class salmonIPMfit with prior information stored in
prior.info.- pars
Character vector specifying hyperparameters to plot. The default is all top-level hyperparameters, i.e. those parameters that are given priors.
- include
Logical scalar defaulting to
TRUEindicating whether to include or exclude the parameters given bypars. IfFALSE, only entire multidimensional parameters can be excluded, rather than particular elements of them. This is most likely to be useful for excluding large correlation matrices from the plot.- true
Named list containing true hyperparameter values used to generate the pseudo-data to which
objectwas fitted. See theparsargument tosimIPM()for the structure of this list.
Value
A ggplot object. If the result is not assigned to an object, it will be automatically plotted.
Details
For each hyperparameter in pars, the posterior draws are plotted
as a density histogram with the prior PDF overlaid. If true is provided,
the known parameter value used to simulate the pseudo-data for the model
fit is shown as a vertical line.