楼主: 110teddy
54493 94

[问答] 用winrats做dcc-mvgarch出的结果,求解释!   [推广有奖]

51
epoh 发表于 2013-1-7 13:46:29 |只看作者 |坛友微信交流群
urmine5683 发表于 2013-1-7 12:43
大神  我想请问

用上证综指和上证债指的对数收益率序列  希望能够得到股票市场与债券市场之间的动态相 ...
的确是不对,
方便的话上传数据,我跑看看

使用道具

52
urmine5683 发表于 2013-1-7 14:45:25 |只看作者 |坛友微信交流群
epoh 发表于 2013-1-7 13:46
的确是不对,
方便的话上传数据,我跑看看
这个是原始数据 有每天的收盘价  和对数收益率序列   麻烦了   yy.xls (536.5 KB)

使用道具

53
epoh 发表于 2013-1-7 16:50:01 |只看作者 |坛友微信交流群
urmine5683 发表于 2013-1-7 14:45
这个是原始数据 有每天的收盘价  和对数收益率序列   麻烦了
呵呵,数据关系,顶多如此,可能不适合DCC MODEL
open data stock_bond.xls
data(format=xls,org=columns) 1 729 stock bond
*
set stock = 100.0*stock
set bond = 100.0*bond


*

GARCH(P=1,Q=1,MV=DCC,DIST=T,NOMEAN,METHOD=BFGS,PMETHOD=SIMPLEX,PITERS=10) / STOCK BOND

MV-GARCH, DCC - Estimation by BFGS
NO CONVERGENCE IN 42 ITERATIONS
LAST CRITERION WAS  0.0000000
SUBITERATIONS LIMIT EXCEEDED.
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
Usable Observations                       729
Log Likelihood                       773.8323

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  C(1)                         0.1314733863 0.0325224446      4.04254  0.00005287
2.  C(2)                         0.0000188705 0.0000092710      2.03543  0.04180810
3.  A(1)                         0.0584092539 0.0267457363      2.18387  0.02897168
4.  A(2)                         0.0707581392 0.0170285604      4.15526  0.00003249
5.  B(1)                         0.6177495758 0.0621746840      9.93571  0.00000000
6.  B(2)                         0.9183814990 0.0168506521     54.50124  0.00000000
7. DCC(1)                       0.0000000000 0.0198162576 1.49057e-013  1.00000000
8.  DCC(2)                       0.9763070167 0.0666614112     14.64576  0.00000000
9.  Shape                        6.9749294610 0.8521048916      8.18553  0.00000000

使用道具

54
urmine5683 发表于 2013-1-7 17:10:31 |只看作者 |坛友微信交流群
epoh 发表于 2013-1-7 16:50
呵呵,数据关系,顶多如此,可能不适合DCC MODEL
open data stock_bond.xls
data(format=xls,org=column ...
呜呜  悲剧了  我感觉我的论文直接被颠覆了。。。得重新找找思路了。。。。。。。我本来是想通过分析股票与债券市场之间的动态相关性  从而将几个债券作为信用资产 形成信用资产组合来定价  由股价的波动来影响信用资产组合的相关性

那现在股票市场与债券市场没有动态相关性的话  怎么理清这个思路嘞。。。


真心感谢您的热心帮忙   撒花

使用道具

55
urmine5683 发表于 2013-1-7 17:45:12 |只看作者 |坛友微信交流群
epoh 发表于 2013-1-7 16:50
呵呵,数据关系,顶多如此,可能不适合DCC MODEL
open data stock_bond.xls
data(format=xls,org=column ...
我这么想对不对  既然股票市场和债券市场没有动态相关性  
根据莫顿的结构是模型
分开考虑一个公司的股票和债券
由股票市场得到公司间的动态相关性
债券信用方面是另一套相应规则(如评级影响违约  是针对个体方面)
从来来为信用资产组合定价。。。
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
epoh + 1 + 1 + 1 鼓励积极发帖讨论

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

使用道具

56
epoh 发表于 2013-1-7 18:13:32 |只看作者 |坛友微信交流群
urmine5683 发表于 2013-1-7 17:10
呜呜  悲剧了  我感觉我的论文直接被颠覆了。。。得重新找找思路了。。。。。。。我本来是想通过分析股票 ...
未必吧,
数据期间调整一下,试试

使用道具

57
urmine5683 发表于 2013-1-7 20:04:44 |只看作者 |坛友微信交流群
epoh 发表于 2012-2-17 10:17
这个很简单
只要加入hmatrices=hh
就可以算出rho12 = hh(t)(1,2)/sqrt(hh(t)(1,1)*hh(t)(2,2))
open data dcc_rets.xls
data(format=xls,org=columns) 1 2469 sp100 ftse
garch(p=1,q=1,mv=dcc,nomean,hmatrices=hh) / sp100 ftse
*
* Compute the correlations from the multivariate GARCH
*
set rho12 = hh(t)(1,2)/sqrt(hh(t)(1,1)*hh(t)(2,2))

graph(header="Dynamic Correlation of SP100 with FTSE")
# rho12


想做三维的图 怎么个程序涅~
另外之前用dynamic toolbox 2.0做出来的
CopParams =

    0.0472
    0.8774


是DCC的估计参数么?   怎么解释呢?

使用道具

58
zhangtao 发表于 2013-1-11 12:42:51 |只看作者 |坛友微信交流群
epoh 发表于 2013-1-7 18:13
未必吧,
数据期间调整一下,试试
load datafiles
[residuals, UnResiduals,GARCHspec,likelihoods]=filtReturnsGARCH(returns,'Gaussian','GJR', 'CML');

CopulaSpec=setCopulaLLinputs(4)

[CopParams, LogL, StrOutput]=fitCopula(UnResiduals, CopulaSpec)


  Mean: ARMAX(1,0,0); Variance: GJR(1,1)

  Conditional Probability Distribution: Gaussian
  Number of Model Parameters Estimated: 6

                               Standard          T     
  Parameter       Value          Error       Statistic
-----------   -----------   ------------   -----------
           C    0.00032691     0.00012645       2.5853
       AR(1)    0.00011623     0.023288         0.0050
           K    2e-007         8.9269e-008      2.2404
    GARCH(1)    0.95709        0.0063706      150.2350
     ARCH(1)    0.04371        0.0070437        6.2055
Leverage(1)    -0.010519      0.0083157       -1.2649

  Mean: ARMAX(1,0,0); Variance: GJR(1,1)

  Conditional Probability Distribution: Gaussian
  Number of Model Parameters Estimated: 6

                               Standard          T     
  Parameter       Value          Error       Statistic
-----------   -----------   ------------   -----------
           C    6.4987e-006    0.00012386       0.0525
       AR(1)    0.078174       0.022644         3.4523
           K    4.3357e-007    8.75e-008        4.9551
    GARCH(1)    0.93435        0.0066454      140.6011
     ARCH(1)    0.078691       0.0064494       12.2011
Leverage(1)    -0.04913       0.0102          -4.8168

  Mean: ARMAX(1,0,0); Variance: GJR(1,1)

  Conditional Probability Distribution: Gaussian
  Number of Model Parameters Estimated: 6

                               Standard          T     
  Parameter       Value          Error       Statistic
-----------   -----------   ------------   -----------
           C    0.00011945     8.2982e-005      1.4395
       AR(1)    0.079255       0.022893         3.4620
           K    2e-007         5.311e-008       3.7658
    GARCH(1)    0.93251        0.0097879       95.2716
     ARCH(1)    0.075452       0.012664         5.9582
Leverage(1)    -0.038818      0.015888        -2.4433

  Mean: ARMAX(1,0,0); Variance: GJR(1,1)

  Conditional Probability Distribution: Gaussian
  Number of Model Parameters Estimated: 6

                               Standard          T     
  Parameter       Value          Error       Statistic
-----------   -----------   ------------   -----------
           C    0.00013405     0.00012809       1.0465
       AR(1)    0.030703       0.022947         1.3380
           K    4.3749e-007    1.1285e-007      3.8767
    GARCH(1)    0.93139        0.0088657      105.0558
     ARCH(1)    0.027735       0.01247          2.2242
Leverage(1)    0.058318       0.014359         4.0614
for this specification, the SDPT3 solver is used

CopulaSpec =

             ll: 'copula'
           type: 'Gaussian'
        depspec: 'static'
      optimizer: 'SDPT3'
    derivatives: 'on'

??? Error using ==> optimset
Unrecognized parameter name 'Algorithm'.

Error in ==> fitCopula at 29
options = optimset('Algorithm','active-set','Display','iter','MaxFunEvals',10000,'TolCon',10^-12,'TolFun',10^-4,'TolX',10^-6);

>>
epoh老师,您好!
以上错误 是什么原因?如何解决?
非常感谢!
数学好就是要天天学

使用道具

59
epoh 发表于 2013-1-11 15:18:47 |只看作者 |坛友微信交流群
zhangtao 发表于 2013-1-11 12:42
load datafiles
[residuals, UnResiduals,GARCHspec,likelihoods]=filtReturnsGARCH(returns,'Gaussian ...
请你选 t
选 static
选 fmincon
CopulaSpec =

             ll: 'copula'
           type: 't'
        depspec: 'static'
      optimizer: 'fmincon'
    derivatives: 'on'

the parameter is scalar, the degree of freedom.

                                Max     Line search  Directional  First-order
Iter F-count        f(x)   constraint   steplength   derivative   optimality Procedure
    0      2     -602.319       -20.08                                         
    1      4     -604.103       -18.76            1        -1.84          1.4   
    2      7     -619.767       -9.381          0.5        -30.5         9.63  Hessian modified twice  
    3     11     -622.519       -7.035         0.25        -3.97         10.1  Hessian modified twice  
    4     14     -622.601       -6.622          0.5        0.038        0.046   
    5     16     -622.602       -6.663            1     0.000226      0.00557   
    6     18     -622.602       -6.658            1   -5.66e-007     0.000129   
Optimization terminated: magnitude of directional derivative in search
direction less than 2*options.TolFun and maximum constraint violation
  is less than options.TolCon.
No active inequalities.
succesfull optimization!

CopParams =

    8.6684


LogL =

  622.6021


StrOutput =

          Hessian: 1.2745
         Gradient: 1.2938e-004
         exitflag: 5
    timeinseconds: 76.9110
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
zhangtao + 5 + 5 + 5 好的意见建议

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

使用道具

60
Pia 发表于 2013-1-13 06:27:56 |只看作者 |坛友微信交流群
epoh 发表于 2013-1-11 15:18
请你选 t
选 static
选 fmincon
epoh老师,你好,我想在正在做的是关于流动性风险的传染问题,想找出s&p500,3M abcp和3M Treasury billde spread,libor-ois spread还有cds之间的动态相关性,初学dcc-garch,用r写了个程序,但是出来的结果总是有问题,麻烦老师帮我看看这个能否实现,如何实现? code.txt (683 Bytes)
data0.xlsx (32.86 KB) 数据和code上传了,麻烦老师了


使用道具

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

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

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

GMT+8, 2024-4-26 13:11