heterogeneous autoregressive model(HAR)

Questions and discussions on Vector Autoregressions
Michelle
Posts: 13
Joined: Sun Oct 25, 2015 10:03 pm

heterogeneous autoregressive model(HAR)

Unread post by Michelle »

Dear Sir,

I am trying to estimate a multivariate heterogeneous autoregressive model,that is
Yt0+∑_(h={1,5,22})▒〖βhYh,t-1〗+εt,whereYh,t=1/h ∑_(i=0)^(h-1)▒〖Yt-i
My question is I don't know how to do it with RATS. It seems that it can not use the code "system".
Please let me know how to do it. Thank you very much!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by TomDoan »

Could you post a readable version of the formula? You can attach a PDF or a PNG.
Michelle
Posts: 13
Joined: Sun Oct 25, 2015 10:03 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by Michelle »

Dear Tom,

Thanks for your reply.
Sorry to comfuse you. The model I would like to do is like the attached PNG.

Best regards
Attachments
2.png
2.png (4.32 KiB) Viewed 13471 times
1.png
1.png (5.69 KiB) Viewed 13471 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by TomDoan »

Isn't the YH series just data? You can compute that using FILTER with TYPE=LAGGING and WIDTH=H, then use the resulting series at lags 1, 5 and 22.
Michelle
Posts: 13
Joined: Sun Oct 25, 2015 10:03 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by Michelle »

Dear Tom,

Thanks for your reply.
Actually I would like to use the heterogeneous autoregressive model(HAR) to compute Diebold Spillover Index. As for Diebold model, he use VAR as the base model and can use the following code for estimation. My question is how to rewrite it so that I can estimate the HAR model.

Best Regards

Code: Select all

system(model=volvar)
variables vols
lags 1 2 3 4
det constant
end(system)
*
estimate(noprint)
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by TomDoan »

So your equations (which look univariate) are actually supposed to be vector processes?
Michelle
Posts: 13
Joined: Sun Oct 25, 2015 10:03 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by Michelle »

yes.The model I would like to estimate is a multivariate version of heterogeneous autoregressive model and use it to calculate the Diebold spillover index.
Michelle
Posts: 13
Joined: Sun Oct 25, 2015 10:03 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by Michelle »

Is it possible to regard the data as panel data and use the command "pregress" to estimate it?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by TomDoan »

That is definitely not how you would do that. There's nothing about that model that uses any panel data techniques. As you describe that, it seems like a job best handled by ENCODE and UNRAVEL since they're heavily constrained autoregressions.

However, I'm puzzled about what is "heterogeneous" about that model.
Michelle
Posts: 13
Joined: Sun Oct 25, 2015 10:03 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by Michelle »

Dear Tom,

Thanks for your reply. I have tried the command "ENCODE" and it seems that this command along with "LINREG" can perfectly handle univariate version of heterogeneous autoregressive model. I tried but failed to extend it to multivariate case.As my final purpose is to calculate the Diebold Spillover Index,this estimation becomes the basic of my idea. Could you please give me some clues about it.

The heterogeneous autoregressive model was first proposed by Corsi, F. (2009) in his paper"A simple approximate long memory model of realized volatility" in Journal of Financial Econometrics 7, 174-196. As Corsi points out, the HAR model can consider different regression components get over different time horizons and thus termed heterogeneous autoregressive model.

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

Re: heterogeneous autoregressive model(HAR)

Unread post by TomDoan »

You need a separate ENCODE instruction (using the NOCLEAR option) for each variable and each horizon, so you would end up with 12 constructed variables.
Michelle
Posts: 13
Joined: Sun Oct 25, 2015 10:03 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by Michelle »

Dear Tom,

Thanks for your reply.

Could you please help me check whether the following code is right for doing the estimation of HAR model. It seems RATS will round 1/5 or 1/22 to 0, so I use 0.2 and 0.04545 instead of 1/5 and 1/22 in the code.

Code: Select all

clear(all)
open data rv.xls
data(format=xls,org=columns,top=1,left=1) 1 1327 srv	frv

set rvu = srv
set rv = frv

declare rect a
dim a(1,5)
compute %do(j,1,%cols(a),a(1,j)=0.2)

declare rect b
dim b(1,22)
compute %do(j,1,%cols(b),b(1,j)=0.04545)

encode(results=rvu_5,noclear) a
# rvu{0 to 4}

encode(results=rv_5,noclear) a
# rv{0 to 4}

encode(results=rvu_22,noclear) b
# rvu{0 to 21}

encode(results=rv_22,noclear) b
# rv{0 to 21}

equation eq_1 rvu
# constant rvu{1} rvu_5{1} rvu_22{1}
equation eq_2 rv
# constant rv{1} rv_5{1} rv_22{1}
 group eq eq_1 eq_2
 sur(model=eq)
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: heterogeneous autoregressive model(HAR)

Unread post by TomDoan »

Yes. 1/22 isn't the same as 1.0/22.

If it's a VAR, wouldn't you need to include all the cross terms as well? This looks like it will do what you describe:

linreg(define=eq_1,unravel) rvu
# constant rvu{1} rvu_5{1} rvu_22{1} rv{1} rv_5{1} rv_22{1}
linreg(define=eq_2,unravel) rv
# constant rvu{1} rvu_5{1} rvu_22{1} rv{1} rv_5{1} rv_22{1}

group mymodel eq_1 eq_2
Post Reply