restrict_coef: Deprecated restriction helper

View source: R/model_refinement.R

restrict_coefR Documentation

Deprecated restriction helper

Description

restrict_coef() is deprecated as of version 0.9.0. Use add_restriction() instead.

prepare_refinement(model) |>
  add_restriction(...) |>
  refit()

Usage

restrict_coef(
  model,
  restrictions,
  allow_new_levels = TRUE,
  allow_new_risk_factors = TRUE
)

Arguments

model

A fitted model object.

restrictions

data.frame with exactly two columns.

allow_new_levels

Logical. If TRUE (default), restrictions may include tariff levels that were not observed when the model was fitted. See add_restriction().

allow_new_risk_factors

Logical. Whether a fixed tariff factor that is available in the model data but absent from the fitted model may be added. The default is TRUE to preserve the historical behaviour of restrict_coef(). New code using add_restriction() requires an explicit opt-in because its default is FALSE.

Value

A rating_refinement object containing the restriction step. Call refit() to apply the restriction and return the refined GLM. New code should use prepare_refinement() followed by add_restriction() directly.

See Also

add_restriction(), prepare_refinement(), refit()


insurancerating documentation built on July 30, 2026, 5:09 p.m.