天天看點

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

原文連結:http://tecdat.cn/?p=22226 

原文出處:拓端資料部落公衆号

兩個随機變量之間的相依性問題備受關注,相依性(dependence)是反映兩個随機變量之間關聯程度的一個概念。它與相關性(correlation)有差別,常用的相關性度量是Pearson相關系數,它隻度量了兩個随機變量之間的線性關系,其值不僅依賴于它們的Copula函數,而且還依賴它們的邊緣分布函數。

直覺地說,Copula函數就是兩個(或多個)随機變量的聯合分布可以表示為它們的邊緣分布函數的函數,這個函數就是Copula函數,它與随機變量的邊緣分布沒有關系,所反映的是兩個(多個)随機變量之間的“結構”,這種結構包含了兩個随機變量相依性的全部資訊。

Joe(1990)尾部相依性指數

Joe(1990)提出了一個(強)尾部相依性指數。例如,對于下尾,可以考慮

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

也就是

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula
  • 上下尾(經驗)相依性函數

我們的想法是繪制上面的函數。定義

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

下尾

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

對上尾來說,其中是

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

,相依的生存copula ,即

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

其中

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

現在,我們可以很容易地推導出這些函數的經驗對應關系,即:

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula
拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

是以,對于上尾,在右邊,我們有以下圖形

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

而對于下尾,在左邊,我們有

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

損失賠償資料 

Copula函數在經濟、金融、保險等領域有廣泛的應用.早在1998年Frees和Valdez(1998)研究了索賠額與管理費之間的關系,采用了Copula函數對其進行刻畫并應用于保費的定價。

對于代碼,考慮一些真實的資料,比如損失賠償資料集。

損失賠償費用資料有1,500個樣本和2個變量。這兩欄包含賠償金付款(損失)和配置設定的損失調整費用(alae)。後者是與解決索賠相關的額外費用(如索賠調查費用和法律費用)。

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

我們的想法是,在左邊繪制下尾函數,在右邊繪制上尾函數。

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

現在,我們可以将這個圖形,與一些具有相同Kendall's tau參數的copulas圖形進行比較

高斯copulas

如果我們考慮高斯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)
           
拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

Gumbel copula

或Gumbel的copula。

> copgumbel=gumbelCopula(paramgumbel, dim = 2)

> lines(c(u,u+.5-u[1])
           
拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

置信區間

但是由于我們沒有任何置信區間,是以仍然很難得出結論(即使看起來Gumbel copula比Gaussian copula更适合)。一個政策可以是從這些copula曲線中生成樣本,并可視化。對于高斯copula曲線

> 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")
           

包括–逐點–90%的置信區間

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

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

高斯copula曲線  

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

Gumbel copula曲線 

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

盡管統計收斂的速度會很慢,評估底層的copula 曲線是否具有尾部相依性簡單。尤其是當copula 曲線表現出尾部獨立性的時候。比如考慮一個1000大小的高斯copula 樣本。這是我們生成随機方案後得到的結果。

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

或者我們看一下左邊的尾巴(用對數比例)

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

現在,考慮10000個樣本。

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

在這些圖上,如果極限是0,或者是某個嚴格的正值,是相當難以斷定的(同樣,當感興趣的值處于參數的支援邊界時,這是一個經典的統計問題)。是以,一個簡單的想法是考慮一個較弱的尾部相依指數。

Ledford 和Tawn(1996)尾部相關系數

描述尾部相依性的另一種方法可以在Ledford & Tawn(1996)中找到。假設和具有相同的分布。現在,如果我們假設這些變量是(嚴格)獨立的。

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

但如果我們假設這些變量是(嚴格的)同單調性的(即這裡的變量是相等的,因為它們有相同的分布),則

是以,有這樣一個假設:

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

那麼a=2可以解釋為獨立性,而a=1則表示強(完美)正相依性。是以,考慮進行如下變換,得到[0,1]中的一個參數,其相依性強度随指數的增加而增加,例如

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

為了推導出尾部相依指數,假設存在一個極限,即

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

這将被解釋為一個(弱)尾部相依指數。是以定義函數

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

下尾巴(在左邊)

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

上尾(在右邊)。計算這些函數的R代碼非常簡單。

> 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")
           

 高斯copula函數

同樣,也可以将這些經驗函數與一些參數函數進行對比,例如,從高斯copula函數中得到的函數(具有相同的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])
           
拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

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")
           
拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

同樣,我們觀察置信區間,Gumbel copula在這裡提供了一個很好的拟合

極值copula

我們考慮copulas族中的極值copulas。在雙變量的情況下,極值可以寫為 

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

其中

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

為Pickands相依函數,它是一個凸函數,滿足于

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

觀察到,在這種情況下:

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

其中

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

肯德爾系數,可寫成

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

例如

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

那麼,我們就得到了Gumbel copula。 現在,我們來看(非參數)推理,更準确地說,是相依函數的估計。最标準的估計器的出發點是觀察

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

是否有copula函數 

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

具有分布函數

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

而反過來,Pickands相依函數可以寫成

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

是以,Pickands函數的自然估計是

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

其中,

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

是經驗累積分布函數

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

這是Capéràa, Fougères & Genest (1997)中提出的估計方法。在這裡,我們可以用

> 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"
           

整合得到Pickands相依函數的估計值。上圖中可以直覺地看到上尾的相依指數。

拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula
> A(.5)/2
[1] 0.4055346
           
拓端tecdat|R語言用Copulas模型的尾部相依性分析損失賠償費用原文連結:http://tecdat.cn/?p=22226 原文出處:拓端資料部落公衆号Joe(1990)尾部相依性指數損失賠償資料 高斯copulasGumbel copula置信區間Ledford 和Tawn(1996)尾部相關系數 高斯copula函數Gumbel copula極值copula

最受歡迎的見解

1.R語言基于ARMA-GARCH-VaR模型拟合和預測實證研究

2.r語言實作copula算法模組化依賴性案例

3.R語言COPULAS和金融時間序列資料VaR分析

4.R語言多元COPULA GARCH 模型時間序列預測

5.GARCH(1,1),MA以及曆史模拟法的VaR比較

6.matlab使用Copula仿真優化市場風險資料分析

7.R語言實作向量自動回歸VAR模型

8.R語言随機搜尋變量選擇SSVS估計貝葉斯向量自回歸(BVAR)模型

9.R語言VAR模型的不同類型的脈沖響應分析

繼續閱讀