Some element of Newton direction isn't finite. Jacobian maybe singular or there is a problem with initial values

I get the following message when I run the attached code.

Error using lnsrch1 (line 71)
Some element of Newton direction isn’t finite. Jacobian maybe singular or there is a problem with
initial values

There is no attachement.

prog05.mod (2.6 KB)

sorry. here’s the mod file.

Check your model. For example,

z = rhoz*z(-1)+ ez;

implies z= 0. That conflicts with

m = ((z*(1-(chi*(1-sigma))))/((1-tau)*w*((kappa*exp(n))^(1-sigma))))^(1/(1-sigma));

where it should not be 0. I guess it should be exp(z) in that equation.