Plot IC scores and the running best IC across a stored bifrost search
trajectory.
Usage
# S3 method for class 'icTrajectory'
plot(
x,
main = "IC Trajectory",
show_delta = "overlay",
ic_limits = NULL,
delta_limits = NULL,
xlab = "Search step",
ylab = NULL,
symbols = NULL,
scales = NULL,
point_sizes = NULL,
line_widths = NULL,
text_sizes = NULL,
annotation = NULL,
legend = TRUE,
...
)Arguments
- x
An
icTrajectoryobject.- main
Plot title.
- show_delta
One of
"overlay","panel", or"none". The default"overlay"draws proposaldelta_icvalues on a secondary y-axis."panel"draws them in a lower panel. Logical values are accepted for compatibility:TRUEmaps to"overlay"andFALSEmaps to"none".- ic_limits
Optional numeric vector of length 2 giving y-limits for the primary IC axis.
- delta_limits
Optional numeric vector of length 2 giving y-limits for the
delta_icpanel or secondary axis. The order is preserved, soc(high, low)reverses the axis and draws positivedelta_icvalues downward.- xlab, ylab
Axis labels.
- symbols
Optional named vector or list of point symbols. Valid names are
accepted,rejected,error,baseline, anddelta.- scales
Optional named numeric vector or list of global scale multipliers. Valid names are
point,line, andtext.- point_sizes
Optional named numeric vector or list of point sizes. Valid names are
accepted,rejected,error,baseline, anddelta.- line_widths
Optional named numeric vector or list of line widths. Valid names are
accepted,rejected,error,running_best,delta, andzero.- text_sizes
Optional named numeric vector or list of text sizes. Valid names are
main,axis,x_axis,y_axis,delta_axis,axis_label,annotation, andlegend.- annotation
Optional named numeric vector or list of annotation settings. Currently supports
baseline_label_offset, the text offset for the baseline IC annotation passed tographics::text()whenpos = 4.- legend
Legend controls. Use
TRUEorFALSEto show or hide the legend, or provide a named list with any ofshow,position,inset,bty, andlabels.position,inset,bty, andlabelsare passed tographics::legend()after validation. The default delta legend label is rendered as \(\Delta IC\).- ...
Unused; included for S3 compatibility.
Examples
search <- list(
baseline_ic = -1000,
IC_used = "GIC",
model_fit_history = list(
fits = list(
list(
step = 1, candidate_node = 42, regime_id = "1",
ic = -1010, accepted = TRUE, delta_ic = 10
),
list(
step = 2, candidate_node = 57, regime_id = "2",
ic = -1008, accepted = FALSE, delta_ic = -2
)
)
)
)
class(search) <- c("bifrost_search", "list")
traj <- icTrajectory(search)
plot(traj)
plot(
traj,
delta_limits = c(15, -5),
scales = c(point = 1.2, line = 1.1),
point_sizes = c(rejected = 0.7),
legend = list(position = "bottomleft")
)
