Skip to contents

Creates a plot showing the fit of the model over the input data. The plot can include a zoomed-in view, a secondary x-axis, and highlights for different time windows. Optionally, it can also display the posterior distribution for the parameter t0.

Usage

plot_fit(
  x,
  CI = 0.95,
  legend_labels = NULL,
  legend_title = "group",
  zoom = TRUE,
  full_process = TRUE,
  sec_axis_breaks = NULL,
  sec_axis_labels = NULL,
  t0_posterior_color = "darkorange",
  shadows_colors = NULL
)

Arguments

x

A bipod object that contains a 'fit' field.

CI

Numeric value between 0 and 1 representing the confidence interval for the fit. (default is 0.95)

legend_labels

Vector of labels for each unique group in x$counts$group. (default is NULL)

legend_title

Title for the legend. (default is "group")

zoom

Logical value indicating whether to present a zoomed-in view of the observations. (default is TRUE)

full_process

Logical value indicating whether to include the posterior for t0 in the plot. (default is TRUE)

sec_axis_breaks

Vector of values specifying where breaks should appear on the secondary x-axis. (default is NULL)

sec_axis_labels

Vector of labels for the secondary x-axis. (default is NULL)

t0_posterior_color

Color to use for the posterior distribution of t0. (default is 'darkorange')

shadows_colors

Colors to use for highlighting different time windows. (default is NULL)

Value

A ggplot2 object displaying the fit over the input data.