Visualise an object of class "RatioFit".
The plotted metric is the cross-product of metric and cell_type:
metric = "ratio",cell_type = "cumulative": cumulative loss ratio (default).metric = "incr_ratio"(i.e.,cell_type = "incremental"): per-period loss ratio.metric = "loss"/"premium": same split – cumulative or per-period amounts.
Confidence bands are drawn only for cumulative metrics
(cell_type = "cumulative"), since the fit output does not carry SE
columns for incremental projections.
Usage
# S3 method for class 'RatioFit'
plot(
x,
metric = c("ratio", "loss", "premium"),
cell_type = c("cumulative", "incremental"),
per_group = NULL,
ask = grDevices::dev.interactive(),
conf_level = 0.95,
show_interval = TRUE,
amount_divisor = "auto",
scales = c("fixed", "free_y", "free_x", "free"),
theme = c("view", "save", "shiny"),
nrow = NULL,
ncol = NULL,
...
)Arguments
- x
An object of class
"RatioFit".- metric
Metric to plot. One of
"ratio"(default),"loss","premium".- cell_type
Aggregation. One of
"cumulative"(default) or"incremental".- per_group
Logical or
NULL. WhenTRUE(auto for multi-group fits), produce one ggplot per group and print them sequentially withdevAskNewPage()– mirrors base R'splot.lm()pattern of stepping through related diagnostic plots. Returns the list of plots invisibly. WhenFALSE(auto for single-group fits), facets every (group, cohort) combination in a single ggplot.- ask
Passed to
devAskNewPage()whenper_group = TRUE. Defaults todev.interactive().- conf_level
Confidence level. Default is
0.95.- show_interval
Logical. Default is
TRUE.- amount_divisor
Numeric. Default is
1e8.- scales
Facet scale argument.
- theme
Theme string.
- nrow, ncol
Facet dimensions.
- ...
Additional arguments.
