scieee AI-readable full text Open interactive document viewer

IBNR techniques in health insurance: a machine learning approach

Sousa, Catarina Ferreira de Jesus de

Abstract

Loss reserves are typically one of the largest liabilities on an insurer’s balance sheet since they can have a significant impact on profits as well as the insurer’s solvency. The Chain Ladder model is an outstanding actuarial reserving technique that has been applied over the years to estimate Incurred But Not Reported claims. This project aims to provide the most accurate estimates possible for the calculation and prediction of reserve claim amounts in the context of corporate health insurance. For this, the Chain Ladder approach is compared with machine learning algorithms such as the Support Vector Machine (SVM), the Random Forest (RF), the Extreme Gradient Boosting (XGBoost) and Neural Networks (NN).

Full text

MEGI Mestrado em Estatística e Gestão da Informação Master Program in Statistics and Information Management NOVA Information Management School Instituto Superior de Estatística e Gestão da Informação Universidade Nova de Lisboa IBNR TECHNIQUES IN HEALTH INSURANCE: A MACHINE LEARNING APPROACH Catarina Ferreira de Jesus de Sousa Project work presented as partial requirement for obtaining the Master’s degree in Statistics and Information Management NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade NOVA de Lisboa IBNR TECHNIQUES IN HEALTH INSURANCE: A MACHINE LEARNING APPROACH by Catarina Ferreira de Jesus de Sousa Project work presented as partial requirement for obtaining the Master’s degree in Statistics and Information Management Adviser: Professor Doutor Roberto André Pereira Henriques Co-adviser: Professora Doutora Maria de Lourdes Belchior Afonso February, 2023 IBNR techniques in Health Insurance: A Machine Learning Approach Copyright © Catarina Ferreira de Jesus de Sousa, NOVA Information Management School, NOVA University Lisbon. The NOVA Information Management School and the NOVA University Lisbon have the right, perpetual and without geographical boundaries, to file and publish this dissertation through printed copies reproduced on paper or on digital form, or by any other means known or that may be invented, and to disseminate through scientific repositories and admit its copying and distribution for non-commercial, educational or research purposes, as long as credit is given to the author and editor. This document was created with the (pdf/Xe/Lua)L A T E X processor and the NOVAthesis template (v6.9.2) Lourenço, 2021. iii Acknowledgements I was entrusted with the opportunity to be an intern for a year to develop this project. It would not have been possible without the vote of confidence that Multicare gave me in the person of Maria do Carmo Ornelas. I would especially like to thank the SAC team for receiving me so well during this time. I take with me a lot of learning from this multidisciplinary team, focused on applying these recent data science methodologies to the business. To Filipa Marques, who was the heart of this project, thank you for your patience, kindness, and vision throughout this development. I could not fail to thank Mariana Vieira, Pedro Lopes, Miguel Cordeiro, and Pedro Gonçalves for all their support. A warm thank you to this incredible team. Additionally, I would like to sincerely thank Professors Roberto Henriques and Maria de Lourdes Afonso for all your guidance. The areas of specialization of each one were essential to being able to combine machine learning with actuarial expertise in this project. You were tireless in answering all of my concerns. Finally, I would like to express my gratitude to my family and friends for their support throughout this journey. v Abstract Loss reserves are typically one of the largest liabilities on an insurer’s balance sheet since they can have a significant impact on profits as well as the insurer’s solvency. The Chain Ladder model is an outstanding actuarial reserving technique that has been applied over the years to estimate Incurred But Not Reported claims. This project aims to provide the most accurate estimates possible for the calculation and prediction of reserve claim amounts in the context of corporate health insurance. For this, the Chain Ladder approach is compared with machine learning algorithms such as the Support Vector Machine (SVM), the Random Forest (RF), the Extreme Gradient Boosting (XGBoost) and Neural Networks (NN). Keywords: IBNR, Health Insurance, Chain Ladder, Machine Learning, Predicting Claims vii 5.15 Performance measures of the ’single’ models when the outputs are summed perbusiness ................................... 53 xiv xv Acronyms R2R-Squared 46, 48–50, 52, 54, 55 ANN Artificial Neural Network 11 CL Chain Ladder 2, 6, 11, 49–52 GLM Generalized Linear Model 10, 11 IBNR Incurred But Not Reported 1–3, 8, 10, 39, 55–57 LASSO Least Absolute Shrinkage and Selection Operator 10 LDFs Loss Development Factors 6, 10 MAE Mean Absolute Error 46, 49, 55 ML Machine Learning 2, 10, 47, 49, 55, 57 MSE Mean Squared Error 38, 46, 48 NN Neural Networks vii, 35, 36, 48, 49, 52, 54, 55 RF Random Forest vii, 31, 32, 38, 42, 49, 51, 55 RMSE Root Mean Squared Error 46, 49, 55 SSE Sum of the Square Errors 28 SVM Support Vector Machine vii, 34, 43, 48, 49, 52, 54, 55 SVR Support Vector Regression 34, 35 XGBoost Extreme Gradient Boosting vii, 11, 32–34, 49, 51, 52, 54–56, 58 xvii Chapter 1 Introduction In health insurance, the insurer covers a specific risk related to a person’s healthcare costs. The insurer undertakes to make the agreed payment in case of a random event provided for in the contract in exchange for a premium paid by the policyholder. These events, known as "claims" in the insurance industry, occur almost every day in the healthcare sector. However, there are several situations where there is a delay between the actual date of the event and the date it is reported to the insurer and accounted for in the balance sheet. This may happen because claims: may be reported within a certain time lag; the claims’ settlement process may take a long time or be reopened; or there may be insufficient claim information (Bornhuetter & Ferguson, 1972). Estimating reserves is then an essential task for any insurer to get an authentic picture of its liabilities, as they are also a measure of a company’s financial solvency. On the one hand, sufficient resources are needed to fulfill the liabilities arising from insurance contracts. On the other hand, excess provisions can affect the insurer’s profitability. Loss reserving is one of the most important topics within actuarial sciences. The total loss reserve can be divided into the reserve for known claims and the Incurred But Not Reported (IBNR) reserve. As Skurnick (1973) explains, "the reserve for known claims represents the amount of paid loss that will be required to settle all reported claims not including payments already made on these claims. The IBNR reserve represents the amount of paid loss that will be required to settle all incurred but not reported claims" (p. 17). A good reserving method will produce an estimated total loss reserve that is close to the required total loss reserve. There is a growing need to select appropriate reserving methodologies and assumptions that can be as practical as they are accurate and are often applied to imperfect data. Insurers must consider the duration of the insurance contract, the kind of coverage provided, and the likelihood of a claim occurring. Insurers also have to adjust their calculations as circumstances change. Over the past few years, several approaches have been carried out to calculate IBNR. 1 CHAPTER 1. INTRODUCTION With the development of artificial intelligence and Machine Learning (ML) models, it has been possible to improve the predictions of these calculations. In partnership with the Portuguese insurance company "Multicare - Seguros de Saúde, S.A." a work project was developed to assess the current method for calculating IBNR and build a new model using machine learning. This project compares traditional models with ML algorithms to understand how accurate each one is when it comes to predicting claim reserves when considering major databases. Therefore, firstly, the main objective was to understand and measure the level of accuracy that the current methods for calculating IBNR have and, secondly, to build a model using machine learning that could improve the obtained results. That said, this project will mainly focus on the following research question: at any given time, what is the most accurate way to estimate IBNR claims amount? To achieve this, it is necessary to determine if the machine learning model to be developed will be better than the current Chain Ladder (CL) method. Other critical research questions will also be considered: Can it be used in real-world business settings? Is it feasible? What are the advantages/disadvantages of ML methods vs. the statistical CL method in forecasting claim reserves? This master thesis is organized as follows. Section 2 presents the Chain Ladder method to give the reader an actuarial background. A brief overview of the work done in this area can be found in Section 3. Section 4 explains the methodology of this project. In section 5 the results are discussed and finally, in sections 6 and 7 the conclusion and recommendations for future work are presented. 1.1 Significance to the insurance company This project aims to respond to one of the needs of the Corporate Actuarial Support team. The data and conclusions drawn will support the calculations for corporate businesses contracts - when a company offers its employees’ health insurance benefits - and not for contracts at the individual level. When offering health insurance for corporate businesses there are two crucial moments for premium pricing: pricing, when a company wants to purchase a product for the first time and has no history with the insurance company; and renewal which takes place every year and aims to ensure that the insurance company is not losing profits, that is, that premiums are adjusted to the actual aggregated claims. Following the values of the insurer in question, of "reinventing the past with the future through constant innovation", several projects are underway to optimize pricing and renewal processes using contemporary data science and machine learning methodologies. This project work is one of them, focusing on improving the automation of the IBNR calculation needed for the renewal process. 2 1.1. SIGNIFICANCE TO THE INSURANCE COMPANY Each contract has a one-year duration (an annuity). At the beginning of the tenth month, the subscription team begins preparing for the renewal process. Their work depends on the loss ratio (represented in the equation 1.1) of each business. LossRatio =ClaimsAmount P remiums (1.1) If at the end of the annuity, the loss ratio of a business is greater than 1, that is, the claims amount is greater than the amount received in premiums, then the premium price of that business in the next annuity will have to be higher. In order to project the future loss rate, it is necessary to be aware of the claims that occurred in the last 9 months, whether those that have already been reported (and therefore are already known by the insurer), as well as those that are yet to be reported (IBNR component). Only by knowing these two installments can the claims that will occur in the last 3 months be projected. In addition, the calculation of IBNR claims is required every month for the company’s accounting. The model built here, if more efficient, should replace the method currently used in order, once again, to automate the process and provide more trustworthy results. The more reliable these reserve estimates are, the more opportunities the insurer will have to, on the one hand, offer a better product that stands out in the market, with the possibility of having more profit opportunities and, on the other, be more up to date with the current Directive of the European Union, Solvency II, which reduces the risk of insolvency. 3 Chapter 2 Actuarial Background 2.1 Terminology The moment in which a claim occurs, known as the accident period, may not coincide with the moment in which the same claim is reported or settled. The time that elapses between these two moments is called the development period. This information is usually represented in run-offtriangles, as the one shown in table 2.1, that is, an upper triangle where the lines represent the accident period and the columns the development period. These periods can be years, semesters, months, or other. Table 2.1: Run-offtriangle Accident period i/ Development period j 0 1 2 ... j ... n 0X0,0X0,1X0,2... X0,j ... 1X1,0... . . .. . . iXi,0 . . .. . . n−1 n Let observations Xij , with 0 ≤i≤n and 0 ≤j≤n−i , be the claims amount paid to the insurer for the development period jcorresponding to the accident period i. This information, available in table 2.1, is presented in the form of incremental data. It can also be represented in the form of cumulative data through the sum of incremental values: Cij = j X k=0 Xi,k (2.1) The main objective is to estimate the filling of the lower triangle, that is, to infer on the amounts that will be paid in the future. 5 Chapter 4 Methodology 4.1 Introduction One of the main objectives of this project is to build a machine learning model to optimise the calculation of claim reserves. However, it is also necessary to explain the assumptions and calculations currently made by the insurer. Therefore, in this chapter, the methodology used for the traditional approach and for the machine learning approach will be presented. It is important to note that the database to be used in the machine learning models will always have to be in line with the data used in the current model. Any machine learning strategy should start by following a data mining process. Currently, there is no standard framework to guide the development of data mining projects (Wirth & Hipp, 2000). CRISP-DM (CRoss Industry Standard Process for Data Mining) is a process that provides a framework for carrying out data mining projects that is independent of both the industrial sector and the technology used (Wirth & Hipp, 2000), consisting of 6 phases (Business Understanding, Data Understanding, Data Preparation, Modeling, Evaluation and Deployment) (Chapman et al., 2000). The methodology chapter will follow some of the phases of the CRISP-DM process represented in figure 4.1. The remaining phases are presented in the remaining chapters. It is essential that this chapter provides the necessary tools to make a comparison between models easily understandable. Data Understanding -Initial Data -Describe and Explore Data Data Preparation -Data Cleaning -Data Transformation -Data Reduction Modeling -Modeling tecnhiques -Test Design -Build Model -Verify Model Assumptions -Assess Model Figure 4.1: Methodology structure 13 CHAPTER 4. METHODOLOGY 4.2 Data Understanding The construction of the database was done using the SAS Enterprise Guide software (version 7.1). The ultimate goal was to create a database that included the same inputs as the Chain Ladder method, such as claim amounts, accident and accounting dates, but also information at the insured person level. Therefore, the database will need to be organized by company. Given the large amount of data and the computing power available, in order to make this project viable in real time, only a sample of 18 companies was considered. Furthermore, the time span was also reduced. Claims that occurred between 2015 and 2019 were selected - this means that when talking about accounting dates, the year 2020 and the first six months of 2021 were also considered. This selection of data enables a more comprehensive study of several models without the factor of computational power being detrimental. 4.2.1 Collect and Describe Initial Data To answer the purpose of this project, it was necessary to collect data from different sources. The first one had information about claims, containing 8 variables and 8.586.627 rows. Each observation in this dataset corresponded to a claim for a particular insured person. That person’s ID, the claim ID, the date it occurred, the date it was reported, and other information about the claim were therefore available. The variables of the claims dataset are represented in table 4.1. Table 4.1: Variables Claims dataset Variable Description SINISTRO Claim ID; CLIENTE Insured person ID; NEGOCIO Corporate business ID; COBERTURA Insurance coverage; DT_EFEITO_SINISTRO Accident date (format YYYYMM); DT_CONTABILIZACAO Accounting date (format YYYYMM); IDENTIFICA_SIN Identification of the type of claim; VALOR_PAGO Total claims amount (in euros) that the insurer had to pay. The second one had information about insured persons. One row represents information about an insured person at a particular company in a particular annuity. Therefore, if the same person is insured for, for example, three annuities, it will appear three times in this database. That person’s ID and other information about the person is available in about 4.229.046 observations. The 10 variables of the insured persons dataset are represented in table 4.2. 14 4.2. DATA UNDERSTANDING Table 4.2: Variables Insured Persons dataset Variable Description CLIENTE Insured person ID; NEGOCIO Corporate business ID; COBERTURA Insurance coverage; LIMITE_DESPESAS Available plafond that the insured person has in the respective coverage; PERC_COMP Percentage of co-payment that the insurer has to pay if the claim is in reimbursement (for the respective coverage); ANUIDADE Annuity start date (format YYYYMM); PARENTESCO Degree of kniship; IDADE Age; SEXO Gender; DISTRITO District where the insured person lives. 4.2.2 Data Exploration In this task, the data is examined more closely to get to know the data beyond its meaning, detect signs of data quality problems, and establish the data preparation steps. For this, simple data manipulation and basic statistical techniques are used. For each variable, the ranges of values and their distribution are analyzed. Some graphs are also presented in the data visualization section as it is essential to understand how the data behaves and connects with each other. 4.2.2.1 Quantitative Data From the Claims dataset, only the VALOR _ PAGO variable is considered as quantitative data. This will be the target variable, since the objective is to predict the amount of money that the insurer will have to pay in the future. As can be seen from the table 4.3, it can assume any value and is therefore a continuous variable. Its distribution is difficult to visualize since the range of values it can assume is very large and most of these values are concentrated close to 0. About 95% of the more than 8 million observations are between 0 and 100 euros. Figure 4.2 depicts the distribution of these 95% of observations. More than 2.7 million are in the first range between 0 and 5 euros. The ranges between 5 and 30 euros are also quite representative. Table 4.3: Quantitative data description Variable Mean Std Dev NAs Median Min Max VALOR_PAGO 54,9 439,6 - 14,0 0 118.645,7 LIMITE_DESPESAS 44.630 197.436 6.857 750 0 1.000.000 PERC_COMP 56,0 33,5 323.265 65 0 100 IDADE 32,7 15,9 - 35 0 111 15 CHAPTER 4. METHODOLOGY Figure 4.2: Distribution of amount paid (between 0 and 100 euros) Although age (the IDADE variable) is technically continuous, it is regarded as a discrete variable because the values are always presented as integers. The same happens with LIMITE _ DESPESAS and PERC _ COMP. The available plafond is always shown in multiples of 10. The percentage of co-payment is an integer value between 0 and 100%. The visualization and interpretation of these variables will be done later in conjunction with other qualitative variables. 4.2.2.2 Qualitative Data Table 4.4 shows the levels of each qualitative variable. The first, COBERTURA, corresponds to the seven segments that the health insurer covers. It is common to both the Insured Persons and Claims datasets, given that a person has health insurance for certain coverages and the claims that reach the insurer are from those coverages. Table 4.4: Qualitative data description Variable Type Levels COBERTURA Nominal AMBULATÓRIO; ESTOMATOLOGIA; INTERNAMENTO; MEDICAMENTOS; OUTROS; PARTO; PRÓTESES E ORTÓTESES DT_EFEITO_SINISTRO Ordinal Between 201501 and 201912 DT_CONTABILIZACAO Ordinal Between 201501 and 202106 IDENTIFICA_SIN Nominal SPE; SPNE; PROV PARENTESCO Nominal TITULAR; CONJUGE; FILHO(A); OUTRO SEXO Nominal F; M DISTRITO Nominal AVEIRO; BEJA; BRAGA; BRAGANÇA; CASTELO BRANCO; COIMBRA; FARO; GUARDA; LEIRIA; LISBOA; PORTALEGRE; PORTO; SANTARÉM; SETÚBAL; VIANA DO CASTELO; VILA REAL; VISEU; ÉVORA; ACORES; MADEIRA; ESTRANGEIRO ANUIDADE Ordinal Between 201501 and 201912 16 4.2. DATA UNDERSTANDING In figure 4.3 it is possible to see how many people are insured for each coverage (in yellow) and how many claims there were for each coverage (in gray). Most people have access to Outpatient (AMBULATÓRIO), Stomatology (ESTOMATOLOGIA), Inpatient (INTERNAMENTO), Prostheses and Orthoses (PRÓTESES E ORTÓTESES) and Other coverages (OUTROS). The number of claims in Outpatient and in Stomatology is much higher. This happens because each person has more than one claim in these coverages. For example, within the Outpatient, a person can go to the emergency room, can go to a doctor’s appointment, can do clinical analyses, exams, and many other acts. The number of Inpatients is much lower than the number of people insured. Figure 4.3: Count of coverages by Claims (gray) and Insured Persons (yellow) A claim can be identified as one of three categories: SPE, when a claim occurs; PROV, when there is some type of authorization; and SPNE, when the claim changes from SPE to PROV, that is, it already has authorization but will still occur. Figure 4.4 shows the distribution of each type of claim in the claims database. The SPEs are the most representative, as they are the most frequent, with more than 60%. Claims in PROV are those that exist in lesser quantity, since the process of accepting a claim is fast. The fact that it takes place after authorization may take longer, and therefore, there is greater representation in SPNE. Figure 4.4: Distribution of types of claims in the Claims database 17 CHAPTER 4. METHODOLOGY Regarding gender, figure 4.5 shows that there are more women than men in the database of Insured Persons. Most of them are holders (TITULAR), that is, they are employees who work in the companies under study. The rest belong to their household, with children (FILHO(A)) having more representation than the consorts (CONJUGE). Figure 4.5: Count of kinship degrees (DESC_EPARENTESCO) by gender (SEXO) Figure 4.6 represents the distribution of people across the districts of Portugal, the islands and abroad (DISTRITO). As the population patterns observed in the country, about 43% of the population under study lives in Lisboa. The districts of Porto and Setúbal also have some representation, with 23% and 11% of the sample. This is due to the fact that most companies are located in the metropolitan areas of Portugal. Other districts that are close to these, such as Santarém, Braga and Aveiro also have some insured persons. The cities that are further inland, such as Portalegre, Guarda and Bragança and the Açores islands, have less population, less employment, and therefore less representation of people who have health insurance. Those who live abroad are few cases where holders live in Portugal. Figure 4.6: Count of Insured Persons by district 18 4.2. DATA UNDERSTANDING 4.2.2.3 Data Visualization between different types of variables Figure 4.7 represents the age distribution (IDADE) by gender (SEXO). Given that the insurance contracts chosen for this project cover not only holders but their household, it is to be expected that children (age 15 and under) will have some representation in this database. It is normal that the number of young people between the ages of 15 and 20 is not so high given that it is an age when many lose their parents’ health insurance. On the other hand, there are also not many holders under the age of 20. The remaining distribution follows a normal behavior, with significantly more women than men. Figure 4.7: Age distribution (IDADE) by gender (SEXO) Other important variables are the plan conditions to which each person has access. In this case, we have information on the ceiling (LIMITE _ DESPESAS) that can be spent on each coverage (figure 4.8) and the percentage of reimbursement (PERC _ COMPARTICIPARCAO) that the insurer pays (figure 4.9). The higher the ceiling and the higher the percentage of co-payment, the more expenses will be borne by the insurer. Figure 4.8: Plafond boxplot by insurance coverage 19 CHAPTER 4. METHODOLOGY Figure 4.9: Reimbursement percentage boxplot by insurance coverage For an Outpatient, on average, people have 1.000 euros available and the insurance company usually pays all expenses (which does not happen in any other coverage). Coverages such as Stomatology, Medicine, Childbirth, and Prostheses and Orthoses have a lower available plafond between 250 and 2.000 euros with reimbursement between 50 and 75%. In the case of Inpacient, the available plafond varies a lot depending on the company. However, on average, people have 100.000 euros available and the insurance company pays an average of 80% of the expenses. To end the exploratory data analysis, figure 4.10 shows the total amount paid (over the 6 years available) that the insurer had to pay per company. As mentioned before, in this database there are 18 businesses that are represented here with the letters of the alphabet. Businesses A, B, and C are the ones with the highest expenses (since they are probably the ones with the most insured people). Inpatient and Outpatient care are the most significant coverage in all cases. Figure 4.10: Paid amount by insurance coverage (COBERTURA) per business (NEGOCIO) 20 4.3. DATA PREPARATION 4.3 Data Preparation Data preparation is the process of cleaning and transforming raw data. This phase encompasses all operations required to create the final dataset, which will be used to feed the models. For the sake of this project, this chapter will begin by transforming the data so that later on, it’s possible to integrate the two initial databases. The cleaning and selection of the most relevant variables will take place only after that. From these last 2 processes, the software used became R Cran, version 4.2.0. 4.3.1 Data Transformation 4.3.1.1 Aggregate data As explained earlier, the goal is to create a database that includes the same inputs as the Chain Ladder method. Therefore, the information at the level of the insured person had to be structured by business, for a certain year and month of accident, for a certain year and month of accounting, and for a certain coverage. As a result, the data was aggregated. In the case of the Claims dataset, the variables were grouped by: business ID (NEGOCIO); coverage (COBERTURA); accident date (DT _ EFEITO _ SINISTRO); accounting date (DT _ EFEITO _ CONTABILIZACAO); and type of claim (IDENTIFICA _ SIN). The amount paid is now summarized as the sum of the total amount paid for each of these groups (SUM _ of _ VALOR _ PAGO for now referred to as VALOR _ PAGO _ TOTAL). Thus, the claim ID (SINISTRO) and the client ID (CLIENTE) droppedfrom the database, as they correspond to individual variables. The similar approach was used to the Insured Persons dataset. The data was grouped by: business ID (NEGOCIO); coverage (COBERTURA); and annuity start date (ANUIDADE). The client ID variable also dropped. The rest of them were summed up as follows: •LIMITE_DESPESAS: Average plafond for that business, coverage and annuity; • PERC _ COMP: Average percentage of co-payment for that business, coverage and annuity; • PARENTESCO: Total count of people of each kinship, (for that business, coverage and annuity), thus creating 4 new columns - total count of holders, children, consorts and others; • IDADE: Variable used to create 8 new columns. For that business, coverage and annuity - the average age, the total count of people with less than 18 years, the total count of people with more than 65 years, the 10th, 25th, 50th (median), 75th and 90th percentiles of the distribution of each population. The idea behind the percentiles is that the models could better capture the age distribution. • SEXO: Total count of people of each gender (for that business, coverage and annuity), thus creating 2 new columns - total male count and total female count; 21 CHAPTER 4. METHODOLOGY The Elbow method runs the K-Means algorithm for each k , in a predefined range, and calculates the Sum of the Square Errors (SSE) of each one of them. The goal is to choose a small value of kthat still has a low SSE, i.e., a low distance to the centre. In order for the districts to be comparable, 2 pieces of information were extracted about each one: the average paid amount and the average delay. The Elbow Graphic 4.14 indicates that 3 is the ideal number of centroids. Then, figure 4.15 shows how K-Means divides the districts into the 3 clusters. Figure 4.15: Clustering Districts The clusters are essentially divided by the average paid amount: those that pay the most (green), medium (red) and least (blue). The red cluster is the one that contains the largest number of people, as it includes the metropolitan areas of Portugal. The green cluster has, on average, higher paid amounts because it is likely that in those districts of the country the supply of medical services is lower. Finally, the blue cluster is the one that has the lowest average paid amounts, however, it is also where the average delay to report claims is greater. 4.3.4 Current Dataset As an overview of everything accomplished in the methodology chapter until this point, the dataset is presented in this section. The current dataset has 71.042 observations. Table 4.5 includes the 30 variables and a brief description of each one. It is divided into sections: the first corresponds to the identification variables; the second corresponds to the variables about the people insured for that business, coverage, year and month (e.g., how many people had business A, for January 2015); the third corresponds to variables with amounts in euros; and the last to a random variable. 28 4.3. DATA PREPARATION Table 4.5: Variables currently available on the dataset Variable Description NEGOCIO Corporate business ID; COBERTURA Insurance coverage; ANO Accident year; MES Acciedent month; DELAY Delay (in months) between the accident month and the development month; LIMITE_DESPESAS Average plafond; PERC_COMP Average co-payment percentage for the insurer if the claim is in reimbursement; MES_NEGOCIO Month that the annuity for that business started; TITULAR Total holders count; FILHO.A Total children count; OUTRO_PARENTESCO Total count of other kniship; TEMPO_EM_RISCO Total count of insured persons; M Total male count; F Total female count; IDADE_MEDIA Average age; IDADE.18 Total count of people under the age of 18; IDADE.65 Total count of people above the age of 65; IDADE_PCTL10 10th percentile of the age distribution; IDADE_PCTL25 25th percentile of the age distribution, IDADE_PCTL50 Median of the age distribution, IDADE_PCTL75 75th percentile of the age distribution, IDADE_PCTL90 90th percentile of the age distribution, CLUSTER_DISTRITO1 Total count of people living in Açores, Aveiro, Beja, Évora, Faro, Lisboa, Leiria, Portalegre, Porto, Santarém and Setúbal; CLUSTER_DISTRITO2 Total count of people living in Braga, Bragança, Coimbra, Viana do Castelo, Vila Real e Viseu; CLUSTER_DISTRITO3 Total count of people living in Castelo Branco, Guarda, Madeira and abroad; VALOR_PAGO_TOTAL Total claims amount (in euros) that the insurer had to pay in that year, month and delay; DELAY0 Total claims amount (in euros) that the insurer had to pay in that year and month (at delay 0); VP_ACUMULADO Accumulated claims amount (in euros) that the insurer had to pay in that year and month until that DELAY; RANDOM Random numbers from a normal distribution. 29 CHAPTER 4. METHODOLOGY 4.3.5 Correlation Analysis In order to discover multicollinearity issues and identify features that may have greater predictive power in a model, it is crucial to check for correlation. The first step was to calculate the correlation between variables regardless of their type, i.e., whether they are continuous or categorical. To do this, all non-numeric variables were one-hot encoded using the model.matrix() function from the stats package (version 4.2.0). As no categorical variable showed highly correlated levels, and to make the data easier to visualize, from this point on, only the continuous variables were worked on. Their correlation can be seen through figure 4.16. The Spearman method was used in the calculation because it was not possible to guarantee a linear relationship between the variables. Figure 4.16: Correlation plot between quantitative variables As would be expected, ’TEMPO _ EM _ RISCO’ variable has a high level of correlations, as it represents the total number of insured persons and: • ’TITULAR’ + ’FILHO.A.’ + ’OUTRO_PARENTESCO’ = ’TEMPO_EM_RISCO’ • ’M’ + ’F’ = ’TEMPO_EM_RISCO’ • ’CLUSTER _ DISTRITO1’ + ’CLUSTER _ DISTRITO2’ + ’CLUSTER _ DISTRITO3’ = ’TEMPO_EM_RISCO’ The age variables also present high correlations among themselves. As for the target variable ’VALOR _ PAGO _ TOTAL’, it only highlights the relationship with the ’DELAY’, which will certainly be a feature present in the models. As regression models are not applied in this project, these variables will not be previously removed. Machine learning models can handle multicollinearity. However, a possibility for improving the models is identified here: not taking into account variables that are highly correlated. 30 4.4. MODELING 4.4 Modeling In this phase, the chosen techniques are specified. A brief description is given of each model, the assumptions that each requires, and how their parameters could be calibrated to optimal values. The division between training and testing is explained, as is how the most important variables are chosen. In the end, the measures that will enable model comparison and optimum model selection are presented. 4.4.1 Modeling Techniques It is crucial to identify the kind of problem that has to be solved in order to select the appropriate model. In this project, the objective is to predict the amount that the insurer will have to pay in the future on claims that occurred in the past. It is undoubtedly needed a supervised learning regression algorithm. Supervised learning algorithms try to model relationships and dependencies between the target prediction output (’VALOR_PAGO_TOTAL’) and the input features such that it’s possible to predict the output values for new data. And, it is a regression algorithm as the objective is to predict continuous outcomes. 4.4.1.1 Random Forest RF is an ensemble learning method built out of Decision Trees, developed by Leo Breiman (2001). Ensembles use multiple learning algorithms to obtain better predictive performance than could be obtained from any of the constituent learning algorithms alone. In addition to improving accuracy, an ensemble reduces the spread or dispersion of the predictions. RF algorithm have three main hyperparameters, which need to be set before training. These include node size N, the number of trees K, and the number of features sampled F. The algorithm works as follows: 1. Randomly select K subsets of data from the training set to construct K bootstrap datasets with repeated samples; 2. K trees are built using each bootstrap dataset. Each tree is built until there are fewer or equal to N samples in each node. In each node, F features are randomly selected (F is generally defined as the square root of the total number of features of the original dataset); 3. There are K trained models, and the final result for the regression task is produced by averaging the predictions of the individual trees – a technique known as Bagging (Breiman, 1996); 4. Samples that to not appear are called ’out-of bag’ samples and are used to validate the results through cross-validation. 31 CHAPTER 4. METHODOLOGY Figure 4.17: Flow chart of a Random Forest Algorithm Random Forest limits the greatest disadvantage of Decision Trees. Through the Bagging technique, it reduces the risk of overfitting due to subset and feature randomization. Firstly, because it uses a unique subset of the initial data for each model, which helps to make Decision Trees less correlated. On the other hand, it splits each node in every tree using a random set of features, which means that no single tree sees all the data. This helps to focus on the general patterns within the training data, reducing the correlation among decision trees and minimising sensitivity to noise. By averaging uncorrelated trees, the total variance and prediction error are decreased. RF also provides flexibility. It works well with no hyperparameter tuning, it is rather fast, robust, and can show feature importance. Moreover, it can handle large datasets efficiently and produce good predictions that can be easily understood. All of these possibilities make it a good option when compared to linear models. This algorithm is not flawless, though. As it often works with larger datasets, it requires more resources to store the data. Besides that, the process might be timeconsuming as it needs to compute data for each individual decision tree. Also, a major disadvantage is that RF is not able to extrapolate based on the data. The predictions it makes are always in the range of the training set. The Random Forest Regressor is unable to discover trends that fall outside of that range. So, if the problem to be solved requires identifying any sort of trend, Random Forest might not be able to formulate it. 4.4.1.2 Extreme Gradient Boosting While bagging consists of different individual models learning in parallel, boosting involves learning models in a sequence, i.e., each model is created taking into account the previous one. Within the gradient boosted trees algorithms it was developed the XG- Boost by Chen and Guestrin (2016). Given that it is an "optimized distributed gradient boosting library designed to be highly efficient, flexible, and portable" as the authors 32 4.4. MODELING mentioned, it is currently one of the most popular machine learning techniques. A brief description of its workflow is shown below: 1. The first line of the algorithm initializes to the optimal constant model, which is just a single terminal node tree. The residuals are then computed; 2. According to the additive training strategy of boosting, each tree is constructed based on learning from the residual r of the previous tree. The prediction of the i -th iteration is given by ˆ yi = ˆ yi−1 + Fi ( X ), i = 1 ,...,K . At every iteration, XGBoost optimizes the model and decreases the prediction error; 3. Repeat until the specified number of trees K is reached. The final prediction output ˆ yKis generated by the weighted summation of trees as follows: ˆ yK= K X i=0 Fi(X), Fk∈F,(4.1) where Fis the space of functions containing all regression trees; 4. To learn function F of each tree, XGBoost minimizes a regularized (L1 and L2) objective function that combines a convex loss function (based on the difference between the predicted and target outputs) and a regularization term to penalize the model complexity and prevent overfitting. Figure 4.18: Flow chart of an Extreme Gradient Boosting Algorithm XGBoost is reliant on the performance of a model and computational speed. It provides several benefits, including parallelization, distributed computing, cache optimization, and out-of-core computing. During training, XGBoost uses parallel computation to build trees across all CPU cores. It also distributes computing when it is 33 CHAPTER 4. METHODOLOGY training large models using machine clusters. Algorithms and data structures can also benefit from cache optimization to make the best use of the hardware that is available. For larger data sets that won’t fit into the conventional memory size, out-of-core computing is used. Furthermore, it can automatically determine the optimal missing value based on training loss, meaning that it can handle well with missing values. It includes regularization to prevent overfitting; it has in-built cross validation capability; and tree pruning uses a depth-first approach. This greatly enhances XGBoost’s computational efficiency and speed compared to competing GBM frameworks or other models. However, due to its high capacity to identify complex relationships, it is more likely to overfit than bagging techniques do. There are several ways to attenuate this drawback, including specifying some hyperparameters, such as regularization and early stopping. XGBoost might be sensitive to outliers, and it is almost impossible to scale up, because every estimator rests its accuracy on the prior predictions. 4.4.1.3 Support Vector Machine - Regression SVM is a popular machine learning tool for classification and regression, introduced by Vapnik (1995). The objective of the SVM algorithm is to find a hyperplane in an N-dimensional space, being N the number of features, that distinctly classifies the data points. The Support Vector Regression (SVR) adopts identical principles as the SVM for classification, with only a few minor differences. As the name suggests, it is a regression algorithm, where the output is a real number with infinite possibilities. The main idea is the same: to minimize error, individualizing the hyperplane which maximizes the margin, keeping in mind that part of the error is tolerated. More specifically: 1. Assume that the equation of the hyperplane is yi = xiβ + b . To ensure that is as flat as possible, the objective function is formulated as a convex optimization: minimize 1 2∥β∥2. Subject to all residuals having a value less than ε,|yi−(xiβ+b)|≤ε; 2. However, it is possible that no such function exists to satisfy these constraints for all points. To deal with otherwise infeasible constraints, introduce slack variables ξi and ξ∗ i for each point. The slack variables allow regression errors to exist up to the value of ξi and ξ∗ i , yet still satisfy the required conditions. Including slack variables leads to the objective function: minimize 1 2∥β∥2+C N X i=1 (ξi+ξ∗ i), with ξi≥0and ξ∗ i≥0 (4.2) Subject to yi−(xiβ+b)≤ε+ξiand (xiβ+b)−yi≤ε+ξ∗ i. 34 4.4. MODELING Figure 4.19: Flow chart of a Support Vector Machine Regression Algorithm The SVR algorithm seeks to fit the error inside a threshold value as opposed to other regression models that try to reduce the error between the actual and projected value. It is simpler to implement and robust against outliers. SVR provides a proficient prediction model while acknowledging the non-linearity in the data. However, in cases where the number of features for each data point exceeds the number of training data samples, the SVR will underperform as well as when the data set has more noise. It might not be suitable for large datasets. 4.4.1.4 Neural Networks NN, also known as Artificial Neural Networks, are computational models that are capable of extracting meaning from imprecise or complex data. The learning process finds patterns and detects trends, similar to how the human brain works, where biological neurons signal to each other. This concept was first proposed by Turing (1948). A neural network contains an input layer, zero or more hidden layers, and an output layer. Each layer has one or more nodes (figure 4.20). Each node connects to the nodes in the next layer, and each connection has an associated weight. Starting from input nodes, a neural network produce an output, which is the solution of a problem. The workflow is briefly described: 1. Define the connection weight between nodes. A gradient descent technique is used to compute coefficients to minimize the cost function. During the iterations these values will be updated in order to reach the best predicted value. 2. Each layer’s output is calculated forwardly by an activation function, f . The activation function can be linear or nonlinear. Commonly, a bias node (a constant, typically initialized to 1) is added to each input layer to shift the activation function. 35 CHAPTER 4. METHODOLOGY 3. The obtained value from the activation function will be the final value of this neuron at the current step, and continues until it reaches the final output. Figure 4.20: Flow chart of a Neural Network Algorithm Neural networks are flexible and can be used for both regression and classification problems. It is reliable in an approach of tasks involving nonlinear data with a large number of inputs and many features. After training, they are able to extract from a huge continuous stream of data only the information necessary for them, ignoring all extraneous noise. Once trained, predictions are made rather quickly. However, the hardware cost increases with the complexity of the problem, and its setup requires additional effort to maintain. The greater amount of data used during training, the more accurate the results are. Dependency on data is one of the leading disadvantages of NN, as some have to be on the maintenance side to watch it. Furthermore, most neural networks are blackbox systems, generating results based on experience and not on specified programs, making it difficult for modifications. 4.4.2 Test Design To build a reliable machine learning model, it is necessary to split the dataset into distinct sets. The training set is the set of data that is used to train and make the model learn the hidden features and patterns in the data. The validation set is used to validate model performance during training. This validation procedure gives information that may be used to adjust the hyperparameters and settings of the model. The main idea of splitting the dataset into a validation set is to avoid overfitting the model. After training is complete, the model is tested using a different set of data called the test set. It provides an unbiased final model performance metric in terms of accuracy and precision. 36 4.4. MODELING To help explain the test design made in this project, consider figure 4.21 that illustrates a business whose contract starts in January. As previously described, one of the insurer’s tasks is to predict, at the beginning of the tenth month of contract, the claims that will still arrive in the future, referring to accidents occurred in the first 9 months. Forecasting claims that occur at the tenth, eleventh and twelfth month is another different issue. As a result, claims related to the accident months of October, November, and December are disregarded (represented in dark grey). Regarding the remaining months, what is interesting for the insurer is to have a model with the ability to learn data that are not yet known. For instance, claims that happened in January and were reported in the same month (delay 0), in February (delay 1),..., and in September (delay 8) are already known. The same for claims that occurred in February. Those reported in the same month (delay 0) to those reported in September (with delay 7) are already known. What is not known a priori are the claims that will be reported from October on wards whose accident month was between January and September (which correspond to the yellow part). So, the ones that fall within the light grey area are removed. The same reasoning was taken into account for the other contracts that do not start in January: considering the tenth, eleventh and twelfth months and the delays of the remaining months. Figure 4.21: Slip representation between train, validation and test After selecting the appropriate data to train the model, the test design follows. For the training set, were considered the contracts that start between 2015 and 2017, corresponding to 17.872 observations (55%). For the validation set, were selected contracts that started in 2018 and for the test set, contracts of 2019, each corresponding to 7.344 observations (22.5% each). 37 CHAPTER 4. METHODOLOGY 4.4.5 Verify Chain Ladder assumptions Before applying the model, it is necessary to ensure that its main assumptions are verified. In Mack’s 1994 paper, a procedure was designed to test for calendar year influences (T. Mack, 1994). The ChainLadder package (version 0.2.15), available in R (Gesmann et al., 2022), provides some functions that simulate those procedures. This package was also used for all Chain Ladder method-related topics. One of the main assumptions is the non-correlation of individual development factors. The dfCorTest() function uses Spearman’s correlation coefficient to test this assumption. It is returned a statistic T that is assumed to be normally distributed. As a result, it is possible to provide a confidence interval threshold to evaluate the test’s outcome. If the metric is within the confidence interval, therefore the development factors are not correlated (Gesmann et al., 2022). Table 4.10 shows the results for each business and for each model to be applied. The data used in each instance are the test data from known claims (for a visual representation, see figure 4.21, test matrix, cells in light gray). If the output is ’False’ then the development factors are not correlated and the Chain Ladder method can be applied. Otherwise, if it is ’True’, the development factors are correlated, and, in theory, the method could not be applied. In cases where the output is ’NA’, it indicates that at least one of the columns of the triangle under study has the value 0. This means that it is not possible to calculate the correlation, much less the Chain Ladder method since it would have a development factor that had been divided by 0, which is impossible. Table 4.10: Test for proportionality between development years NEGOCIO All Coverages Outpatient Inpatient Remaining A True True True True B False False False True C True False True False D True True NA False E True True False False F True True NA True G True True NA True H False True NA False I False False NA False J NA NA NA NA K NA NA NA NA L NA NA NA NA M False True NA False N NA False NA NA O False NA NA False P False NA NA False Q NA NA NA NA R False True NA False 44 4.4. MODELING Another basic assumption is the independence between accident years, in this case, between accident months. The cyEffTest() tests for it in a similar way. If the output metric is within the confidence interval, therefore the triangle doesn’t have a Monthly Calendar Effect (Gesmann et al., 2022). Results are displayed in table 4.11. The abovementioned interpretation holds. Table 4.11: Test for independence between accident months NEGOCIO All Coverages Outpatient Inpatient Remaining A False True False True B False True False True C False False False False D True True True True E False False False False F True False True False G False NA False False H False False True False I False False False False J False False NA False K False False NA True L False False NA True M False NA NA False N False False NA False O True False NA True P False False NA False Q False False NA False R False NA False False For the data under study, the non-correlation between development factors is more challenging to ensure. Only 30% of the 72 matrices tested guaranteed this assumption. Results at the level of ’All coverages’ are easier to obtain because more data is available. For the remaining models, given that the data are split up, there are fewer observations, and therefore it becomes more challenging to demonstrate the assumption. Additionally, it seems that using the Chain Ladder approach becomes more difficult the smaller the insured universe is (i.e., the fewer employees a company has). In general, it can be said that there is a correlation between the subsequent months. The independence between accident months is easier to verify, being true for 62% of the matrices tested. Here, it should be noted once again that smaller businesses will have fewer claims, which means a lower likelihood of hospitalization, and thus, many missing values. As a result, the traditional Chain Ladder method might not be the ideal one to apply as it cannot guarantee the assumptions it requires, particularly in smaller businesses. Although the insurer does not calculate the coverage level, this method should be applied with caution. 45 CHAPTER 4. METHODOLOGY 4.4.6 Assess Model Performance measures are essential for supervised machine learning models to evaluate and track the performance of their predictions. Such metrics add substantial and necessary value in model selection and model assessment and can be used to evaluate different types of models. 4 error metrics are commonly used for regression models: 4.4.6.1 R-Squared (R2) The coefficient of determination, or R2 , is the proportion of variation in the outcome that can be explained by the predictor variables. It is a measure that provides information about the goodness of fit of a model. In the context of regression, it is statistical indicator of how closely the regression line resembles the actual data. The closer R2 is to 1, the better the model. R2= 1−Sum of Squares of Residuals T otal Sum of Squares = 1−P(yi−ˆ yi)2 P(yi−yi)2(4.3) 4.4.6.2 Mean Squared Error (MSE) MSE assesses the average of the squares of the errors, that is, the average squared difference between the observed actual outcome values and the values predicted by the model. When a model has no error, the MSE equals zero. As model error increases, its value increases. MSE =Mean((Observed −P redicted)2) = P(yi−ˆ yi)2 Number of observations (4.4) 4.4.6.3 Root Mean Squared Error (RMSE) Mathematically, the RMSE is the square root of the MSE. So, the lower the RMSE, the better the model. The RMSE is the used to return the MSE error to the original unit by taking the square root of it while maintaining the property of penalizing higher errors. MSE is more difficult to interpret and is more sensitive to outliers in absolute terms. RMSE =√MSE (4.5) 4.4.6.4 Mean Absolute Error (MAE) The MAE measures the prediction error similarly to RMSE. It is the average absolute difference between observed and predicted values. It is a linear score, which means that all the individual differences are weighted equally in the average. MAE is less sensitive to outliers compared to RMSE. MAE =Mean(Abs(Observed −P redicted)) = P(|yi−ˆ yi|) Number of observations (4.6) 46 Chapter 5 Results and Discussion In this chapter, the results of each model and their respective performances are given, employing all the methodologies previously presented. The models will be tested in the test subset, which is the final contract year available for each business. The output of each model is given at the corporate business level for each month, and delay, i.e., the value of each yellow cell in figure 4.21 is filled in. The first performance measures will be at the level of this output. However, the ultimate goal of this project is to have the most accurate results possible for each business, regardless of the month or the delay. The insurance company wants to predict after the first 9 months of the contract, the amount of claims that will arrive referring to these 9 months. Therefore, the error at a global level will also be analyzed, that is, the error that compares the total sum of estimates per business. These results will be more significant in the profitability analysis of ML models when compared to the traditional one. Furthermore, the ChainLadder package only provides outputs at the monthly level without considering the delay, so it is only possible to compare the traditional method on global errors. 5.1 ’All coverages’ models Table 5.1 then represents the first performance measures of the models. These are obtained directly from what comes out of the models - at the business, month, and delay level. Table 5.1: Performance measures of ’all coverages’ models Model R2 MAE MSE RMSE RF 0,84 795 4.629.478 2.151 XGBoost 0,83 755 4.751.250 2.179 SVM 0,03 1.170 27.035.432 5.200 NN 0,33 25.025 657.303.924 25.637 47 CHAPTER 5. RESULTS AND DISCUSSION Tables 5.2 and 5.15 represent the performance of the models when the outputs are summed per business. Table 5.2: Sum of ’all coverages’ outputs per business (in euros) NEG. Observed CL RF XGBoost SVM NN A 160.851 136.747 260.691 184.602 6.834 -1.784.102 B 1.756 68.368 -18.771 13.328 28.380 -2.191.478 C 109.169 102.455 139.710 94.777 41.952 -2.121.865 D 32.758 58.383 17.064 37.346 9.268 -2.209.037 E -6.001 22.493 17.879 11.589 9.098 -1.906.516 F -10.295 33.484 14.247 11.892 13.270 -2.219.767 G 14.067 16.101 18.179 13.879 2.379 -1.586.200 H 11.461 9.089 19.428 12.175 11.877 -1.903.943 I 1.792 21.800 6.344 7.451 7.655 -1.902.214 J -238 -10.710 1.210 2.310 -228 -951.278 K 5.820 2.867 1.027 2.757 8.487 -1.902.952 L 4.465 9.368 5.726 4.914 7.398 -1.902.842 M 1.538 5.255 6.116 3.635 3.146 -1.587.000 N 1.902 7.056 -154 3.458 3.538 -949.897 O 548 1.588 4.362 5.052 9.876 -1.900.601 P 5.067 1.848 4.419 3.672 7.050 -1.583.795 Q 1.478 4.552 6.163 2.007 4.760 -1.586.373 R 4.177 11.729 5.327 5.901 7.717 -1.902.513 Table 5.3: Performance measures of the models when the ’all coverages’ outputs are summed per business Model R2 MAE MSE RMSE RF 0,94 14.227 718.455.285 26.804 XGBoost 0,96 6.583 100.491.345 10.024 SVM 0,14 19.720 1.699.419.961 41.224 NN 0,03 1.801.815 3.380.862.954.724 1.838.712 CL 0,77 14.546 506.622.612 22.508 The expected prediction effect could not be captured by either the SVM or the NN models. They present the poorest performance measure outcomes. MSE is excessively high and R2 is too low, in particular for neural networks, meaning that the models did not adjust to the regression. NN generates similar outputs and far beyond the actual values. The number of layers might not be adequately adapted to the problem, or the standardization performed might not be the most correct. There are many more sophisticated experiments that could enhance NN performance, but the complexity required to apply them to real business scenarios is not worthwhile. Furthermore, the behaviour of the SVM model is unstable. Analyzing the absolute values reveals that in 5 cases (businesses E, H, J, K, and M), it turns out to be the one that manages to predict better. In other instances, though, it ends up failing so miserably that its performance metrics end up being inadequate. It is not a suitable choice because of its instability. 48 5.2. SINGLE MODELS The tree-based algorithms, on the other hand, had quite satisfactory results. At the individual level, both RF and XGBoost had very similar results. But when summed up by business, there is an obvious highlight for XGBoost, which has lower MAE and RMSE. In fact, in the 3 cases where RF was better at forecasting (businesses I, P, and R), XGBoost had similar predictions. The mean absolute error of this model is around 6.500 euros. To this day, Chain Ladder calculations are made without taking coverage into account. Therefore, the results presented in this section are those that correspond to what is currently being done. On average, the insurer is missing around 14.500 euros per business. Surprisingly, despite how simple the calculations are to perform, it turns out to be a really effective method. However, it only outperforms the ML models in 2 of the 18 businesses (C and O). When comparing only the CL method and the best ML model (XGBoost), it is possible to see that the new model made better predictions for 15 businesses and has better performance measures. 5.2 Single models As previously explained, given the importance of the coverage variable, a comparison was also carried out by separating the data into Outpatient, Inpatient, and the remaining ones. The results are presented in the following subsections. Given that many of the behaviours are repeated and the result of aggregating these results will be the most important, there won’t be very extensive analysis in this section. 5.2.1 ’Outpatient’ models When looking at only the most representative coverage - Outpatient - the results are as follows: Table 5.4: Performance measures of ’Outpatient’ models Model R2 MAE MSE RMSE RF 0,65 145 540.761 735 XGBoost 0,69 136 379.594 616 SVM 0,03 828 1.763.675 1.328 NN 0,61 715 895.542 946 If only the performance measures are compared, an enormous recovery of the NN model is observed, both from the R2 and the RMSE. However, table 5.5 shows that the absolute results per business are well below expectations. Just like for the SVM model. The outcomes for the remaining models are fairly good, with XGBoost showing a clear highlight, being closer to the observed values in 12 of the clients. Even though it has also a good performance, the CL model is consistently surpassed by the XGBoost. 49 CHAPTER 5. RESULTS AND DISCUSSION Table 5.5: Sum of ’outpatient’ outputs per business (in euros) NEG. Observed CL RF XGBoost SVM NN A 43.757 111.461 52.798 36.031 30.540 -4.965 B 5.535 16.057 18.048 13.729 -494 -34.435 C 8.308 50.417 36.125 22.519 -247 -30.981 D 12.915 23.237 13.840 9.206 -14.399 -44.007 E -1.835 5.871 7.541 3.149 3054 -41.807 F -1.439 8.015 5.485 3.691 -12.645 -45.885 G 4.520 6.436 10.031 4.530 -2.157 -43.407 H 2.055 3.539 4.853 1.901 -19.410 -46.714 I 2.096 5.478 3.918 1.837 -10.310 -46.098 J 1.435 2.199 1.960 1.439 -17.552 -46.470 K 1.093 294 1.514 661 -22.312 -46.612 L 1.034 1.461 1.582 1.163 -17.819 -45.995 M 420 1.594 1.404 1.154 -22.891 -46.310 N 1.343 1.173 1.427 759 -28.760 -45.632 O 133 557 544 493 -34.231 -46.133 P 851 1.192 920 573 -29.111 -46.128 Q 264 1.012 692 555 -31.619 -46.120 R 426 2.846 1.624 1.154 -21.366 -46.264 Table 5.6: Performance measures of the models when the ’Outpatient’ outputs are summed per business Model R2 MAE MSE RMSE RF 0,77 4.522 66.326.009 8.144 XGBoost 0,8 2.662 21.984.042 4.689 SVM 0,56 19.134 451.245.371 21.243 NN 0,86 46.493 2.176.559.996 46.654 CL 0,91 8.993 374.993.588 19.365 5.2.2 ’Inpatient’ models Looking at the results of the inpatient coverage data: Table 5.7: Performance measures of ’Inpatient’ models Model R2 MAE MSE RMSE RF 0,57 758 4.559.629 2.135 XGBoost 0,58 707 4.482.422 2.117 SVM 0,01 1.233 10.730.014 3.276 NN 0,47 4.768 26.569.080 5.155 Hospitalizations are a phenomenon that is considerably harder to predict, and the results reflect this. The R2score falls abruptly in all cases. Nevertheless, as shown in table 5.8, the conventional CL model would be incapable of predicting this coverage on its own for clients with lower claims amounts. This occurs because the CL cannot forecast during the months when the claims are null (don’t 50 5.2. SINGLE MODELS Table 5.8: Sum of ’Inpatient’ outputs per business (in euros) NEG. Observed CL RF XGBoost SVM NN A 52.447 -70.585 198.216 160.855 -25.739 -286.005 B -23.229 21.684 -83.067 -34.182 -75.497 -373.593 C 58.913 -10.293 26.919 9.723 -10.225 -312.062 D 5.423 -642 -12.948 -4.114 -20.725 -317.162 E -4.512 7.261 1.385 3.858 6.000 -312.402 F -12.409 16.536 1.627 -774 -31.201 -320.090 G 338 744 -905 -457 -8.492 -316.929 H 2.784 -507 9.792 1.182 -18.086 -300.377 I -5.252 NA -6.082 -1.487 -26.356 -320.253 J -1.673 NA -1.013 -1.186 -12.963 -320.786 K 2.023 NA 1.776 -1.347 -21.698 -321.394 L 731 NA 1.074 -405 -28.800 -322.625 M 320 NA 2.048 -57 -22.720 -321.252 N -1.194 NA -2.601 664 -12.625 -321.766 O -895 NA 938 -381 -11.687 -321.921 P 3.632 NA 1.001 266 -19.029 -321.765 Q 533 NA 1.535 -593 -20.073 -322.045 R 282 NA -710 -1.014 -26.654 -321.895 Table 5.9: Performance measures of the models when the ’Inpatient’ outputs are summed per business Model R2 MAE MSE RMSE RF 0,57 16.435 1.471.731.668 38.363 XGBoost 0,48 12.099 813.140.116 28.516 SVM 0,1 26.992 1 096.408.261 33.112 NN 0,4 324.032 105.233.511.099 324.397 CL 0,62 35.954 2.870.983.361 53.582 exist). For that reason, it is possible to determine that selecting the RF or XGBoost models would be a wise decision for 10 of the clients. For the remaining 8 clients, who present claims amounts in all months, the CL only proves to be better in 2 cases. 5.2.3 ’Remaining coverages’ models When adding data from Stomatology, Prostheses and Orthoses, Medicines, Childbirth, and other coverages the results are as follows: Table 5.10: Performance measures of ’remaining coverages’ models Model R2 MAE MSE RMSE RF 0,69 61 138.636 372 XGBoost 0,64 65 154.580 393 SVM 0,02 92 416.235 645 NN 0,39 453 528.103 727 51 CHAPTER 5. RESULTS AND DISCUSSION Table 5.11: Sum of ’remaining coverages’ outputs per business (in euros) NEG. Observed CL RF XGBoost SVM NN A 64.646 111.500 59.705 57.350 5.135 -72.127 B 19.450 26.953 44.228 37.570 23.309 -43.300 C 41.948 60.016 51.389 45.332 11.715 -27.423 D 14.420 27.154 12.709 9.932 399 -140.126 E 346 7.532 3.245 5.571 1.944 -98.051 F 3.553 8.484 6.476 9.717 1.717 -132.252 G 9.210 9.835 7.420 6.781 534 -85.582 H 6.622 6.658 8.766 6.307 3.780 -108.085 I 4.948 11.209 5.641 8.227 3.487 -113.276 J 0 NA 686 343 -804 -28.880 K 2.704 2.035 2.469 2.297 4.350 -111.992 L 2.700 6.568 3.161 3.044 3.995 -112.112 M 7.99 3.724 2.093 2.421 1.953 -84.123 N 1.753 NA 956 821 2.122 -28.017 O 1.310 NA 2.645 2.197 2.687 -109.839 P 584 NA 1.226 738 3.660 -82.822 Q 680 NA 2.148 1.837 2.013 -83.350 R 3.468 NA 4.205 4.123 3.767 -112.401 Table 5.12: Performance measures of the models when the ’remaining coverages’ outputs are summed per business Model R2 MAE MSE RMSE RF 0,89 3.276 42.419.912 6.513 XGBoost 0,91 3.178 27.871.255 5.279 SVM 0,16 7.522 265.456.459 16.293 NN 0,09 97.383 10.591.827.383 102.917 CL 0,98 9.305 239.978.373 15.491 Again, the CL proved to be incapable of making some predictions. Despite its good R2 score, it only reveals forecasts closer to those observed in 2 clients (businesses G and H). On the other hand, the SVM and NN models continue to show the same behavior, however, it should be noted that for businesses B, E, F, M, N, and R the SVM forecasts are closer to the real. Anyway, in this scenario, XGBoost would also be the chosen model. 5.3 Summed single models: ’Outpatient’, ’Inpatient’ and ’Remaining’ Results are presented in a similar way to the previous ones. Here, a new perspective is given to the insurer: making calculations at the coverage level in order to try to obtain some particular effect. Table 5.13 shows, at the business, month, and delay level, what it would be like if the insurer had models that summed up forecasts for Outpatient, 52 5.3. SUMMED SINGLE MODELS: ’OUTPATIENT’, ’INPATIENT’ AND ’REMAINING’ Inpatient, and other coverages individually. Table 5.13: Performance measures of summed single models Model R2 MAE MSE RMSE RF 0,82 817 4.899.051 2.213 XGBoost 0,83 779 4.810.907 2.193 SVM 0,03 2.102 28.067.883 5.298 NN 0,73 6.788 51.172.823 7.154 Tables 5.14 and 5.15 represent the performance of the models when those outputs are summed per business. As it is possible to observe in table 5.2, the same observed values are being compared under 2 different perspectives. Table 5.14: Sum of ’single’ outputs per business (in euros) NEG. Observed CL RF XGBoost SVM NN A 160.851 152.376 310.719 254.236 9.935 -363.097 B 1.756 64.695 -20.791 17.117 -52.682 -451.328 C 109.169 100.140 114.433 77.575 1.243 -370.466 D 32.758 49.749 13.602 15.024 -34.725 -501.295 E -6.001 20.664 12.171 12.579 10.998 -452.259 F -10.295 33.035 13.588 12.635 -42.129 -498.227 G 14.067 17.014 16.546 10.853 -10.115 -445.918 H 11.461 9.690 23.412 9.390 -33.716 -455.176 I 1.792 16.686 3.477 8.577 -33.179 -479.627 J -238 2.199 1.633 595 -31.319 -396.135 K 5.820 2.329 5.758 1.610 -39.659 -479.998 L 4.465 8.029 5.818 3.802 -42.624 -480.731 M 1.538 5.317 5.546 3.518 -43.658 -451.686 N 1.902 1.173 -218 2.244 -39.264 -395.415 O 548 557 4.127 2.309 -43.231 -477.893 P 5.067 1.192 3.146 1.576 -44.480 -450.715 Q 1.478 1.012 4.375 1.799 -49.679 -451.516 R 4.177 2.846 5.119 4.263 -44.252 -480.560 Table 5.15: Performance measures of the ’single’ models when the outputs are summed per business Model R2 MAE MSE RMSE RF 0,90 15.209 1.359.320.594 36.869 XGBoost 0,86 12.519 624.408.028 24.988 SVM 0,43 52.047 3.634.169.306 60.284 NN 0,45 467.909 220.091.629.717 469.139 CL 0,82 11.484 404.895.718 20.122 53 REFERENCES Mack, T. C. (1993). Distribution-free calculation of the standard error of chain ladder reserve estimates. ASTIN Bulletin,23, 213–225. (Cit. on pp. 6, 7, 9). Mack, T. C. (1999). Measuring the variability of chain ladder reserve estimates. (pp. 101–182). (Cit. on p. 9). McGuire, G., Taylor, G., & Miller, H. (2018). Self-assembling insurance claim models using regularized regression and machine learning. 51. doi:10.2139/ssrn.32419 06. (Cit. on p. 10) Mulquiney, P. (2006). Artificial neural networks in insurance loss reserving. In Proceedings of the 9th joint international conference on information sciences (jcis-06). doi:10.2991/jcis.2006.67. (Cit. on p. 11) Skurnick, D. (1973). A survey of loss reserving methods. Proceedings of the Casualty Actuarial Society,60, 16–58. (Cit. on p. 1). Turing, A. (1948). Intelligent machinery. doi:10.1093/oso/9780198250791.003.0016. (Cit. on p. 35) Vapnik, V. N. (1995). The nature of statistical learning theory. Springer-Verlag New York, Inc. (Cit. on p. 34). Wang, Z., Wu, X., & Qiu, C. (2021). The impacts of individual information on loss reserving. ASTIN Bulletin,51(1), 303–347. doi:10.1017/asb.2020.42. (Cit. on p. 10) Wirth, R., & Hipp, J. (2000). Crisp-dm: Towards a standard process model for data mining. In Proceedings of the fourth international conference on the practical application of knowledge discovery and data mining (pp. 29–39). (Cit. on p. 13). 60 Catarina Ferreira de Jesus de Sousa IBNR techniques in Health Insurance: A Machine Learning Approach MEGI 2023