Estimation equation in a string

For questions regarding programming in the EViews programming language.

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

lukevancleve
Posts: 18
Joined: Mon Apr 29, 2013 1:24 pm

Estimation equation in a string

Postby lukevancleve » Fri Jun 13, 2014 11:41 am

Hi,

Is there an easy way to get the estimation equation as a string? say I have an equation object that when you view it has

Estimation Equation
=======================
A = C(1)B + C(2)B(-1)


Is there a

string my_eq = ?

... to get "A = C(1)B + C(2)B(-1)"

Thanks,

Luke

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

Re: Estimation equation in a string

Postby EViews Gareth » Fri Jun 13, 2014 1:52 pm

Do you want the actual values of the coefficients?

lukevancleve
Posts: 18
Joined: Mon Apr 29, 2013 1:24 pm

Re: Estimation equation in a string

Postby lukevancleve » Tue Jun 17, 2014 10:48 am

I do not.

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

Re: Estimation equation in a string

Postby EViews Gareth » Tue Jun 17, 2014 10:54 am

Unfortunately there isn't an easy way.

equation.@subst returns it with substituted coefficients (i.e. their values).


You can either freeze the representations view into a text object and pull off the line containing the expression you want:

Code: Select all

freeze(temp) equation.representations temp.svector temp2 %exp = temp2(7)
That might be tricky, because it might not always be the 7th row of the svector.

Or you could build up the expression yourself, getting the names of the variables and the coefficients from equation.@varlist and equation.@coeflist


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests