
Visualize Model Fit with Input Data
plot_fit.Rd
Creates a comprehensive visualization of the model fit overlaid on the input data. The plot can include multiple visualization elements:
Main plot showing data points and model fit with confidence intervals
Optional zoomed-in view of the observations
Optional secondary x-axis for alternative time scales
Optional time window highlights
Optional posterior distribution for the t0 parameter
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 containing a 'fit' field with model results- CI
Numeric value between 0 and 1 specifying the confidence interval width for the fit line. For example, 0.95 shows the 95% confidence interval. Defaults to 0.95
- legend_labels
Character vector providing custom labels for each group in
x$counts$group
. Must match the number of unique groups. Defaults to NULL- legend_title
Character string specifying the title for the plot legend. Defaults to "group"
- zoom
Logical indicating whether to include a zoomed-in panel focusing on the observation period. Defaults to TRUE
- full_process
Logical indicating whether to display the posterior distribution for the t0 parameter. Defaults to TRUE
- sec_axis_breaks
Numeric vector specifying the positions of breaks on the secondary x-axis. Must be provided together with sec_axis_labels. Defaults to NULL
- sec_axis_labels
Character vector providing labels for the secondary x-axis breaks. Must be provided together with sec_axis_breaks. Defaults to NULL
- t0_posterior_color
Character string specifying the color for the t0 posterior distribution plot. Defaults to "darkorange"
- shadows_colors
Character vector specifying colors for highlighting different time windows in the plot. Defaults to NULL