Credit constraint - simulated series

Dear dynare users,

I would like to ask you to help me understand the following issue.

I have a model which includes entrepreneurs who borrow loans from banks to produce goods. They are limited in the borrowing activity by credit constraint of the form

b_{t}^{E}(1+r_{t}^{bE}) = m_{t}^{E}E_{t}\left(q_{t+1}^{k}K_{t}(1 - \delta)\right)

To put is simply, the LHS of the equation states how much does an entrepreneur actually borrow (call it “real”), the RHS of the equations prescribes the maximum amount of loans to be borrowed (call it “possible”). When I let the Dynare solve the model and simulate artificial data series using the stoch_simul command (2nd order approximation), I would expect that the simulated series “real” would match the “possible” series. However, it is not the case (please see the attached figure).

Please, could you clarify why I see such result?

Thank you very much for helping me!



How did you generate the two series? The RHS involves an expectation you need to evaluate.

Thank you for responding prof. Pfeifer.

Well I just defined two new variables: one being equal to the RHS while the other one being equal to the LHS. So I assume this is not how it works…


Then I would need to see the codes.