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 |
General Mean
calculate_generalMean( raw_data, categorical_columns, weights_column, debt_column )
calculate_generalMean( raw_data, categorical_columns, weights_column, debt_column )
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. |
general mean
raw_data <- debt categorical_columns <- c(1,2) weights_column <- 3 debt_column <- 4 calculate_generalMean(raw_data, categorical_columns, weights_column, debt_column)
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
calculate_group_averages_matrix( raw_data, categorical_columns, weights_column, debt_column )
calculate_group_averages_matrix( raw_data, categorical_columns, weights_column, debt_column )
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. |
group averages matrix
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)
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
calculate_obs_and_group_weights( raw_data, categorical_columns, weights_column, debt_column )
calculate_obs_and_group_weights( raw_data, categorical_columns, weights_column, debt_column )
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. |
This function returns categorical group sizes.
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)
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
calculate_variance_and_std( raw_data, categorical_columns, weights_column, debt_column )
calculate_variance_and_std( raw_data, categorical_columns, weights_column, debt_column )
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. |
variance and sd.
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)
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
calculate_varianceComponents( raw_data, categorical_columns, weights_column, debt_column )
calculate_varianceComponents( raw_data, categorical_columns, weights_column, debt_column )
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. |
variance components
raw_data <- debt categorical_columns <- c(1,2) weights_column <- 3 debt_column <- 4 calculate_varianceComponents(raw_data, categorical_columns, weights_column, debt_column)
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
calculate_weights_of_obs_matrix( raw_data, categorical_columns, weights_column, debt_column )
calculate_weights_of_obs_matrix( raw_data, categorical_columns, weights_column, debt_column )
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. |
Weights of observation matrix.
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)
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)
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)
Muhlis Ozdemir [email protected] Seda Tugce Altan [email protected] Meral Ebegil [email protected]
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)
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)
This function returns of the column wise difference between the m matrix and the vector v
col_diff_matrix_with_vector(m, vec)
col_diff_matrix_with_vector(m, vec)
m |
is a matrix |
vec |
is a vector |
This function returns a num
matrix.
Throws an error message if at least 2 features is not in categorical format.
control_data(x)
control_data(x)
x |
a dataset. |
This function checks whether dataset
has at least 2 features in categorical format.
A real data which published by Turkey Banking Regulation and Supervisory Board <https://www.bddk.org.tr/BultenAylik/en>.
debt
debt
A data frame of 106 rows and 4 columns
categorical data of bank type. Bank type includes four subcategory such as State Banks, Deposit Banks, Foreign Banks and Privately Owned Deposit Banks
categorical data of dept type. Loan type includes three subcategory such as non-performing vehicle, home, and consumer loan.
Numeric values of weights
Numeric values of debt
This function returns of the column wise division of the m matrix and the vector v.
div_matrix_cols_with_vector(m, vec)
div_matrix_cols_with_vector(m, vec)
m |
is a matrix |
vec |
is a vector |
This function returns a num
matrix.
This function returns of the row wise division of the m matrix and the vector v.
div_matrix_rows_with_vector(m, vec)
div_matrix_rows_with_vector(m, vec)
m |
is a matrix |
vec |
is a vector |
This function returns a num
matrix.
The Credibility Premium Estimates
estimate_credibility( raw_data, categorical_columns, weights_column, debt_column )
estimate_credibility( raw_data, categorical_columns, weights_column, debt_column )
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. |
returns premium estimation of credibility.
raw_data <- debt categorical_columns <- c(1,2) weights_column <- 3 debt_column <- 4 estimate_credibility(raw_data, categorical_columns, weights_column, debt_column)
raw_data <- debt categorical_columns <- c(1,2) weights_column <- 3 debt_column <- 4 estimate_credibility(raw_data, categorical_columns, weights_column, debt_column)
This function returns of the column wise multiplication of the m matrix and the vector v.
mult_matrix_cols_with_vector(m, vec)
mult_matrix_cols_with_vector(m, vec)
m |
is a matrix |
vec |
is a vector |
This function returns a num
matrix.
This function returns of the row wise difference between the m matrix and the vector v
row_diff_matrix_with_vector(m, vec)
row_diff_matrix_with_vector(m, vec)
m |
is a matrix |
vec |
is a vector |
This function returns a num
matrix.
Get names
save_names(raw_data, categorical_columns)
save_names(raw_data, categorical_columns)
raw_data |
a data set of credibility. |
categorical_columns |
categorical column of data set. |
returns categorical variables' unique values and column names of data set.
raw_data <- debt categorical_columns <- c(1,2) save_names(raw_data, categorical_columns)
raw_data <- debt categorical_columns <- c(1,2) save_names(raw_data, categorical_columns)
Data prep
set_data(raw_data, categorical_columns, weights_column, debt_column)
set_data(raw_data, categorical_columns, weights_column, debt_column)
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. |
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.
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)
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)