Learn R Programming

insurancerating (version 0.8.2)

autoplot.check_residuals: Inspect simulation-based residual uniformity

Description

Plot the scaled residuals returned by check_residuals() against their theoretical uniform quantiles. Systematic departures from the diagonal can indicate remaining structure, distributional mismatch or influential observations in a fitted pricing model.

Usage

# S3 method for check_residuals
autoplot(object, show_message = TRUE, max_points = 1000, ...)

Value

A ggplot2::ggplot object.

Arguments

object

An object produced by check_residuals().

show_message

Logical. If TRUE, print a concise interpretation of the Kolmogorov-Smirnov p-value.

max_points

Maximum number of QQ-plot points to display. If the residual check contains more points, an evenly spaced subset is shown. Use Inf to display all points.

...

Currently unused.

Author

Martin Haringa

Details

The subtitle reports the uniformity-test p-value stored in object. This p-value is a diagnostic signal rather than a stand-alone model acceptance criterion. The shape and location of deviations should be assessed together with exposure, fitted values and relevant risk-factor levels.

Reducing max_points affects only the displayed QQ points; it does not change the residual calculation or the reported test.

See Also

check_residuals(), check_overdispersion()