Package 'cccm'

Title: Crossed Classification Credibility Model
Description: Calculates the credit debt for the next period based on the available data using the cross-classification credibility model.
Authors: Muhlis Ozdemir [aut, cre] , Seda Tugce Altan [aut, ctb] , Meral Ebegil [aut, ctb, ths]
Maintainer: Muhlis Ozdemir <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2024-12-11 06:47:45 UTC
Source: CRAN

Help Index


General Mean

Description

General Mean

Usage

calculate_generalMean(
  raw_data,
  categorical_columns,
  weights_column,
  debt_column
)

Arguments

raw_data

a data set of credibility.

categorical_columns

categorical column of data set.

weights_column

weights column of data set.

debt_column

credit dept column of data set.

Value

general mean

Examples

raw_data <- debt

categorical_columns <- c(1,2)

weights_column <- 3

debt_column <- 4

calculate_generalMean(raw_data, categorical_columns, weights_column, debt_column)

Group Averages Matrix

Description

Group Averages Matrix

Usage

calculate_group_averages_matrix(
  raw_data,
  categorical_columns,
  weights_column,
  debt_column
)

Arguments

raw_data

a data set of credibility.

categorical_columns

categorical column of data set.

weights_column

weights column of data set.

debt_column

credit dept column of data set.

Value

group averages matrix

Examples

raw_data <- debt

categorical_columns <- c(1,2)

weights_column <- 3

debt_column <- 4

calculate_group_averages_matrix(raw_data, categorical_columns, weights_column, debt_column)

Repeats of observations

Description

Repeats of observations

Usage

calculate_obs_and_group_weights(
  raw_data,
  categorical_columns,
  weights_column,
  debt_column
)

Arguments

raw_data

a data set of credibility.

categorical_columns

categorical column of data set.

weights_column

weights column of data set.

debt_column

credit dept column of data set.

Value

This function returns categorical group sizes.

Examples

raw_data <- debt

categorical_columns <- c(1,2)

weights_column <- 3

debt_column <- 4

calculate_obs_and_group_weights(raw_data, categorical_columns, weights_column, debt_column)

Variance and Standard Deviation

Description

Variance and Standard Deviation

Usage

calculate_variance_and_std(
  raw_data,
  categorical_columns,
  weights_column,
  debt_column
)

Arguments

raw_data

a data set of credibility.

categorical_columns

categorical column of data set.

weights_column

weights column of data set.

debt_column

credit dept column of data set.

Value

variance and sd.

Examples

raw_data <- debt

categorical_columns <- c(1,2)

weights_column <- 3

debt_column <- 4

calculate_variance_and_std(raw_data, categorical_columns, weights_column, debt_column)

Variance Components

Description

Variance Components

Usage

calculate_varianceComponents(
  raw_data,
  categorical_columns,
  weights_column,
  debt_column
)

Arguments

raw_data

a data set of credibility.

categorical_columns

categorical column of data set.

weights_column

weights column of data set.

debt_column

credit dept column of data set.

Value

variance components

Examples

raw_data <- debt

categorical_columns <- c(1,2)

weights_column <- 3

debt_column <- 4

calculate_varianceComponents(raw_data, categorical_columns, weights_column, debt_column)

Weights of observation matrix

Description

Weights of observation matrix

Usage

calculate_weights_of_obs_matrix(
  raw_data,
  categorical_columns,
  weights_column,
  debt_column
)

Arguments

raw_data

a data set of credibility.

categorical_columns

categorical column of data set.

weights_column

weights column of data set.

debt_column

credit dept column of data set.

Value

Weights of observation matrix.

Examples

raw_data <- debt

categorical_columns <- c(1,2)

weights_column <- 3

debt_column <- 4

calculate_weights_of_obs_matrix(raw_data, categorical_columns, weights_column, debt_column)

Crossed Classification Credibility Model.

Description

Estimation of premium credibility for Crossed Classification Credibility Model. In this model an insurance portfolio is subdivided by two qualitative risk factors, modeled in symmetrical way. Especially this model presents an alternative way when data is not classifiable in a hierarchical manner and to determine main effects of both risk factors. Also this model more useful to calculate co-effect both risk factors. Dannenburg et al., (1995, ISBN:90-802117-3-7)

Author(s)

Muhlis Ozdemir [email protected] Seda Tugce Altan [email protected] Meral Ebegil [email protected]

Examples

raw_data <- debt

categorical_columns = c(1,2)

weights_column = 3

debt_column = 4

calculate_generalMean(raw_data, categorical_columns, weights_column, debt_column)

calculate_variance_and_std(raw_data, categorical_columns, weights_column, debt_column)

calculate_group_averages_matrix(raw_data, categorical_columns, weights_column, debt_column)

calculate_weights_of_obs_matrix(raw_data, categorical_columns, weights_column, debt_column)

calculate_varianceComponents(raw_data, categorical_columns, weights_column, debt_column)

estimate_credibility(raw_data, categorical_columns, weights_column, debt_column)

Column Wise Matrix Diff

Description

This function returns of the column wise difference between the m matrix and the vector v

Usage

col_diff_matrix_with_vector(m, vec)

Arguments

m

is a matrix

vec

is a vector

Value

This function returns a num matrix.


Data checker

Description

Throws an error message if at least 2 features is not in categorical format.

Usage

control_data(x)

Arguments

x

a dataset.

Value

This function checks whether dataset has at least 2 features in categorical format.


Debt Data

Description

A real data which published by Turkey Banking Regulation and Supervisory Board <https://www.bddk.org.tr/BultenAylik/en>.

Usage

debt

Format

A data frame of 106 rows and 4 columns

bank

categorical data of bank type. Bank type includes four subcategory such as State Banks, Deposit Banks, Foreign Banks and Privately Owned Deposit Banks

loan

categorical data of dept type. Loan type includes three subcategory such as non-performing vehicle, home, and consumer loan.

weights

Numeric values of weights

debt

Numeric values of debt


Column Wise Matrix Division

Description

This function returns of the column wise division of the m matrix and the vector v.

Usage

div_matrix_cols_with_vector(m, vec)

Arguments

m

is a matrix

vec

is a vector

Value

This function returns a num matrix.


Row Wise Matrix Division

Description

This function returns of the row wise division of the m matrix and the vector v.

Usage

div_matrix_rows_with_vector(m, vec)

Arguments

m

is a matrix

vec

is a vector

Value

This function returns a num matrix.


The Credibility Premium Estimates

Description

The Credibility Premium Estimates

Usage

estimate_credibility(
  raw_data,
  categorical_columns,
  weights_column,
  debt_column
)

Arguments

raw_data

a data set of credibility.

categorical_columns

categorical column of data set.

weights_column

weights column of data set.

debt_column

credit dept column of data set.

Value

returns premium estimation of credibility.

Examples

raw_data <- debt

categorical_columns <- c(1,2)

weights_column <- 3

debt_column <- 4

estimate_credibility(raw_data, categorical_columns, weights_column, debt_column)

Column Wise Matrix Multiplication

Description

This function returns of the column wise multiplication of the m matrix and the vector v.

Usage

mult_matrix_cols_with_vector(m, vec)

Arguments

m

is a matrix

vec

is a vector

Value

This function returns a num matrix.


Row Wise Matrix Diff

Description

This function returns of the row wise difference between the m matrix and the vector v

Usage

row_diff_matrix_with_vector(m, vec)

Arguments

m

is a matrix

vec

is a vector

Value

This function returns a num matrix.


Get names

Description

Get names

Usage

save_names(raw_data, categorical_columns)

Arguments

raw_data

a data set of credibility.

categorical_columns

categorical column of data set.

Value

returns categorical variables' unique values and column names of data set.

Examples

raw_data <- debt

categorical_columns <- c(1,2)

save_names(raw_data, categorical_columns)

Data prep

Description

Data prep

Usage

set_data(raw_data, categorical_columns, weights_column, debt_column)

Arguments

raw_data

a data set of credibility.

categorical_columns

categorical column of data set.

weights_column

weights column of data set.

debt_column

credit debt column of data set.

Value

This function returns a tibble as prepared_data by using raw_data. Adds new columns to raw data as weighted_obs, group_average_weights, variance_column.

Examples

raw_data <- debt

categorical_columns <- c(1,2)

weights_column <- 3

debt_column <- 4

prepared_data <- set_data(raw_data, categorical_columns, weights_column, debt_column)