This project is read-only.

Negative log-linear variables

Topics: IRIS in General
May 19, 2014 at 3: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,:);
May 20, 2014 at 7: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
May 20, 2014 at 12:54 PM
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.

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

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".

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