I am trying to use OBC toolkit from Thomas Holden on the model attached below. When I leave the model in levels, i.e. linearized, then after calling dynareOBC obc_zlb_nk.mod nocubature ShockScale=10 TimeToEscapeBounds=64; it runs. However, when I want to use loglinear option, I get the following error: line 121, cols 1-14: Y has wrong type or was already used on the right-hand side. You cannot use it on the left-hand side of a pound (’#’) expression.
It does not make sense to me because I do not use any pound operator in the model. Moreover, I do not understand why the error message mentions line 121, where I just calibrate the parameters.
Loglinear in DynareOBC is a bit of a hack. It rewrites the model file by introducing a load of MLVs which put the variables into logs. Clearly on your file this rewriting failed. The cause seems to be the variable name tags. If you remove these, then it runs fine. E.g. the code should start:
var C
Y
etc…
In future please submit DynareOBC issues on GitHub. For the time being I’ll create an issue for this bug for you to remind me to fix it in a future version.