calc_adlp_component {ADLP}R Documentation

Accident and Development period Adjusted Linear Pools Component Models

Description

Accident and Development period Adjusted Linear Pools Component Models

Usage

calc_adlp_component(
  component,
  newdata,
  y = NULL,
  model = c("train", "full"),
  calc = c("pdf", "cdf", "mu", "sim")
)

calc_adlp_component_lst(
  components_lst,
  newdata,
  model = c("train", "full"),
  calc = c("pdf", "cdf", "mu", "sim"),
  ...
)

Arguments

component

Object of class adlp_component

newdata

Claims Triangle and other information. data.frame format of claims and related information for each cell. Dataframe will have columns origin and dev as columns 1 and 2 respectively.

y

Optional vector of y to be used in pdf or cdf calculations. Will default to the response fetched by model.frame.

model

Whether the training component model or the full component model should be used

calc

Type of calculation to perform

components_lst

List of objects of class adlp_component

...

Other parameters to be passed into calc_adlp_component

Details

Calls the specified function for an object of class adlp_component.

calc_adlp_component_lst is a wrapper for calc_adlp_component for each component in the list components_lst. This wrapper also contains functionality to signal the component that causes an error if it is occuring downstream.

Value

The result of the evaluated function on the adlp_component. This would be a vector with the same length as rows on newdata with the calculations.

Examples

data(test_adlp_component)

newdata <-  test_adlp_component$model_train$data
pdf_data = calc_adlp_component(test_adlp_component, newdata = newdata,
                          model = "train", calc = "pdf")

data(test_adlp_component)
test_component1 <- test_adlp_component
test_component2 <- test_adlp_component
test_components <- adlp_components(
    component1 = test_component1,
    component2 = test_component2
)

newdata <-  test_adlp_component$model_train$data
pdf_data = calc_adlp_component_lst(test_components, newdata = newdata,
                          model = "train", calc = "pdf")

[Package ADLP version 0.1.0 Index]