powered by
Takes an object produced by construct_tariff_classes(), and plots the fitted GAM. In addition the constructed tariff classes are shown.
construct_tariff_classes()
# S3 method for constructtariffclasses autoplot( object, conf_int = FALSE, color_gam = "steelblue", show_observations = FALSE, color_splits = "grey50", size_points = 1, color_points = "black", rotate_labels = FALSE, remove_outliers = NULL, ... )
a ggplot object
constructtariffclasses object produced by construct_tariff_classes
construct_tariff_classes
determines whether 95\ The default is conf_int = FALSE
conf_int = FALSE
a color can be specified either by name (e.g.: "red") or by hexadecimal code (e.g. : "#FF1234") (default is "steelblue")
add observed frequency/severity points for each level of the variable for which tariff classes are constructed
change the color of the splits in the graph ("grey50" is default)
size for points (1 is default)
change the color of the points in the graph ("black" is default)
rotate x-labels 45 degrees (this might be helpful for overlapping x-labels)
do not show observations above this number in the plot. This might be helpful for outliers.
other plotting parameters to affect the plot
Martin Haringa
if (FALSE) { library(ggplot2) library(dplyr) x <- fit_gam(MTPL, nclaims = nclaims, x = age_policyholder, exposure = exposure) |> construct_tariff_classes() autoplot(x, show_observations = TRUE) }
Run the code above in your browser using DataLab