Second-order Welfare analysis and Occasionally Binding borrowing constraint

Professor Pfeifer,

I have looked through Occbin_example.mod in Dynare 5.1

I am not sure I got your point in the last message of the discussion.

The thing I wanted to do is to estimate optimal 2nd order Monetary Policy (MP) (Taylor Rule) that would maximize the welfare of agents, i.e. find such combination of MP parameters, such that welfare is maximized. To obtain this welfare I use stock_simul(order=2, irf=0), which is a basic tool for stochastic simulations. The I use solver and so on.

However, OccBin uses its own command occbin_solver, which takes given shocks as inputs.

The question is whether it is possible to find optimal (2nd order) MP given existence/possibility of occasionally binding constraint, such that this MP parameters are estimated with application of OccBin? Is it even feasible?

Best regards