R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Time:2021-11-28

Original link:http://tecdat.cn/?p=22226 

The problem of dependence between two random variables has attracted much attention. Dependence is a concept that reflects the degree of correlation between two random variables. It is different from correlation. The commonly used correlation measure is Pearson correlation coefficient. It only measures the linear relationship between two random variables. Its value depends not only on their copula function, but also on their edge distribution function.

Intuitively, Copula function is the joint distribution of two (or more) random variables, which can be expressed as the function of their edge distribution function. This function is copula function, which has nothing to do with the edge distribution of random variables. It reflects the “structure” between two (more) random variables, which contains all the information about the dependence of two random variables.

Joe (1990) tail dependence index

Joe (1990) proposed a (strong) tail dependence index. For example, for the lower tail, consider

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

that is

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

  • Upper and lower tail (experience)DependentSex function

Our idea is to draw the above function. definition

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Lower tail

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

For the upper tail, which isR language uses the tail dependence of copulas model to analyze the cost of loss compensationAndR language uses the tail dependence of copulas model to analyze the cost of loss compensation, dependent survival copula, i.e

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

among

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Now, we can easily deduce the empirical correspondence of these functions, namely:

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

So, for the upper tail, on the right, we have the following graph

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

And for the lower tail, on the left, we have

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Loss compensation data

Copula function is widely used in economy, finance, insurance and other fields. As early as 1998, frees and Valdez (1998) studied the relationship between claim amount and management fee, characterized it by copula function and applied it to premium pricing.

For the code, consider some real data, such as the loss compensation data set.

The loss compensation cost data has 1500 samples and 2 variables. These two columns contain compensation payments (losses) and allocated loss adjustment costs (alae). The latter are additional costs associated with the settlement of claims (such as claim investigation costs and legal costs).

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Our idea is to draw the lower tail function on the left and the upper tail function on the right.

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Now we can compare this graph with some copulas graphs with the same Kendall’s tau parameter

Gauss copulas

If we consider Gaussian copulas.

> copgauss=normalCopula(paramgauss)
> Lga=function(z) pCopula(c(z,z),copgauss)/z
> Rga=function(z) (1-2*z+pCopula(c(z,z),copgauss))/(1-z)

> lines(c(u,u+.5-u\[1\]),c(Lgs,Rgs)

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Gumbelcopula

Or Gumbel’s copula.

> copgumbel=gumbelCopula(paramgumbel, dim = 2)

> lines(c(u,u+.5-u\[1\])

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

confidence interval

However, since we do not have any confidence interval, it is still difficult to draw a conclusion (even if Gumbel copula seems more suitable than Gaussian copula). One strategy can be to generate samples from these copula curves and visualize them. For Gaussian copula curve

> nsimul=500
> for(s in 1:nsimul){
+ Xs=rCopula(nrow(X),copgauss)
+ Us=rank(Xs\[,1\])/(nrow(Xs)+1)
+ Vs=rank(Xs\[,2\])/(nrow(Xs)+1)
+ lines(c(u,u+.5-u\[1\]),MGS\[s,\],col="red")

Include – point by point – 90% confidence intervals

> Q95=function(x) quantile(x,.95)

> lines(c(u,u+.5-u\[1\]),V05,col="red",lwd=2)

Gaussian copula curve

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Gumbel copula curve

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Although the speed of statistical convergence will be very slow, it is simple to evaluate whether the underlying copula curve has tail dependence. Especially when copula curve shows tail independence. For example, consider a 1000 size Gaussian copula sample. This is the result of generating a random scheme.

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Or let’s look at the tail on the left (in logarithmic scale)

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Now, consider 10000 samples.

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

On these graphs, if the limit is 0 or a strict positive value, it is quite difficult to determine (similarly, when the value of interest is at the support boundary of the parameter, this is a classical statistical problem). Therefore, a simple idea is to consider a weaker tail dependence index.

===

_ Ledford_   And_ Tawn(1996)_ Tail correlation coefficient

Another way to describe tail dependencies can be found in Ledford & tawn (1996). It is assumed that and have the same distribution. Now, if we assume that these variables are (strictly) independent.

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

But if we assume that these variables are (strictly) homotonic (that is, the variables here are equal because they have the same distribution), then

Therefore, there is a hypothesis:

R language uses the tail dependence of copulas model to analyze the cost of loss compensation
Then a = 2 can be interpreted as independence, and a = 1 represents strong (perfect) positive dependence. Therefore, consider the following transformation to obtain a parameter in [0,1], whose dependence intensity increases with the increase of the index, for example

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

In order to derive the tail dependence index, it is assumed that there is a limit, that is

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

This will be interpreted as a (weak) tail dependent index. Therefore, define the function

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Lower tail (on the left)

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Upper tail (on the right). The R code for calculating these functions is very simple.

> L2emp=function(z) 2*log(mean(U<=z))/

> R2emp=function(z) 2*log(mean(U>=1-z))/
+ log(mean((U>=1-z)&(V>=1-z)))-1
> plot(c(u,u+.5-u\[1\]),c(L,R),type="l",ylim=0:1,

> abline(v=.5,col="grey")

Gaussian copula function

Similarly, these empirical functions can also be compared with some parameter functions, such as functions obtained from Gaussian Copula Functions (with the same Kendall’s tau).

> copgauss=normalCopula(paramgauss)
> Lgs =function(z) 2*log(z)/log(pCopula(c(z,z),
+ copgauss))-1
> Rgas =function(z) 2\*log(1-z)/log(1-2\*z+
+ pCopula(c(z,z),copgauss))-1

> lines(c(u,u+.5-u\[1\])

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Gumbel copula

> copgumbel=gumbelCopula(paramgumbel, dim = 2)
> L=function(z) 2*log(z)/log(pCopula(c(z,z),
+ copgumbel))-1
> R=function(z) 2\*log(1-z)/log(1-2\*z+
+ pCopula(c(z,z),copgumbel))-1

> lines(c(u,u+.5-u\[1\]),c(Lgl,Rgl),col="blue")

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Similarly, we observe the confidence interval, Gumbel copula provides a good fit here

Extreme copula

We consider the extreme copulas in the copulas family. In the case of two variables, the extreme value can be written as

R language uses the tail dependence of copulas model to analyze the cost of loss compensation
amongR language uses the tail dependence of copulas model to analyze the cost of loss compensationIs a pickands dependent function, which is a convex function satisfied with
R language uses the tail dependence of copulas model to analyze the cost of loss compensation
It is observed that in this case:
R language uses the tail dependence of copulas model to analyze the cost of loss compensation

amongR language uses the tail dependence of copulas model to analyze the cost of loss compensationKendall coefficient, which can be written as
R language uses the tail dependence of copulas model to analyze the cost of loss compensation

for example

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

So, we got Gumbel copula. Now let’s look at (nonparametric) reasoning, more precisely, the estimation of dependent functions. The starting point of the most standard estimator is observationR language uses the tail dependence of copulas model to analyze the cost of loss compensationIs there a copula function  

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

With distribution function
R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Conversely, the pickands dependency function can be written as

R language uses the tail dependence of copulas model to analyze the cost of loss compensation
Therefore, the natural estimation of pickands function is
R language uses the tail dependence of copulas model to analyze the cost of loss compensation
Among them,R language uses the tail dependence of copulas model to analyze the cost of loss compensationIs an empirical cumulative distribution function

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

This is the estimation method proposed in cap é R à a, Foug è res & GenesT (1997). Here, we can use

> Z=log(U\[,1\])/log(U\[,1\]*U\[,2\])
> h=function(t) mean(Z<=t)
> a=function(t){
function(t) (H(t)-t)/(t*(1-t))
+ return(exp(integrate(f,lower=0,upper=t,
+ subdivisions=10000)$value))

> plot(c(0,u,1),c(1,A(u),1),type="l"

The estimated values of pickands dependence function are obtained by integration. The dependence index of the upper tail can be seen intuitively in the figure above.

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

> A(.5)/2
\[1\] 0.4055346

R language uses the tail dependence of copulas model to analyze the cost of loss compensation

Most popular insights

1.An empirical study on fitting and prediction of R language based on arma-garch-var model

2.R language implementation of Copula algorithm modeling dependency case

3.R language copulas and VaR analysis of financial time series data

4.R language multiple copula GarCH model time series prediction

5.Var comparison of GARCH (1,1), Ma and historical simulation method

6.Matlab uses copula simulation to optimize market risk data analysis

7.Realization of vector Automatic Regression VAR model with R language

8.R language random search variable selection SSVS estimation Bayesian vector autoregressive (BVaR) model

9.Different types of impulse response analysis of VAR model in R language