I am having problems with introducing a nonstationary state space model into a rational expectations model to estimate in Dynare using MCMC. A state equation in the state-space model takes the form:

x = A*x(-1) + eps_x

and A = 1. This is due to the fact that there is no rational expectations equilibrium if A=1. There is an obvious trick that is to make A=0.999… . If my aim was solely to estimate this state space model, the results would not change much (Although in this case I do not even need to revert A back to 0.999). But I have doubt if this would make the solution to this RE model and hence the Bayesian estimation results too different. I am aware of the fact that this is not a purely Dynare-related question, but any help is appreciated.

I am not sure I understand. A unit root is still consistent with an RE equilibrium in a linearized model. The only problem is the initialization of the Kalman filter as the unconditional second moments do not exist. The solution here is to use the diffuse Kalman filter with diffuse_filter

Actually the problem is that Dynare returns an error stating that my model is not linear. On the other hand, if I exclude all the equations except the state space model, it runs perfectly fine. You can find the .mod file attached.

Thank you.

Edit: I could get the estimation running by setting

steady_state_model

However, the mode graphs are irregular. as can be seen from the graph below.

Edit 2: I think that the irregularity of the graphs might be related to the model misspecification or very tight priors. I am not done with finishing my model yet, when I do however, I will check whether the problem persists. Thanks @jpfeifer .

For now, I am removing the .mod file and will upload it along with the data file if the problem, once more, persists.