Problem with LogL

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

Anjuka
Posts: 5
Joined: Sun Mar 15, 2009 3:45 pm

Problem with LogL

Postby Anjuka » Sun Mar 15, 2009 4:14 pm

Hi!

I have a disequilibrium model for the loans market (Demand and Supply). Literature suggested to use ML. I have found a program called diseq1.prg in your sample programs which is almost the one I needed. Therefore, I have "copied" your method in solving this type of problem. I have estimated with LS method for the starting values, but the problem appears when I come to LogL. When I type:

@LOGL LOGL1
UD = LOGLOANS-ALPHA(1)-ALPHA(2)*LOGGDP-ALPHA(3)*GDPGAP-ALPHA(4)*INFLATION-ALPHA(5)*LRATELVL
US = LOGLOANS-BETA(1)-BETA(2)*LOGGDP-BETA(3)*LOGEQANDDEP-BETA(4)*DIFFRATES
LOGL1 = -LOG(2*3.14159265358979) -LOG(SIGMA(1)) -LOG(SIGMA(2)) - UD^2/SIGMA(1)^2/2 -US^2/SIGMA(2)^2/2

The following problem appears:
"5 is not a valid index for vector-series-coefficient ALPHA in UD=LOGLOANS-ALPHA(1)-ALPHA(2)*......."

The same goes for:
"4 is not a valid index for vector-series-coefficient ALPHA in US=LOGLOANS-BETA(1)-BETA(2)*......."


I would really appreciate if you can give me a piece of advice on that.
Thanks in advance!

Best regards,
Anna

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

Re: Problem with LogL

Postby EViews Gareth » Sun Mar 15, 2009 9:02 pm

You need to have defined a coefficient vector called Alpha (and Beta etc.. for that matter), of the correct size (5 for Alpha by the looks of it).
Follow us on Twitter @IHSEViews

Anjuka
Posts: 5
Joined: Sun Mar 15, 2009 3:45 pm

Re: Problem with LogL

Postby Anjuka » Mon Mar 16, 2009 3:28 am

Hi!

Thanks a lot for your respond. Sorry, I did not mention it previously, but actually, I have defined coefficient vectors. Here comes the full version of what I am writing in program (I would really appreciate if you could also point out on some additional problems I might have after running the program (misspecified smth, or missed smth):


coef(5) alpha
coef(4) beta
coef(2) sigma
!pi = @acos(-1)

logl ll1

ll1.append @logl logl1
ll1.append ud = logloans-alpha(1)-alpha(2)*loggdp-alpha(3)*gdpgap-alpha(4)*inflation-alpha(5)*lratelvl
ll1.append us = logloans-beta(1)-beta(2)*loggdp-beta(3)*logeqanddep-beta(4)*diffrates

ll1.append logl1 = -log(2*!pi) -log(sigma(1)) -log(sigma(2)) - ud^2/sigma(1)^2/2 -us^2/sigma(2)^2/2

equation eqa.ls logloans loggdp gdpgap inflation lratelvl
alpha = eqa.@coefs
sigma(1) = eqa.@se
show eqa.output

equation eqb.ls logloans loggdp logeqanddep diffrates
beta = eqb.@coefs
sigma(2) = eqb.@se
show eqb.output

ll1.ml
show ll1.output

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

Re: Problem with LogL

Postby EViews Gareth » Mon Mar 16, 2009 8:29 am

When you're performing the ML estimation, alpha only has 4 rows, since you had set alpha equal to the coefficient vector from equation eqa, and eqa only has 4 regressors. This over-writes the original declaration you made, which made it size 5.
Follow us on Twitter @IHSEViews

Anjuka
Posts: 5
Joined: Sun Mar 15, 2009 3:45 pm

Re: Problem with LogL

Postby Anjuka » Mon Mar 16, 2009 9:22 am

Thanks a lot, now it works ;)

I would like also to bother you with one more question regarding the sample program in Eviews 6.0 package - DISEQ1.prg . After running it, I obtain the output for TSLS regressions and ML. If you will recall the original exercise, ML should help in estimating Demand and Supply. How should I proceed from that if I want to get the estimated values for Demand and Supply?

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

Re: Problem with LogL

Postby EViews Gareth » Mon Mar 16, 2009 9:38 am

You should really check the text book that the program/example was taken from.
Follow us on Twitter @IHSEViews

Anjuka
Posts: 5
Joined: Sun Mar 15, 2009 3:45 pm

Re: Problem with LogL

Postby Anjuka » Mon Mar 16, 2009 10:19 am

The program (DISEQ1.prg) and example was provided by EViews team :) I've read about it in Users Guide II provided in EViews and the program is in my EViews package.
Therefore, for me it is just a technical question how to get fitted values for estimated Demand and Supply ...

Can you help me on that, please? :)

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

Re: Problem with LogL

Postby EViews Gareth » Mon Mar 16, 2009 10:28 am

That program replicates (as is indicated by the program itself, and the User Guide) an example from a textbook and from a paper. For interpretation of the results etc..., you should refer to the textbook.
Follow us on Twitter @IHSEViews

Anjuka
Posts: 5
Joined: Sun Mar 15, 2009 3:45 pm

Re: Problem with LogL

Postby Anjuka » Mon Mar 16, 2009 10:57 am

Thanks for your help, I will check the book one more time!


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 18 guests