Learn R Programming

insurancerating (version 0.8.2)

autoplot.bootstrap_performance: Plot the resampled performance distribution

Description

Display the empirical distribution of resampled RMSE values from bootstrap_performance(). The histogram shows the observed resampling distribution, while the density curve provides a smooth visual summary.

Usage

# S3 method for bootstrap_performance
autoplot(object, fill = "#E6E6E6", color = NA, ...)

Value

A ggplot2::ggplot object.

Arguments

object

An object of class "bootstrap_performance", produced by bootstrap_performance().

fill

Fill colour of the histogram bars. Default is "#E6E6E6".

color

Border colour of the histogram bars. Default is NA, which removes bar borders.

...

Currently unused.

Author

Martin Haringa

Details

The dashed orange line marks the RMSE of the original fitted model. The dotted grey lines mark the 2.5 and 97.5 percent empirical quantiles of the resampled values when these can be calculated. Their distance provides a practical indication of sampling variability; it is not a formal prediction interval for future portfolio performance.

See Also

bootstrap_performance(), rmse()

Examples

Run this code
if (FALSE) {
mod1 <- glm(nclaims ~ age_policyholder, data = MTPL,
            offset = log(exposure), family = poisson())
x <- bootstrap_performance(mod1, MTPL, n_resamples = 100,
                           show_progress = FALSE)
autoplot(x)
}

Run the code above in your browser using DataLab