Negative log-linear variables

Topics: IRIS in General
May 19, 2014 at 2:29 PM
I need to use log-linear variables for net foreign assets. Some countries have negative NFA balances. IRIS doesn't handle negative log-linear variables, but we don't want to change the definitions. So I propose the following fix:

Insert the following three lines in doOneTrendArray() nested function in mytrendarray.m

Before using reallog:
negInx = logInx & level<0;
level(negInx) = -level(negInx);
And after taking exp:
X(negInx,:) = -X(negInx,:);
Coordinator
May 20, 2014 at 6:44 AM
It's not a limitation of IRIS that the natural logarithm isn't defined for negative numbers... that's just mathematics. Look at the definition of the natural log.
Marked as answer by jaromirbenes on 5/20/2014 at 4:54 AM
Coordinator
May 20, 2014 at 11:54 AM
Hi ikarib,

the only consistent way to make the model solution more flexible with respect to log variables would be the following:

If a variable takes only negative values (and never positive), the user would have the option to tell IRIS to switch the variable's sign consistently across the entire input data processing & steady state & solution & output data processing. This would be practically equivalent to replacing X with (-X) in the entire model file, except that the user would not have to change the sign of the variable in the input/output databases.

At some point, I wanted to implement this myself (in fact, in a very similar situation, where in some model versions, the net asset position was only position and in some other versions, it was only negative).

This is, though, a relatively larger intervention into the existing codes. Please submit a feature request.

Best,
Jaromir
Marked as answer by jaromirbenes on 5/20/2014 at 4:54 AM
May 20, 2014 at 2:20 PM
Edited May 20, 2014 at 2:33 PM
I see that mytrendarray depends on Delog. This makes it more complicated than I thought. How do I submit a feature request?
Coordinator
May 20, 2014 at 2:51 PM
Hi

There are actually (and unfortunately:) many more interdependecies.

To submit a feature request, go to the "Issues" tab, click on "New Issue", describe the feature request, and on the right-hand side panel, select "Feature" under the heading "Type".

Best,
Jaromir
Marked as answer by jaromirbenes on 5/20/2014 at 7:51 AM