Input matrix contains NaN or Inf

I have a big problem. I coded a model incorporating :

  • a financial accelerator
  • a bank capital channel
  • public capital in production function
  • public investment related to oil revenues
  • petroleum sector.

The deterministic simulation of the model give a solution.

But, i cannot do stochastic simulation. the error message tells :

“Warning: Matrix is singular to working precision.
Error using eig
Input matrix contains NaN or Inf.”

How can i overcome this issues ?

The code is attached.
macrofi_new.mod (10.1 KB) ss_macrofinancial.mat (9.8 KB)

Did you also do a perfect foresight simulation with a shock? Your current simulation starts at the steady state and always stays there.

Hello Professor,
Thank you for your reply.
I have implemented a shock to bank capital. It works.

Then please provide that code.