| 所在主题: | |
| 文件名: g10xrate.xls | |
| 资料下载链接地址: https://bbs.pinggu.org/a-1533085.html | |
| 附件大小: | |
|
各位大俠们:
小弟论文须要在CCC GARCH(1,1)的variance equations分別加入不同的外生変量, 我用RATS的GARCHMVMAX CCC GARCH编程來修改如下: 紅色字是我修改的部分 * * GARCHMVMAX.RPF * RATS Version 8, User's Guide, Example from Section 9.9 * open data g10xrate.xls data(format=xls,org=columns) 1 6237 usxjpn usxfra usxsui * set xjpn = 100.0*log(usxjpn/usxjpn{1}) set xfra = 100.0*log(usxfra/usxfra{1}) set xsui = 100.0*log(usxsui/usxsui{1}) * * Estimation using MAXIMIZE * The initial few lines of this set the estimation range, which needs to * be done explicitly, and the number of variables. Then, vectors for the * dependent variables, residuals and residuals formulas are set up. The * SET instructions copy the dependent variables over into the slots in * the vector of series. * compute gstart=2,gend=6237 compute n=3 dec vect[series] y(n) ex(n) u(n) dec vect[frml] resid(n) set y(1) = xjpn set y(2) = xfra set y(3) = xsui set ex(1) = xjpn/xfra set ex(2) = xfra/xsui set ex(3) = xsui/xjpn * This is specific to a mean-only model. It sets up the formulas (the &i * are needed in the formula definitions when the FRML is defined in a * loop), and estimates them using NLSYSTEM. This both initializes the * mean parameters, and computes the unconditional covariance matrix. If * you want more general mean equations, the simplest way to do that * would be to define each FRML separately. * dec vect b(n) nonlin(parmset=meanparms) b do i=1,n frml resid(i) = (y(&i)-b(&i)) end do i nlsystem(parmset=meanparms,resids=u) gstart gend resid compute rr=%sigma * * The paths of the covariance matrices and uu' are saved in the * SERIES[SYMM] names H and UU. UX and HX are used to pull in residuals * and H matrices. * declare series[symm] h uu exog * * ux is used when extracting a u vector * declare symm hx(n,n) declare vect ux(n) exo(n) * * These are used to initialize pre-sample variances. * gset h* gend = rr gset uu * gend = rr * * This is a standard (normal) log likelihood formula for any * multivariate GARCH model. The difference among these will be in the * definitions of HF and RESID. The function %XT pulls information out of * a matrix of SERIES. * declare frml[symm] hf * frml logl = $ hx = hf(t) , $ %do(i,1,n,u(i)=resid(i)) , $ ux = %xt(u,t), $ h(t)=hx, uu(t)=%outerxx(ux), $ exo =%xt(ex,t), $ exog(t)=%outerxx(exo),$ %logdensity(hx,ux) ***************************************************** ***************************************************** * * CC * The correlations are parameterized using an (n-1)x(n-1) matrix for the * subdiagonal. The (i,j) element of this will actually be the * correlation between i+1 and j. * dec symm qc(n-1,n-1) dec vect vcv(n) vbv(n) vav(n) rv(n) * function hfcccgarch time type symm hfcccgarch type integer time do i=1,n compute hx(i,i)=vcv(i)+vav(i)*h(time-1)(i,i)+vbv(i)*uu(time-1)(i,i)+rv(i)*exog(time-1)(i,i) do j=1,i-1 compute hx(i,j)=qc(i-1,j)*sqrt(hx(j,j)*hx(i,i)) end do j end do i compute hfcccgarch=hx end * frml hf = hfcccgarch(t) nonlin(parmset=garchparms) vcv vbv vav rv qc compute vcv=%xdiag(rr),vbv=%const(0.80),vav=%const(0.05),rv=%const(0.20),qc=%const(0.0) maximize(parmset=meanparms+garchparms,pmethod=simplex,piters=10) logl gstart gend 它一直出現错誤 ## MAT15. Subscripts Too Large or Non-Positive The Error Occurred At Location 46, Line 5 of HFCCCGARCH 請教各位大俠到底是哪裡出错了? 感謝萬分 |
|
熟悉论坛请点击新手指南
|
|
| 下载说明 | |
|
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。 2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。 3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。 (如有侵权,欢迎举报) |
|
京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明