GARCH-M with interaction term

For econometric discussions not necessarily related to EViews.

Moderators: EViews Gareth, EViews Moderator

rs2013
Posts: 5
Joined: Sun Aug 04, 2013 2:34 am

GARCH-M with interaction term

Postby rs2013 » Sun Aug 18, 2013 9:34 pm

Hi,

I'm trying to write a program for a GARCH-M with an additional interaction term (Y(-1)*GARCH).

I'm having 2 problems - my first is that I'm getting missing values in @LOGL series and my second is, I'm not sure if I wrote the program right. Could I get some help with this?

I've attached my code:

Code: Select all

load eviewsoutput sample s0 @first @first+2 sample s1 @first+3 @last smpl s1 ' declare coef vectors to use in ARCH likelihood coef(3) beta = 0 coef(3) alpha = 0 coef(1) mu = 0 ' get starting values equation eq1.arch(1,1, archm=VAR) y c y(-1) beta(1) = eq1.c(1) beta(2) = eq1.c(2) beta(3) = eq1.c(3) alpha(1) = eq1.c(4) alpha(2) = eq1.c(5) alpha(3) = eq1.c(6) mu(1) = eq1.@se^2 ' set presample values of expressions in logl smpl s0 series sig2 = mu(1) series resma = resid ' set up GARCH likelihood logl ll1 ll1.append @logl logl ll1.append res = y - beta(2) - beta(1)*sig2 - beta(3)*sig2*y(-1) ll1.append resma = res ll1.append sig2 = alpha(1)+ alpha(2)*resma(-1)^2 + alpha(3)*sig2(-1) ll1.append z = resma/@sqrt(sig2) ll1.append logl = log(@dnorm(z)) - log(sig2)/2 ' estimate and display results smpl s1 ll1.ml(showopts, m=1000, c=1e-5) show ll1.output
Attachments
eviewsoutput.wf1
Data
(34.53 KiB) Downloaded 233 times

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: GARCH-M with interaction term

Postby trubador » Mon Aug 19, 2013 12:25 am

The code seems to be doing what you are asking it to do. Other than that, you need to clean your syntax a little bit and experiment for different starting values:

Code: Select all

load eviewsoutput sample s0 @first @first+2 sample s1 @first+3 @last 'smpl s1 smpl @all ' declare coef vectors to use in ARCH likelihood coef(3) beta = 0 coef(3) alpha = 0 coef(1) mu = 0 ' get starting values equation eq1.arch(1,1, archm=VAR) y c y(-1) beta(1) = eq1.c(1) beta(2) = eq1.c(2) beta(3) = eq1.c(3) alpha(1) = eq1.c(4) alpha(2) = eq1.c(5) alpha(3) = eq1.c(6) mu(1) = eq1.@se^2 ' set presample values of expressions in logl 'smpl s0 series sig2 = mu(1) 'series resma = resid series res = resid ' set up GARCH likelihood logl ll1 ll1.append @logl logl ll1.append res = y - beta(2) - beta(1)*sig2 - beta(3)*sig2*y(-1) 'll1.append resma = res 'll1.append sig2 = alpha(1)+ alpha(2)*resma(-1)^2 + alpha(3)*sig2(-1) ll1.append sig2 = alpha(1)+ alpha(2)*res(-1)^2 + alpha(3)*sig2(-1) 'll1.append z = resma/@sqrt(sig2) ll1.append z = res/@sqrt(sig2) ll1.append logl = log(@dnorm(z)) - log(sig2)/2 ' estimate and display results smpl s1 ll1.ml(showopts, m=1000, c=1e-5) show ll1.output

rs2013
Posts: 5
Joined: Sun Aug 04, 2013 2:34 am

Re: GARCH-M with interaction term

Postby rs2013 » Mon Aug 19, 2013 2:42 am

Thanks for the reply Trubador - I know the result can be biased based on what the starting value is as it will find the local minimum/maximum (from my knowledge).

That's why I tried to give it starting values based on the GARCH-M without the interaction to generate the closest starting values. Could you suggest a more appropriate way to obtain the starting values? Or do you recommend just experimenting by picking an arbitrary number, e.g. 0, 0.1 etc

Thanks.

rs2013
Posts: 5
Joined: Sun Aug 04, 2013 2:34 am

Re: GARCH-M with interaction term

Postby rs2013 » Mon Aug 19, 2013 9:23 pm

@Trubador - I've tried various arbitrary numbers and it still isn't working. I'm trying to replicate a paper at the moment and I put the starting values very close to the answer and I'm still coming up with the same error message.

I'm not sure how to proceed.

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: GARCH-M with interaction term

Postby trubador » Tue Aug 20, 2013 1:33 am

Paper replication is not an easy task, especially when you are dealing with such complex models. You need to work on the exact same data (and the sample period) as the authors did. There may also be some data massaging or initialization tricks, which authors did not mention explicitly. As for EViews, you can do several other things to improve your estimation:

Code: Select all

... equation eq1.arch(1,1, archm=VAR,backcast=1) y c eq1.makegarch garchm equation eq1.arch(1,1, archm=VAR,backcast=1) y c garchm*y(-1) ...
Also multiplying y by 100 might be of help to avoid scale problems...

rs2013
Posts: 5
Joined: Sun Aug 04, 2013 2:34 am

Re: GARCH-M with interaction term

Postby rs2013 » Wed Aug 21, 2013 3:35 am

Trubador - I'm still getting the same problem. I've hit a brick wall with this, I'm not sure how to get it working. Is there anything else you suggest I could do?

I have replaced my initial values equation as suggested and multiplied my Y series by 100. Multiplying the Y series by 100 gives me a much better starting coefficient (thanks for the tip).

I'm aware that it's mostly impossible to replicate papers, but I was using it as an indication of whether or not my model is on the right track before I start applying it to other things.

Thanks for helping me, it is greatly appreciated!

Code: Select all

load V:\DOCUMENTS\eviewsoutput.wf1 sample s0 @first @first+2 sample s1 @first+3 @last smpl s1 ' declare coef vectors to use in ARCH likelihood coef(3) beta = 0 coef(3) alpha = 0 coef(1) mu = 0 ' get starting values equation eq1.arch(1,1, archm=VAR,backcast=1) y c eq1.makegarch garchm equation eq1.arch(1,1, archm=VAR,backcast=1) y c garchm*y(-1) beta(1) = eq1.c(1) beta(2) = eq1.c(2) beta(3) = eq1.c(3) alpha(1) = eq1.c(4) alpha(2) = eq1.c(5) alpha(3) = eq1.c(6) mu(1) = eq1.@se^2 ' set presample values of expressions in logl smpl s0 series sig2 = mu(1) series resma = resid ' set up GARCH likelihood logl ll1 ll1.append @logl logl ll1.append res = y - beta(2) - beta(1)*sig2 - beta(3)*sig2*y(-1) ll1.append resma = res ll1.append sig2 = alpha(1)+ alpha(2)*resma(-1)^2 + alpha(3)*sig2(-1) ll1.append z = resma/@sqrt(sig2) ll1.append logl = log(@dnorm(z)) - log(sig2)/2 ' estimate and display results smpl s1 ll1.ml(showopts, m=1000, c=1e-5) show ll1.output
Attachments
eviewsoutput.wf1
Data with: series y=y*100
(34.57 KiB) Downloaded 230 times

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: GARCH-M with interaction term

Postby trubador » Thu Aug 22, 2013 1:11 am

You have not included all the modifications mentioned in the earlier posts. Anyway, the following version seems to be working on this data, but there is no guarantee that it will do fine on another.

Code: Select all

sample s0 @first @first+1 sample s1 @first+2 @last smpl @all ' declare coef vectors to use in ARCH likelihood coef(3) beta = 0 coef(3) alpha = 0 coef(1) mu = 0 ' get starting values equation eq1.arch(1,1, archm=VAR,backcast=1) y c eq1.makegarch garchm equation eq1.arch(1,1, archm=VAR,backcast=1) y c garchm*y(-1) beta(1) = eq1.c(1) beta(2) = eq1.c(2) beta(3) = eq1.c(3) alpha(1) = eq1.c(4) alpha(2) = eq1.c(5) alpha(3) = eq1.c(6) mu(1) = eq1.@se^2 ' set presample values of expressions in logl series sig2 = mu(1) series res = resid ' set up GARCH likelihood logl ll1 ll1.append @logl logl ll1.append @byeqn ll1.append res = y - beta(2) - beta(1)*sig2 - beta(3)*sig2*y(-1) ll1.append sig2 = alpha(1)+ alpha(2)*res(-1)^2 + alpha(3)*sig2(-1) ll1.append z = res/@sqrt(sig2) ll1.append logl = log(@dnorm(z)) - log(sig2)/2 ' estimate and display results smpl s1 ll1.ml(showopts, m=1000, c=1e-5) show ll1.output

rs2013
Posts: 5
Joined: Sun Aug 04, 2013 2:34 am

Re: GARCH-M with interaction term

Postby rs2013 » Thu Aug 22, 2013 2:05 am

Thanks Trubador!! You've been extremely helpful and thank you for being so patient!


Return to “Econometric Discussions”

Who is online

Users browsing this forum: No registered users and 0 guests