Page 1 of 1
Negative values are handled strange when raised to a power
Posted: Thu Jan 19, 2012 12:57 pm
by nvangiersbergen
Check the difference between the correct series r2 and incorrect series r2p in the program below:
workfile c:\check.wf1 u 1 5
!r=-0.3
genr r2=!r*!r
genr r2p=!r^2
I was able to replicate this serious error in Eviews 5, 6 and 7!
Looking forward to your reply.
Re: Negative values are handled incorrect when raised to a p
Posted: Thu Jan 19, 2012 1:26 pm
by EViews Gareth
This isn't a bug or an error, rather it is just the nature of text substitution, and text interpretation.
Note that the following is also true, and also not an error:
Code: Select all
series x1 = -3^2
series x2 = -3*-3
Re: Negative values are handled incorrect when raised to a p
Posted: Thu Jan 19, 2012 1:59 pm
by nvangiersbergen
Well, I find it strange that in the manual these variables are referred to as control variables.
In any other programming language, a variable squared, i.e. !r^2, would be interpreted as (!r)^2. Clearly, this is not the case in Eviews and frankly quite counterintuitive.
Apparently, control variables are treated as strings, i.e. a value as if you would enter them from the keyboard.
Re: Negative values are handled incorrect when raised to a p
Posted: Thu Jan 19, 2012 2:04 pm
by EViews Gareth
I've made a note to make it more explicit in the manual.