Element by element

For questions regarding programming in the EViews programming language.

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

terryus
Posts: 15
Joined: Sat Mar 06, 2010 12:40 pm

Element by element

Postby terryus » Sun Apr 18, 2010 6:33 pm

Please i need your help....

Hi, I'm new in using Eviews and my question is about the element by element assessment of two column vectors, eg, x is a 9x1 vector w is another vector of 9x1, I need to evaluate element by element of W and X independently without extracting them to a scalar, because operators are not running >.<,=>,<= when working on vectors or matrix if one element does not meet the specified conditional.

program

if x <w Then

vector z = (x-w) +2
endif

with vectors, if an element w <x is not carried out


thank you very much!!!

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

Re: Element by element

Postby EViews Gareth » Sun Apr 18, 2010 7:12 pm

You want the @elt function. It is documented in the EViews 7 command reference.

terryus
Posts: 15
Joined: Sat Mar 06, 2010 12:40 pm

Re: Element by element

Postby terryus » Sun Apr 18, 2010 9:41 pm

thank you so much

terryus
Posts: 15
Joined: Sat Mar 06, 2010 12:40 pm

Re: Element by element

Postby terryus » Sun Apr 18, 2010 11:03 pm

hi, another question......

Do you know how is it in Eviews 6?, i got not Eviews 7....

Thank you so much

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

Re: Element by element

Postby EViews Gareth » Mon Apr 19, 2010 12:21 am

There is no function like that on EViews 6

terryus
Posts: 15
Joined: Sat Mar 06, 2010 12:40 pm

Re: Element by element

Postby terryus » Mon Apr 19, 2010 7:09 am

hi,
I know it, but How would be the way programming in Eviews 6...In reality i need a tip for this it.

thanks and excuse me the inconvenience!!!

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

Re: Element by element

Postby EViews Gareth » Mon Apr 19, 2010 7:21 am

The only thing you can do is use a for loop to run through and compare the elements one at a time

terryus
Posts: 15
Joined: Sat Mar 06, 2010 12:40 pm

Re: Element by element

Postby terryus » Mon Apr 19, 2010 11:14 am

ok,thanks for you help.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests