Create variables functions of parameters to estimate

For questions regarding programming in the EViews programming language.

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

Umass
Posts: 2
Joined: Mon Jul 09, 2012 6:16 am

Create variables functions of parameters to estimate

Postby Umass » Mon Jul 09, 2012 6:27 am

Dear all,
I am new to Eviews programming and I have a relatively simple question.
I want to write a program to estimate a nonlinear model but before writing the specification of the model (that will be passed to "equation eq1.ls ...") I would like to create variables which are functions of the parameters that i want to estimate.
A stylized example is the following:

genr x1 = @abs(c(1)*x)
genr z1 = @exp(c(2)*z)

equation eq1.ls y = z1*x1 + (1-z1)*c(2)*y(-1)

Thanks a lot for any suggestion!

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

Re: Create variables functions of parameters to estimate

Postby EViews Gareth » Mon Jul 09, 2012 8:02 am

Code: Select all

equation eq1.ls y = @exp(c(2)*z)*@abs(c(1)*x) + (1-@exp(c(2)*z) )*c(2)*y(-1)
Assuming that you want the c(1) and c(2) in the genr statements to be part of the estimation, substituting them out is the only way to do it.

Umass
Posts: 2
Joined: Mon Jul 09, 2012 6:16 am

Re: Create variables functions of parameters to estimate

Postby Umass » Mon Jul 09, 2012 8:15 am

Yes, I wanted the c(1) and c(2) to be part of the estimation.
I thought about substituting them out in the specification of the model, the problem is that the actual expressions are way more tedious than the ones in the stylized example. But if that's the only way to go, I guess I'll have to deal with it.
Thanks anyway!

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

Re: Create variables functions of parameters to estimate

Postby EViews Gareth » Mon Jul 09, 2012 8:19 am

You could try the LogL object instead of an equation object, but that offers fewer post-estimation options than the equation.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest