Page 1 of 1

Element by element

Posted: Sun Apr 18, 2010 6:33 pm
by terryus
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!!!

Re: Element by element

Posted: Sun Apr 18, 2010 7:12 pm
by EViews Gareth
You want the @elt function. It is documented in the EViews 7 command reference.

Re: Element by element

Posted: Sun Apr 18, 2010 9:41 pm
by terryus
thank you so much

Re: Element by element

Posted: Sun Apr 18, 2010 11:03 pm
by terryus
hi, another question......

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

Thank you so much

Re: Element by element

Posted: Mon Apr 19, 2010 12:21 am
by EViews Gareth
There is no function like that on EViews 6

Re: Element by element

Posted: Mon Apr 19, 2010 7:09 am
by terryus
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!!!

Re: Element by element

Posted: Mon Apr 19, 2010 7:21 am
by EViews Gareth
The only thing you can do is use a for loop to run through and compare the elements one at a time

Re: Element by element

Posted: Mon Apr 19, 2010 11:14 am
by terryus
ok,thanks for you help.