I’m writing with a question about the discretionary_policy function in Dynare. We have a large model (> 400 equations) to which we’d like to apply this function, but the model’s equations are currently written in non-linear form and therefore have to be linearized before we can run discretionary_policy. Given the size of our model, is there a way to automate that linearization process? Since Dynare already has tools to compute the first-order derivatives of non-linear models, my collaborators and I thought that this should be possible in principle.

Thank you for any information or advice that you’re able to share.

I am asking because https://git.dynare.org/Dynare/dynare/-/merge_requests/1792 allows for what you have in mind, but it’s not yet possible to have Dynare compute the steady state.
P.S.: Note that solving the steady state numerically outside of Dynare counts as “analytically” as you are not solving the full system by brute force.

In the current version of our Dynare model file, we are actually not solving for the steady state but simply provide the exact steady state values in the initval block. Is it okay if we just rename “initval” to “steady_state_model” for your code to work properly?

Why does the output says “All endogenous are constant or non stationary, not displaying correlations and auto-correlations” and STEADY-STATE RESULTS are all zeros?

No, it only means that you cannot let Dynare compute the objective as is. This is safety check to prevent memory overflow when there are more than 180 static and predetermined variables. If you feel comfortable, you can simply remove that restriction in line 43 of evaluate_planner_objective.m. If your computer freezes, you know that memory is insufficient.

That’s a good point. I hadn’t really looked at the bottleneck. I guess you meant Wyy = reshape(dlyap(sqrt(beta)*Gy',reshape(Uyygygy,nspred,nspred)),1,nspred*nspred);