楼主: chc13667134110
1239 0

[问答] 请问有人知道我标出来每一条代码是什么意思吗?RATS,garch jump.有偿 [推广有奖]

  • 0关注
  • 0粉丝

已卖:9份资源

小学生

92%

还不是VIP/贵宾

-

威望
0
论坛币
128 个
通用积分
0.1800
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
76 点
帖子
4
精华
0
在线时间
13 小时
注册时间
2020-7-8
最后登录
2021-3-17

楼主
chc13667134110 发表于 2020-9-7 17:55:31 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
这是RATS有关于GARCH JUMP的代码
garch(p=1,q=1,reg,resids=u,hseries=h) end1950+1 end1969 r
# constant r{1 2}
compute ssvar=%beta(%nregmean+1)/(1-%beta(%nregmean+2)-%beta(%nregmean+3))
set u * %regstart()-1 = 0.0
set h * %regstart()-1 = ssvar
compute mu=%beta(1),a1=%beta(2),a2=%beta(3)
compute omega=%beta(%nregmean+1),alpha=%beta(%nregmean+2),beta=%beta(%nregmean+3)

compute theta=0.0,delta=sqrt(10.0*ssvar),lambda=.1
nonlin(parmset=pegomega) omega=0.0
maximize(parmset=meanparms+garchparms+jumpparms+poissonparms+pegomega,$
pmethod=simplex,piters=2,method=bfgs,$
title="Constant Intensity Jump GARCH, 1951-1969") logl end1950+1 end1969
set ustdsq = (u-lambda*theta)^2/(h+lambda*(theta^2+delta^2))
@westchotest(title="Q Test on Standardized Squared Residuals",number=15) ustdsq %regstart() %regend()
@westchotest(title="Q Test on Jump Intensity Residuals",number=15) xi %regstart() %regend()

*

另一个
compute kmax=20
*****************************************************************************************
*
* jumpGARCH(u,h,lambda,deltasq,theta) returns the log likelihood for an
* observation for a jump-GARCH model given:
*
*  u       = current residual
*  h       = base GARCH variance (before jumps)
*  lambda  = Poisson intensity for jumps
*  deltasq = variance of Normal jump process
*  theta   = mean of Normal jump process
*
function jumpgarch u h lambda deltasq theta
type real jumpgarch u h lambda deltasq theta
*
local   integer k
local   real    jsd wt jp
*
compute wt=0.0
compute jumpgarch=0.0
do k=0,kmax
   compute jsd=sqrt(h+k*deltasq)
   compute jp =exp(k*log(lambda)-%lngamma(k+1))
   compute wt =wt+jp
   compute jumpgarch=jumpgarch+jp*%density((u-k*theta)/jsd)/jsd
end do k
compute jumpgarch=log(jumpgarch/wt)

end jumpgarch
*****************************************************************************************
*
* ARJIgarch(u,h,lambda,deltasq,theta,xi) returns the log likelihood for
* an observation for a jump-GARCH model given:
*
*  u       = current residual
*  h       = base GARCH variance (before jumps)
*  lambda  = Poisson intensity for jumps
*  deltasq = variance of Normal jump process
*  theta   = mean of Normal jump process
*
* It also returns in xi the innovation in the number of jumps
* (difference between the expected value given the data and the mean),
* which can be used for computing the ARJI intensity.
*
function ARJIgarch u h lambda deltasq theta xi
type real ARJIgarch u h lambda deltasq theta *xi
*
local integer k
local real jsd wt ewt jp fr xit
*
compute wt =0.0
compute ewt=0.0
compute xit=0.0
compute ARJIgarch=0.0
do k=0,kmax
   compute jsd=sqrt(h+k*deltasq)
   compute jp =exp(k*log(lambda)-%lngamma(k+1))
   compute fr =%density((u-k*theta)/jsd)/jsd
   compute wt =wt+jp
   compute ewt=ewt+jp*fr
   compute xit=xit+k*jp*fr
   compute ARJIgarch=ARJIgarch+jp*fr

end do k
compute xi=xit/ewt-lambda
compute ARJIgarch=log(ARJIgarch/wt)
end ARJIgarch

二维码

扫码加我 拉你入群

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

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

关键词:是什么意思 GARCH Rats Jump ARCH RATS garch jump

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-6 06:57