Hafner Herwartz 2006

Use this forum for posting example programs or short bits of sample code.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Hafner Herwartz 2006

Unread post by TomDoan »

Jules89 wrote:Dear Tom,

I have two questions regarding MCMC estimation of the BEKK model:

1)

I went through the MCMC code for the DCC-GARCH. Wouldn't it be possible to estimate a BEKK model with the similar procedure? I start with the ML estimates, then I generate candidate draws with the t-distribution and evaluate it using:

Code: Select all

compute btest=blast+%ranmvt(fxx,nuxx)
garch(p=1,q=1,mv=bekk,initial=btest,method=eval,$
rvectors=rv,hmatrices=htest) / xjpn xfra xsui
compute logptest=%logl
The rest should be the same.
Correct. You might need to experiment with the scale on FXX and the degrees of freedom, but the process is the same.
Jules89 wrote: 2)
Above would be Random Walk MH, why do you think that independence MH is better suited?
If an independence chain works, it's generally superior to random walk---if the asymptotic distribution is fairly accurate (which is likely if you have enough data), independent draws use that while the RW draws ignore it.
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: Hafner Herwartz 2006

Unread post by Jules89 »

Dear Tom,
i have another question regarding the implementation of independence chain MH for the MV GARCH. I wanted to use codeparts of the ARMAGIBBS.RPF, as it is also doing IC-MH.
Given that the draws are done with

Code: Select all

compute btest=blast+%ranmvt(fxx,nuxx)  (adjusted for the example above)
it looks to me like a RW-MH draw. The only difference is that the acceptance probability is calculated as

Code: Select all

compute alpha=%if(%valid(logptest),exp(logptest-logplast-logqtest+logqlast),0.0)
instead of

Code: Select all

   compute alpha=%if(%valid(logptest),exp(logptest-logplast),0.0)
Shouldn't for IC-MH the draw be somethin like

Code: Select all

compute btest=%ranmvt(fxx,nuxx)  (adjusted for the example above)
thank you

Best

Julius
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Hafner Herwartz 2006

Unread post by TomDoan »

You're missing the mean in the IC proposal density (generally the point estimates from maximum likelihood).
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: Hafner Herwartz 2006

Unread post by Jules89 »

You are right... I totally oversaw that for the draw the "blast" is fixed at the ml estimates.... The "blast " shifts the draw from %ranmvt towards a mean which corresponds to the ml estimates. Otherwise it would be always a zero mean draw, right?

Best

Jules
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Hafner Herwartz 2006

Unread post by TomDoan »

Jules89 wrote:You are right... I totally oversaw that for the draw the "blast" is fixed at the ml estimates.... The "blast " shifts the draw from %ranmvt towards a mean which corresponds to the ml estimates. Otherwise it would be always a zero mean draw, right?

Best

Jules
Correct.
ege_man
Posts: 85
Joined: Sat Jul 07, 2012 2:39 pm

Re: Hafner Herwartz 2006

Unread post by ege_man »

Dear Tom,
I have an idea to investigate the impact of COVID-19 on the variables such as exchange rates, stock returns and interest rates available at five-working day frequency. Does it make sense to use VIRFs for this research? Do you have any suggestion?
Best
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Hafner Herwartz 2006

Unread post by TomDoan »

I don't see how that would work. Wouldn't covid have to be exogenous to the other variables? The VIRF's are for a set of variables that are jointly modeled using a GARCH model.
ege_man
Posts: 85
Joined: Sat Jul 07, 2012 2:39 pm

Re: Hafner Herwartz 2006

Unread post by ege_man »

I know it is exogenous but can we treat covid similar to financial crisis which is also exogenous if we do not explicitly introduce any proxy variable?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Hafner Herwartz 2006

Unread post by TomDoan »

If you're talking about using it to date the time of a shock, you could, except there is not going to be a single obvious shock date.
ege_man
Posts: 85
Joined: Sat Jul 07, 2012 2:39 pm

Re: Hafner Herwartz 2006

Unread post by ege_man »

Yes you are right. I would like to compute set of responses for important dates, i.e. first case, highest number of cases. Does it make sense?
Regards
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Hafner Herwartz 2006

Unread post by TomDoan »

I'm not sure what question you think that's answering. The VIRF is to give an example of the out-of-sample behavior of the variance model in question (a BEKK in the case of HH). HH choose the particular incidents because they are locations where the variances are actually "shocked"---that is, the residuals are larger than the BEKK model predicts. They're not saying "this is what happens if xxx".
apogio
Posts: 3
Joined: Thu Nov 12, 2020 2:51 am

Re: Hafner Herwartz 2006

Unread post by apogio »

Dear Tom,

I'm estimating a M BEKK-GARCH-X model including 2 shift dummies for stock indices series. Can I use HH to calculate the VIRFs for 2 shocks in time?

garch(model=basevecm,mv=bekk, stdresids=stdu,factorby=eigen, hmatrices=hh,rvectors=rr, $
pmethod=simplex,piters=10,method=bfgs,iters=2000,vechmat=vechcomps,robust,distrib=t,xreg)
# dto381 dto631
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Hafner Herwartz 2006

Unread post by TomDoan »

Yes. The variance shift dummies have no effect on the calculations of the VIRF's.


Last bumped by TomDoan on Sat Mar 01, 2025 4:36 am.
Post Reply