I have a weird problem. I am running the attached PF model. When the sign of the shock is negative everything seems fine. When I change the sign of the shock to positive, the model fails to solve and it appears that the variable b, which is a CES aggregator becomes complex. Any idea what may be causing this? The mod file is attached.

Have you tried smaller positive values for the shock and then checking whether the results still make sense when you move closer to the region where the model does not solve anymore. Sometimes, for big shocks the model would only have a solution if some variables that cannot be negative were negative.

I did try smaller values, but it did not make a difference. I am not sure if you looked at the code, but it might be useful to mention that the model is written in non-linear terms. Solving the same linear model does not create any issues. Not quite sure what the issue is.

%Deterministic Shocks
shocks;
var u;
periods 1:4;
values 0.092;
end;
%Run the Simulation
perfect_foresight_setup(periods=100);
perfect_foresight_solver(robust_lin_solve);

Thanks for letting me knowI think I only went up to 0.1. The original shock size of 0.34 that I used comes from another paper. Very small values of the shock are not very useful to me. I am still kind of confused as to why that issues only appears in the non linear version of the model. It must have something to do with the internal routines Matlab uses to solve the model. Would it possibly help if I were to rewrite the model in exp log form?