Let X be a series of negative numbers. Then the command
series Y = X^(1/3)
(or any other "1/oddnumber" fractional power)
returns a "Warning: pow: Domain error" message, overwrites series "Y"
and returns a "no valid values" if one attempts to view the series.
Why is this happening, considering that X^(1/3) is a real number even if
X is a negative number?
Now, consider series "Z" which has both positive /and/ negative values.
We want to compute
W = Z^(1/3)
Given a recent new feature in gretl, the sign function sgn(), I guess
we can avoid the obvious conditional if-else statement, and compute W
by writing
W = sgn(Z) * (abs(Z)^(1/3))
that covers also the case of Z taking an exact zero value.
Is this the proper/efficient way?
--
Alecos Papadopoulos PhD
Athens University of Economics and Business
web:
alecospapadopoulos.wordpress.com/
skype:alecos.papadopoulos