how to do a minimum calculation

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

asummer
Posts: 4
Joined: Wed May 01, 2013 2:34 pm

how to do a minimum calculation

Postby asummer » Wed May 01, 2013 2:46 pm

Hi,

I have a logl function for an asymmetric garch estimation. One of the variables is like this

y = ......+ x * min(p,0) + .......


How do i enter this min(p,0) in the logl function? Tried using x*(@min(p,0)) but that i guess is wrong

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: how to do a minimum calculation

Postby EViews Gareth » Wed May 01, 2013 2:59 pm

What is p?

asummer
Posts: 4
Joined: Wed May 01, 2013 2:34 pm

Re: how to do a minimum calculation

Postby asummer » Wed May 01, 2013 3:03 pm

p is the lag value of the residual from the mean equation calculated as

mgarch.append res1= (y1-cons(1) - mu(1)*y1(-1) - mu(2)*y2(-1) - mu(3)*y3(-1))

Which then feeds into a volatility equation as

var_y1=......+rho(1)*(min(res1,0)^2)

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: how to do a minimum calculation

Postby EViews Gareth » Wed May 01, 2013 3:27 pm

I meant, what type of object is it? For that matter, what are X and Y?

asummer
Posts: 4
Joined: Wed May 01, 2013 2:34 pm

Re: how to do a minimum calculation

Postby asummer » Wed May 01, 2013 5:43 pm

Sorry if I am unable to clearly say but Y and X are both time series. X is the residual error and Y is the calculated variance. this is a bivariate mgarch model and I started by using the TV_garch.prg and modified the logl function.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: how to do a minimum calculation

Postby EViews Gareth » Wed May 01, 2013 6:01 pm

I'm going to assume they're series objects.

You can use the @recode function.

asummer
Posts: 4
Joined: Wed May 01, 2013 2:34 pm

Re: how to do a minimum calculation

Postby asummer » Wed May 01, 2013 7:01 pm

Thank you


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests