# Basic question about transformation to logs model

I want to have relative irfs and percentage std. devs. I already have my model in levels, but since it’s a medium scale model (~70 variables), I want to avoid manually setting the `x` to `exp(x)` substitution for each variable in the .mod file. Then I just thought that I could create auxiliary variables that represent the logs in this way:

``````var x y z
% then the logs
lx ly lz
;

model;
% Regular levels model equations
eq 1
eq 2
eq 3
% Assigning the logs
lx = exp(x);
ly = exp(y);
lz = exp(z);
end;
``````

Therefore for percentage second moments and relative irfs I’d only work with `lx`, `ly`, `lz` .Is that correct?

No, use logs. See

1 Like

Thanks! Also I was checking the Guide to Specifying Observation Equations, I can interpret that it don’t matter if I only use the exp() substitution in a subset of the equations, e.g. if I’m only interested in consumption relative irfs, only transform consumption to logs (with the exp()).

Also, regarding variables that are rates (e.g. nominal interest or unemployment rate), it’s not necessary to perform the transformation since as rates, percentage deviations would have kind odd interpretation, is that correct?

1. As I wrote, I would not do a substitution at all, but rather append an auxiliary equation like
``````log_c=log(c);
``````
1. Yes, usually we do not log interest rates. The only exception is when turning gross into net interest rates.
1 Like

Thanks!

1. Just to make sure I didn’t mess up, having converted only a few non-ratio variables to exp() (I mean not as I specified in the first post, but substituting every appearance of `x` in the levels model for `exp(x)`) transform and other just left as levels do not affect the model, right?

Yes, selectively performing an exp()-substitution for some variables is correct as long as you consistently replace all occurrences.

1 Like