plot_fun: Plot bdrc model objects

View source: R/plm_methods.R

plot_funR Documentation

Plot bdrc model objects

Description

Visualize results from model objects in bdrc, plm0, plm, gplm0,gplm

Usage

plot_fun(
  x,
  type = "rating_curve",
  param = NULL,
  transformed = FALSE,
  title = NULL,
  xlim = NULL,
  ylim = NULL,
  ...
)

Arguments

x

an object of class "plm0","plm","gplm0" or "gplm".

type

a character denoting what type of plot should be drawn. Defaults to "rating_curve". Possible types are

  • "rating_curve" to plot the rating curve.

  • "rating_curve_mean" to plot the posterior mean of the rating curve.

  • "f" to plot the power-law exponent.

  • "beta" to plot the random effect in the power-law exponent.

  • "sigma_eps" to plot the standard deviation on the data level.

  • "residuals" to plot the log residuals.

  • "trace" to plot trace plots of parameters given in param.

  • "histogram" to plot histograms of parameters given in param.

  • "panel" to plot a 2x2 panel of plots: "rating curve", "residuals", "f" and "sigma_eps"

param

a character vector with the parameters to plot. Defaults to NULL and is only used if type is "trace" or "histogram". Allowed values are the parameters given in the model summary of x as well as "hyperparameters" or "latent_parameters" for specific groups of parameters.

transformed

a logical value indicating whether the quantity should be plotted on a transformed scale used during the Bayesian inference. Defaults to FALSE.

title

a character denoting the title of the plot. Defaults to NULL, i.e. no title.

xlim

numeric vector of length 2, denoting the limits on the x axis of the plot. Applicable for types "rating_curve","rating_curve_mean","f","beta","sigma_eps","residuals".

ylim

numeric vector of length 2, denoting the limits on the y axis of the plot. Applicable for types "rating_curve","rating_curve_mean","f","beta","sigma_eps","residuals".

Value

returns an object of class ggplot2.


bdrc documentation built on March 31, 2023, 11:41 p.m.