Tex output - unwanted subscript "t"

The Tex output option is extremely useful, made better recently with the addition of the model_local_variable command. Unfortunately, when local parameter definitions thus created are subsequently transferred by Dynare into the equations of the compiled Tex file, they come with a “t” subscript attached. This is by no means critical, but it would be very nice indeed if it were possible to fix this issue so that the output .pdf file eliminates those unwanted subscripts. I have been doing so by hand, but it is extremely tedious!
Many thanks

This is not feasible due to the construction of model-local variables. As the name says, they can be true variables and can be lagged or leaded in time. In that case, the time index is actually mandatory. Because Dynare does not know whether a model-local variable only contains static objects or also dynamic objects, the time index is generally put there.

Thanks Prof. Pfeifer,
I was of course aware that the name implied that Dynare would treat these items as variables (hence the “t” subscript). My query was implicitly whether there could be a “model_local_parameter” type of command, which would not then add the subscript.

I am afraid, we currently don’t have the resources to implement this. I agree that it would be convenient, but it’s not critical.

Following up on this, it appears that the latest iteration of Dynare automatically creates the Tex equivalents of anything expressed with # sign within the model, so there is no longer need for the separate “model_local_variable” block.
This is very welcome, but sometimes leads to extremely lengthy and complicated expressions in the Tex output - see for example the output from your SW2007 file.
It would be convenient if there were a way to turn off this automatic expansion (preferably selectively by variable).

This looks like a regression and was not intended as far as I know. @sebastien What do you think?

I don’t understand what is the problem being discussed here. Could you be more specific?

When we defined model-local variables in the past, these objects appeared in the \LaTeX-codes when used in equations. This simplified the code. So when you had


as in DSGE_mod/Basu_Bundick_2017.mod at master · JohannesPfeifer/DSGE_mod · GitHub
you got
\begin{align} M &= {\beta}\, \frac{{a_{t+1}}}{{a_{t}}}\, \left(\frac{{{C}_{t+1}}^{{\eta}}\, \left(1-{{N}_{t+1}}\right)^{1-{\eta}}}{{{C}_{t}}^{{\eta}}\, \left(1-{{N}_{t}}\right)^{1-{\eta}}}\right)^{\frac{1-{{\sigma}}}{{{\theta_v}}}}\, \frac{{{C}_{t}}}{{{C}_{t+1}}}\, \left(\frac{{{V}_{t+1}}^{1-{{\sigma}}}}{{{\left({E_t V_{t+1}^{1-\sigma}}\right)}_{t}}}\right)^{1-\frac{1}{{{\theta_v}}}}\\ 1&={{R^R}_{t}}\, {M_{t}} \end{align}

But now the expression for the model-local variable is always plugged in. Thus, you get:
\begin{align} M &= {\beta}\, \frac{{a_{t+1}}}{{a_{t}}}\, \left(\frac{{{C}_{t+1}}^{{\eta}}\, \left(1-{{N}_{t+1}}\right)^{1-{\eta}}}{{{C}_{t}}^{{\eta}}\, \left(1-{{N}_{t}}\right)^{1-{\eta}}}\right)^{\frac{1-{{\sigma}}}{{{\theta_v}}}}\, \frac{{{C}_{t}}}{{{C}_{t+1}}}\, \left(\frac{{{V}_{t+1}}^{1-{{\sigma}}}}{{{\left({E_t V_{t+1}^{1-\sigma}}\right)}_{t}}}\right)^{1-\frac{1}{{{\theta_v}}}}\\ 1&={\beta}\, \frac{{a}_{t+1}}{{a}_{t}}\, \left(\frac{{{C}}_{t+1}^{{\eta}}\, \left(1-{{N}}_{t+1}\right)^{1-{\eta}}}{{{C}}_{t}^{{\eta}}\, \left(1-{{N}}_{t}\right)^{1-{\eta}}}\right)^{\frac{1-{{\sigma}}}{{{\theta_v}}}}\, \frac{{{C}}_{t}}{{{C}}_{t+1}}\, \left(\frac{{{V}}_{t+1}^{1-{{\sigma}}}}{{{\left({E_t V_{t+1}^{1-\sigma}}\right)}}_{t}}\right)^{1-\frac{1}{{{\theta_v}}}}\, {{R^R}}_{t} \end{align}

This is because we now substitute out all model-local variables early in the preprocessor. It remains to be seen whether the old behaviour can be restored for LaTeX output. At the very least, this would require some extra work.

Ideally, we would make a distinction between write_latex_dynamic_model and write_latex_original_model.
For future reference: Restore LaTeX-output for model-local variables for write_latex_original_model (#65) · Issues · Dynare / preprocessor · GitLab

Actually this is not true. Model local variables cannot be given a lead or a lag. I am going to remove the spurious time subscript, as requested by the original poster.

This is also a regression. It was still feasible in 4.5.

I think you are wrong. See preprocessor/ParsingDriver.cc · 4.5 · Dynare / dynare · GitLab

Yes, you are right. My mistake.

I note that this behaviour continues in the latest Dynare version (4.6.4).

Except for very simple models, it forces one to cancel printing of the dynamic model in LaTex, in order to avoid impossibly complicated texts: a real shame, as this was very useful in visualising a model.


@donihue Indeed, we forgot to include this in 4.6.4. But it should be fixed in the unstable version.

Alas, not as yet (version 4.7-unstable-2021-04-02-1657-3a823c48) …

Only write_latex_original_model was fixed, because write_latex_dynamic_model is supposed to show substitutions.

Thank you for pointing to this; I had not internalised the difference!
Now if only “model_local_variable” would work, we would be back to “the good old days” pre substitutions …

Could you please elaborate what you mean?