**3.2 Goodness-of-fit test**

Goodness-of-fit tests are useful to determine the validity of a theoretical model. There are different types of tests that can be used to perform the goodness-of-fit test, e.g. Kuiper, Cramer von Mises, and Pearson's chi-square test, but in this research work, we mainly focus on the KS and AD tests.


### **Table 3.**

*Value of skewness implications.*


**Table 4.** *Values of kurtosis implications.*

### *3.2.1 Kolmogorov-Smirnov test*

This test captures the deviation or variance around the median of the data. The KS test is computed using the maximum vertical distance between *Fn*ð Þ *x* and *F x*ð Þ, where *Fn*ð Þ *x* is the CDF of the empirical formula and *F x*ð Þ is the CDF of the observed data.

According to [2], KS test statistic is computed as follows: let *D*<sup>þ</sup> be the largest difference between *Fn*ð Þ *x* and *F x*ð Þ and let *D*� be the largest value between *F x*ð Þ and *Fn*ð Þ *x* . Then, mathematically,

$$D^{+} = \sup\_{x} \{ F\_n(x) - F(x) \} \tag{4}$$

$$D^{-} = \sup\_{\mathcal{X}} \{ F(\mathbf{x}) - F\_n(\mathbf{x}) \}. \tag{5}$$

Thus, the KS statistic is calculated as:

$$\text{KS} = \sqrt{n} \,\, \max\left\{ D^+, D^- \right\}, \tag{6}$$

which can be written as,

$$\sqrt{n}\max\left\{\sup\left\{\frac{j}{n}-z\_{(j)}\right\},\sup\left\{z\_{(j)}-\frac{j-1}{n}\right\}\right\}.\tag{7}$$

where *n* is the number of observations, *z*ð Þ*<sup>j</sup>* ¼ *F x*ð Þ*<sup>j</sup>* � � and *<sup>j</sup>* <sup>¼</sup> 1,2, … ,*n*.

For hypothesis testing, the null hypothesis is that the dataset that we will use for illustration purpose "Taxi claims" data follows the specified distribution, and the alternative hypothesis is that the "Taxi claims" data does not follow the specified distribution using a critical value of 5% throughout.

### *3.2.2 Anderson-Darling test*

This test is best suited for computing discrepancies around the tails. The test is mostly used for heavy-tailed data, and the test statistic of the AD test is given by:

$$\text{AD} = \sqrt{n} \sup |\frac{F\_n(\mathbf{x}) - F(\mathbf{x})}{\sqrt{F(\mathbf{x})(\mathbf{1} - F(\mathbf{x}))}}|\,\text{}\tag{8}$$

The computing formula is given by:

$$\text{AD}^2 = -n + \frac{1}{n} \sum\_{j=1}^{n} (\mathbf{1} - \mathbf{2}j) \log \left( z\_j \right) - \frac{\mathbf{1}}{n} \sum\_{j=1}^{n} (\mathbf{1} - \mathbf{2}(n-j)) \log \left( \mathbf{1} - z\_j \right). \tag{9}$$

## **3.3 Sensitivity analysis**

In this section, we perform the sensitivity analysis of the distribution that will be fitted to our data. The purpose of doing this is to show the effect of the different parameters' behavior on the tail and peak portion of the probability distribution. When testing for the effect of a parameter, we will fix all other variables and vary the parameter of interest.

In **Figure 1**, we varied *λ* as 0.5, 1 and 1.5. We can clearly see that at 0.5 we had a thicker tail, while at 1.5 we observe a thin tail. Thus, the more we increase *λ* we obtain

**Figure 1.** *Exponential distribution.*

**Figure 2.** *Gamma distribution.*

an exponential distribution with a thinner tail. In **Figure 2a**, *β* is fixed to be 2 with *α*∈ f g 2, 4, 6 , and we can clearly see that when *α* =2, the resulting gamma distribution has thin tails; however, for large *α*, the distribution has thicker tail. In **Figure 2b**, *α* is fixed and *β* is varied. It is observed that the gamma distribution has thin tails, when *β* is small and we have thick tails for large *β*.

In **Figure 3a**, with the *β* fixed, for small *α*, the Weibull distribution has a thick tail and a thin tail for large values of *α* . In **Figure 3b**, given that *α* is fixed, as *β* increases, we observe thicker tails; however, for small *β*, we observe thin tails. For *β* fixed, in **Figure 4a**, a small *α* yields a thicker tail; however, a larger one yields thin tails. Next in **Figure 4b**, with *α* fixed; a small *β* yields thin tail while a large one yields thicker tails.

In **Figure 5a**, when *α* is fixed at 0.5 and *γ* to be 10, we varied *β* to be 10, 20, and 30, and it is observed that when *β* is 30 there is a thicker tail and when *β* is 10 there is a

**Figure 3.** *Weibull distributions.*

**Figure 4.** *Pareto distributions.*

thin tail. That is, when the value of *β* is increased, the tails become thicker, and the opposite is true. In **Figure 5b**, *α* is fixed to be 0.5 and *β* to be 50, γ is varied to be 5, 10, and 15, and it is observed that when γ is 5 there is a thicker tail and when γ is 15 there is a thin tail. When we increase the value of γ the tails become thinner, and the opposite is true. In **Figure 5c**, γ is fixed at 10 and β to be 25, α is varied to be 0.5,1, and 1.5 and when α is 1 there is a thicker tail and when α is 1.5 there is a thin tail. When we increase the value of α, the tails become thinner, and the opposite is true.

In **Figure 6a**, we fixed the mean at 1 and varied standard deviation (stdev) to be 0.5, 1, and 1.5, and it is observed that when the stdev is 1, there is a thicker tail and when stevd is 0.5 there is a thin tail. In **Figure 6b**, we fixed stdev to be 1 and varied

*Quantifying Risk Using Loss Distributions DOI: http://dx.doi.org/10.5772/intechopen.108856*

**Figure 5.** *Burr distributions.*

**Figure 6.** *Log-normal distributions.*

the mean to be 0.5, 1, and 1.5. We can clearly see that when the mean is 1.5, there is a thicker tail and when mean is 0.5 there is a thin tail.
