Page 1 of 1

heterogeneous autoregressive model(HAR)

Posted: Thu Mar 10, 2016 8:35 pm
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!

Re: heterogeneous autoregressive model(HAR)

Posted: Thu Mar 10, 2016 9:02 pm
by TomDoan
Could you post a readable version of the formula? You can attach a PDF or a PNG.

Re: heterogeneous autoregressive model(HAR)

Posted: Thu Mar 10, 2016 9:21 pm
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

Re: heterogeneous autoregressive model(HAR)

Posted: Thu Mar 10, 2016 10:42 pm
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.

Re: heterogeneous autoregressive model(HAR)

Posted: Thu Mar 10, 2016 11:13 pm
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)

Re: heterogeneous autoregressive model(HAR)

Posted: Fri Mar 11, 2016 8:13 am
by TomDoan
So your equations (which look univariate) are actually supposed to be vector processes?

Re: heterogeneous autoregressive model(HAR)

Posted: Fri Mar 11, 2016 9:47 am
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.

Re: heterogeneous autoregressive model(HAR)

Posted: Fri Mar 11, 2016 9:50 am
by Michelle
Is it possible to regard the data as panel data and use the command "pregress" to estimate it?

Re: heterogeneous autoregressive model(HAR)

Posted: Fri Mar 11, 2016 10:14 am
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.

Re: heterogeneous autoregressive model(HAR)

Posted: Sun Mar 13, 2016 4:16 am
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

Re: heterogeneous autoregressive model(HAR)

Posted: Mon Mar 14, 2016 9:10 am
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.

Re: heterogeneous autoregressive model(HAR)

Posted: Wed Mar 16, 2016 2:59 am
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)

Re: heterogeneous autoregressive model(HAR)

Posted: Wed Mar 16, 2016 8:12 am
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