Theoretical Moments: NaN

So this seems like a parameter issue. Since when solving a DSGE model, we take the inverse of a matrix which its elements are made up of parameters and functions of the parameters of the model, it is expected that choosing some parameter values may sometimes make the matrix singular, which seems to be the issue here, I guess. Try playing with the values of the other parameters while keeping phik at 0.

Also as dynare says, try reducing the qz_zero threshold. Default is 1e-6. So try decreasing that to may be 1e-30.

According to dynare documentation, qz_zero threshold is used to test if a generalized eigenvalue is 0/0 in the generalized Schur decomposition (in which case the model does not admit a unique solution).

Schur decomposition is used to decompose a matrix if it is singular, so that we are are able to find eigen values for the matrix. This is part of the process of determining whether the Blanchard khan conditions of a DSGE model are satisfied. I suggest you read it or anything about solving a system of rational expectation equations.

So of course we don’t want eigen value to be 0/0 which is not defined. qz_zero_threshold is a way to test it, and also one way to get around this error is by decreasing it.

While decreasing qz_zero_threshold might solve the problem in some cases, this is not always the solution as prof. Pfeifer says in this post How can I reduce manually qz_zero_threshold