Chan & Maheu, JBES 2002 (Jump GARCH model)

Use this forum for posting example programs or short bits of sample code.

Chan & Maheu, JBES 2002 (Jump GARCH model)

Postby TomDoan » Fri Aug 10, 2012 10:17 am

These are replication files for Chan and Maheu(2002), "Conditional Jump Dynamics in Stock Market Returns", Journal of Business and Economic Statistics, vol 20, no. 3, 377-389. This estimates GARCH models with added Poisson jump processes with either fixed or "ARJI" Poisson probabilities. The ARJI-GARCH model was introduced in this paper to allow the jump probabilities to be time-varying using an ARMA-like model. The JUMPGARCH.SRC file includes functions which evaluate the log likelihood for a single time period given the GARCH variance, the Poisson mean of the jump process and the mean and variance of the jumps. The calculation done here is slightly different from the one described in the paper—it computes the probabilities of the Poisson conditional on an upper bound on the number of jumps, while the calculations done in the paper use the standard Poisson integrating constant for the sums to infinity. The conditional calculation is more stable numerically.

jumpgarch.rpf
Program with fixed Poisson probablities
(6.11 KiB) Downloaded 563 times

arjigarch.rpf
Program with ARJI Poisson probabilities
(7.41 KiB) Downloaded 510 times

jumpgarch.src
Supporting procedure
(3.27 KiB) Downloaded 476 times

djia.txt
Data file
(1.28 MiB) Downloaded 862 times
TomDoan
 
Posts: 5976
Joined: Wed Nov 01, 2006 5:36 pm

Jump GARCH model

Postby alberta123 » Sun Nov 24, 2013 11:57 am

Hi Tom,

Can you modify the program of Chan and Maheu (2002 JBES) to Maheu and McCurdy (2004 Journal of Finance "News Arrival, Jump Dynamics, and Volatility Components for Individual Stock Returns" Vol. 59, pp.755-793.

Ray

Thanks.
alberta123
 
Posts: 2
Joined: Sun Nov 24, 2013 3:33 am

Re: Jump GARCH model

Postby TomDoan » Tue Nov 26, 2013 12:28 pm

The only new part of the calculation is that it requires the expected number of jumps given the data. In the calculation below, JP is the unconditional probability of K jumps (without the integrating constant), and %density((u-k*theta)/jsd)/jsd is the P[observed U|K jumps] so the sum of JP * %density(...) across K gives P[data]. The /wt is to allow for the fact that the truncation of the sum at KMAX means that the standard integrating constant (exp(-lambda)) on the Poisson isn't correct. The expected value of k given the data will be the sum of k x P(k|data) which will be the sum of k x P(data|k) x P(k) / P(data).

Code: Select all
function jumpgarchx u h lambda deltasq theta ek
type real jumpgarchx u h lambda deltasq theta *ek
*
local   integer k
local   real    jsd wt jp
*
compute wt=0.0
compute ek=0.0
compute jumpgarchx=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 jpu=jp*%density((u-k*theta)/jsd)/jsd
   compute jumpgarchx=jumpgarchx+jpu
   compute ek=ek+k*jpu
end do k
compute ek=ek*jumpgarchx
compute jumpgarchx=log(jumpgarchx/wt)
end jumpgarchx


You would have to save the value of EK into a series and use that in the coefficient on the lag squared residual.
TomDoan
 
Posts: 5976
Joined: Wed Nov 01, 2006 5:36 pm

Re: Chan & Maheu, JBES 2002 (Jump GARCH model)

Postby Michelle » Thu May 12, 2016 9:37 am

Dear Tom,

I would like to do some research using Chan&Maheu, JBES2002(Jump GARCH model) and I would like to do the out-of-sample analysis but don't know how to write the code. Could you please give me some advice.
Thanks a lot.
Michelle
 
Posts: 13
Joined: Sun Oct 25, 2015 10:03 pm

Re: Chan & Maheu, JBES 2002 (Jump GARCH model)

Postby TomDoan » Thu May 12, 2016 12:17 pm

In this calculation:

set ustdsq = (u-lambda*theta)^2/(h+lambda*(theta^2+delta^2))

the one-step forecast of the series is lambda*theta and the one step forecast of the variance is the h+lambda*(theta^2+delta^2).
TomDoan
 
Posts: 5976
Joined: Wed Nov 01, 2006 5:36 pm

Re: Chan & Maheu, JBES 2002 (Jump GARCH model)

Postby Michelle » Thu May 12, 2016 9:34 pm

Dear Tom,

Thanks for your reply. I was wondering if it is possible to use the command "forecast(model=ARJI,...)" to do the one-step-ahead forecast of the Jump GARCH model.
Michelle
 
Posts: 13
Joined: Sun Oct 25, 2015 10:03 pm

Re: Chan & Maheu, JBES 2002 (Jump GARCH model)

Postby TomDoan » Thu May 12, 2016 9:54 pm

No. It has a very specialized formula.
TomDoan
 
Posts: 5976
Joined: Wed Nov 01, 2006 5:36 pm

Re: Chan & Maheu, JBES 2002 (Jump GARCH model)

Postby bb_poimot » Thu Aug 10, 2017 8:43 am

Hi, Tom, I noticed that the differences between Chan and Maheau (2002) and Matheu&Mccurdy (2004, JF) also lie in the function g(.), the feedback coefficient from the past return innovations. In the 2004, JF paper, it allows the asymmetric effect from the past news(bad or good). Then how could we realize it in the coding? thanks.
bb_poimot
 
Posts: 4
Joined: Mon Aug 15, 2016 12:15 am

Re: Chan & Maheu, JBES 2002 (Jump GARCH model)

Postby TomDoan » Thu Aug 10, 2017 4:22 pm

There's an earlier post that shows how to compute the expected number of jumps:

viewtopic.php?p=7979#p7979

The change to the GARCH formula is relatively simple given that.
TomDoan
 
Posts: 5976
Joined: Wed Nov 01, 2006 5:36 pm

Re: Chan & Maheu, JBES 2002 (Jump GARCH model)

Postby bb_poimot » Wed Aug 30, 2017 9:37 am

TomDoan wrote:There's an earlier post that shows how to compute the expected number of jumps:

viewtopic.php?p=7979#p7979

The change to the GARCH formula is relatively simple given that.

Hi, Tom, thanks for your reply. I am new to RATs. I can change the GARCH function but I am still not quite clear about how to put the value obtained from one user-defined function into the whole estimation process (particularly the frml hf=omega+alpha*u{1}^2+beta*h{1})? Should I save the jumpgarchx into one separate src or just insert it into the arjigarch.rpf ?

Do you have some link or reference from which I can learn how to use the user-defined function value in frml? Great thanks in advance.
bb_poimot
 
Posts: 4
Joined: Mon Aug 15, 2016 12:15 am

Re: Chan & Maheu, JBES 2002 (Jump GARCH model)

Postby TomDoan » Wed Aug 30, 2017 10:23 am

The use of the source file is to simplify the use of that function, which is needed in both of those programs. If you're just doing a single program, you may not need to strip that out.

The trickiest part about using a function inside a FRML is that, in most cases, it somehow depends upon time "T" information. If possible, it's usually simplest to make the time T references in the FRML rather than the function. For instance, in this:

frml logl = u=uf,h=hf,lambda_t=lambda0,deltasq_t=zeta0^2,theta_t=eta0,$
arjigarch(u,h,lambda_t,deltasq_t,theta_t,xi_t)

all six arguments actually refer to something that depends upon the entry number (U is the current residual, H the current GARCH process variance, etc.) which is what everything on that first line is computing. As long as you're still in the FRML definition, U (if U is a series) means U(T), and same for the other. Thus ARJIGARCH and JUMPGARCH and JUMPGARCHX don't actually need to know what time period they're computing.
TomDoan
 
Posts: 5976
Joined: Wed Nov 01, 2006 5:36 pm

Re: Chan & Maheu, JBES 2002 (Jump GARCH model)

Postby bb_poimot » Fri Sep 08, 2017 4:01 am

TomDoan wrote:The use of the source file is to simplify the use of that function, which is needed in both of those programs. If you're just doing a single program, you may not need to strip that out.

The trickiest part about using a function inside a FRML is that, in most cases, it somehow depends upon time "T" information. If possible, it's usually simplest to make the time T references in the FRML rather than the function. For instance, in this:

frml logl = u=uf,h=hf,lambda_t=lambda0,deltasq_t=zeta0^2,theta_t=eta0,$
arjigarch(u,h,lambda_t,deltasq_t,theta_t,xi_t)

all six arguments actually refer to something that depends upon the entry number (U is the current residual, H the current GARCH process variance, etc.) which is what everything on that first line is computing. As long as you're still in the FRML definition, U (if U is a series) means U(T), and same for the other. Thus ARJIGARCH and JUMPGARCH and JUMPGARCHX don't actually need to know what time period they're computing.


Dear Tom, Greatly appreciate your kind reply. I have tried to change the code for both jumpgarchx.src and argigarch.rpf, in order to replicate the JF paper, shown as the attached. Could you please help me take a look whether the code is correct? Great thanks for your consistent help.
Attachments
mycode_sector_JF.RPF
(5.16 KiB) Downloaded 3 times
jumpgarchx.SRC
(1.35 KiB) Downloaded 3 times
bb_poimot
 
Posts: 4
Joined: Mon Aug 15, 2016 12:15 am


Return to Examples and Sample Code

Who is online

Users browsing this forum: Bing [Bot] and 1 guest