楼主: tulipsliu
939 1

[学习分享] 金融时间序列学习 copula basic [推广有奖]

促进中国计量经济学发展学科带头人

学科带头人

43%

还不是VIP/贵宾

-

威望
0
论坛币
386093 个
通用积分
469.9098
学术水平
127 点
热心指数
140 点
信用等级
103 点
经验
46957 点
帖子
1769
精华
0
在线时间
2471 小时
注册时间
2007-11-5
最后登录
2024-4-19

初级热心勋章

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
================================
基础 copula 的使用
================================




虽然很多年前也通过R 软件,绘制了不同的图。 过去了五六年,新的程序绘制的图和多年以前绘制的图非常的不一样,不过感觉使用更方便,更强大。


粘贴几张图。


======================================================
Markov Switching Model

       AIC     BIC    logLik
  637.0736 693.479 -312.5368

Coefficients:

Regime 1
---------
               Estimate Std. Error t value  Pr(>|t|)   
(Intercept)(S)   0.8417     0.3026  2.7816  0.005409 **
x(S)            -0.0533     0.1347 -0.3957  0.692326   
y_1(S)           0.9208     0.0306 30.0915 < 2.2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.5034675
Multiple R-squared: 0.8375

Standardized Residuals:
          Min            Q1           Med            Q3           Max
-1.5153667482 -0.0906543177  0.0001873641  0.1656717258  1.2020898976

Regime 2
---------
               Estimate Std. Error t value  Pr(>|t|)   
(Intercept)(S)   8.6393     0.7254 11.9097 < 2.2e-16 ***
x(S)             1.8771     0.3107  6.0415 1.527e-09 ***
y_1(S)          -0.0569     0.0798 -0.7130    0.4758   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.9339683
Multiple R-squared: 0.2408

Standardized Residuals:
        Min          Q1         Med          Q3         Max
-2.31102193 -0.03317755  0.01034138  0.04509104  2.85245597

Transition probabilities:
           Regime 1   Regime 2
Regime 1 0.98499729 0.02290884
Regime 2 0.01500271 0.97709116


=======================================================

copula 对数似然函数图:


图1001.png


图1000.png

其他图:

图105.png 图104.png 图103.png 图102.png 图101.png

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Copula 金融时间序列 opula Basic ASIC

本帖被以下文库推荐

劳动经济学
沙发
tulipsliu 在职认证  发表于 2021-2-26 14:25:21 |只看作者 |坛友微信交流群
  1. ## Copyright (C) 2012 Marius Hofert, Ivan Kojadinovic, Martin Maechler, and Jun Yan
  2. ##
  3. ## This program is free software; you can redistribute it and/or modify it under
  4. ## the terms of the GNU General Public License as published by the Free Software
  5. ## Foundation; either version 3 of the License, or (at your option) any later
  6. ## version.
  7. ##
  8. ## This program is distributed in the hope that it will be useful, but WITHOUT
  9. ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  10. ## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  11. ## details.
  12. ##
  13. ## You should have received a copy of the GNU General Public License along with
  14. ## this program; if not, see <[url]http://www.gnu.org/licenses/[/url]>.

  15. ##>>> NOTA BENE must contain exactly the \dontrun{} part of
  16. ## ../man/gofCopula.Rd
  17. ## ===================

  18. ## A two-dimensional data example ----------------------------------
  19. x <- rCopula(200, claytonCopula(3))

  20. ## Does the Gumbel family seem to be a good choice (statistic "Sn")?
  21. gofCopula(gumbelCopula(), x)
  22. ## With "SnC", really s..l..o..w.. --- with "SnB", *EVEN* slower
  23. gofCopula(gumbelCopula(), x, method = "SnC", trafo.method = "cCopula")
  24. ## What about the Clayton family?
  25. gofCopula(claytonCopula(), x)

  26. ## Similar with a different estimation method
  27. gofCopula(gumbelCopula (), x, estim.method="itau")
  28. gofCopula(claytonCopula(), x, estim.method="itau")


  29. ## A three-dimensional example  ------------------------------------
  30. x <- rCopula(200, tCopula(c(0.5, 0.6, 0.7), dim = 3, dispstr = "un"))

  31. ## Does the Gumbel family seem to be a good choice?
  32. g.copula <- gumbelCopula(dim = 3)
  33. gofCopula(g.copula, x)
  34. ## What about the t copula?
  35. t.copula <- tCopula(dim = 3, dispstr = "un", df.fixed = TRUE)
  36. if(FALSE) ## this is *VERY* slow currently
  37.   gofCopula(t.copula, x)

  38. ## The same with a different estimation method
  39. gofCopula(g.copula, x, estim.method="itau")
  40. if(FALSE) # still really slow
  41.   gofCopula(t.copula, x, estim.method="itau")

  42. ## The same using the multiplier approach
  43. gofCopula(g.copula, x, simulation="mult")
  44. gofCopula(t.copula, x, simulation="mult")
  45. if(FALSE) # no yet possible
  46.     gofCopula(t.copula, x, simulation="mult", estim.method="itau")
复制代码


======================================

> ## Does the Gumbel family seem to be a good choice (statistic "Sn")?
> gofCopula(gumbelCopula(), x)
========Warning in fitCopula.ml(copula, u = data, method = method, start = start,  :
  possible convergence problem: optim() gave code=52
=====Warning in fitCopula.ml(copula, u = data, method = method, start = start,  :
  possible convergence problem: optim() gave code=52
======================Warning in fitCopula.ml(copula, u = data, method = method, start = start,  :
  possible convergence problem: optim() gave code=52
==============================================================

        Parametric bootstrap-based goodness-of-fit test of Gumbel copula, dim. d = 2, with
        'method'="Sn", 'estim.method'="mpl":

data:  x
statistic = 0.244, parameter = 2.09, p-value = 5e-04

> ## With "SnC", really s..l..o..w.. --- with "SnB", *EVEN* slower
> gofCopula(gumbelCopula(), x, method = "SnC", trafo.method = "cCopula")
==============================================================================================Warning in fitCopula.ml(copula, u = data, method = method, start = start,  :
  possible convergence problem: optim() gave code=52
===

        Parametric bootstrap-based goodness-of-fit test of Gumbel copula, dim. d = 2, with
        'method'="SnC", 'estim.method'="mpl", 'trafo.method'="cCopula":

data:  x
statistic = 0.565, parameter = 2.09, p-value = 5e-04

> ## What about the Clayton family?
> gofCopula(claytonCopula(), x)
=================================================================================================

        Parametric bootstrap-based goodness-of-fit test of Clayton copula, dim. d = 2, with
        'method'="Sn", 'estim.method'="mpl":

data:  x
statistic = 0.0163, parameter = 3.24, p-value = 0.44

>
> ## Similar with a different estimation method
> gofCopula(gumbelCopula (), x, estim.method="itau")
=================================================================================================

        Parametric bootstrap-based goodness-of-fit test of Gumbel copula, dim. d = 2, with
        'method'="Sn", 'estim.method'="itau":

data:  x
statistic = 0.163, parameter = 2.58, p-value = 5e-04

> gofCopula(claytonCopula(), x, estim.method="itau")
=================================================================================================

        Parametric bootstrap-based goodness-of-fit test of Clayton copula, dim. d = 2, with
        'method'="Sn", 'estim.method'="itau":

data:  x
statistic = 0.0169, parameter = 3.17, p-value = 0.31

>
>
> ## A three-dimensional example  ------------------------------------
> x <- rCopula(200, tCopula(c(0.5, 0.6, 0.7), dim = 3, dispstr = "un"))
>

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-19 23:51