| lookup_interpolated_value | R Documentation |
Select the applicable interpolation curve for a rating record and calculate a linearly interpolated value from the surrounding table points.
lookup_interpolated_value(
row,
coverage,
plan,
term_name,
lookup_var,
bounds = "error"
)
row |
A one-row data frame containing the rating record. |
coverage |
A character string identifying the coverage being rated. |
plan |
A |
term_name |
A character string identifying the rating term to look up. |
lookup_var |
A character string naming the numeric input variable used as the interpolation axis. |
bounds |
A character string controlling values outside the available
interpolation range. Supported values are |
A list containing the interpolated value and supporting trace information, including the lower and upper levels, values, interpolation weight, and factor-row identifiers.
factor_table <- data.frame(
state = c("IL", "IL"),
charter = c("STD", "STD"),
book_segment = c("new", "new"),
rate_eff_date = as.Date(c("2025-01-01", "2025-01-01")),
rate_exp_date = as.Date(c("2025-12-31", "2025-12-31")),
coverage = c("BI", "BI"),
term_name = c("limit_factor", "limit_factor"),
term_value = c(1.00, 1.20),
variable1 = c("limit_value", "limit_value"),
level1 = c("100", "200"),
stringsAsFactors = FALSE
)
rating_spec <- data.frame(
step_number = 1,
term_name = "limit_factor",
value_source = "interpolated_lookup",
calculation_type = "multiplicative",
lookup_var = "limit_value",
stringsAsFactors = FALSE
)
plan <- new_rating_plan(
factor_table = factor_table,
rating_spec = rating_spec,
coverages = "BI"
)
policy <- data.frame(
policy_id = "P1",
state = "IL",
charter = "STD",
book_segment = "new",
rating_date = as.Date("2025-06-01"),
limit_value = 150,
stringsAsFactors = FALSE
)
answer <- lookup_interpolated_value(
row = policy,
coverage = "BI",
plan = plan,
term_name = "limit_factor",
lookup_var = "limit_value"
)
answer$value
answer$interpolation_weight
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.