Unit root problem

Hello!
I am trying to replicate a small open economy DSGE model in which i have an equation featuring a unit root as q(+1)-q=(r-pie(+1))-(r_f-pie_w(+1))+e_q. when I perform the stoch_Simul, I come across an error message “The singularity seems to be (partly) caused by the presence of a unit root
as the absolute value of one eigenvalue is in the range of ±1e-6 to 1.”
How should I fix this singularity problem due to the unit root in the model? I checked and did realize that the problem comes from the real exchange rate equation specification.
regard

You need to distinguish between a unit root and a singularity problem. Whenever you have a unit root you will get that message about collinearity in model_diagnostics. But that does not always indicate that there is something wrong. If the unit root is a feature of your model (like e.g. in the basic New Keynesian model where the price level has a unit root) then everything is fine.

You only have a problem if the unit root should not be there or if the Blanchard-Kahn conditions are not satisfied.

I di not get your explanation right. I am facing the violation of Blanchard Khan condition due to the equation related to the real exchange rate specified in log linear form as follows:
q(+1)=q+(r-pie(+1))-(r_f-pie_w(+1))+e_q where (r-pie(+1)) stands for the real interest rate (domestic), (r_f-pie_w(+1)) foreign real interest rate and e_q stands for the shock component. When I enter the variable in first difference form dq, it works. However, I have the same variable q in two other equations. That is how the problem comes in. The model is similar to that of Lubik and Schorfheide (2005) with few modifications but the core feature remains the same.
Thank you

What do you mean? Did you replace q(+1)-q by dq(+1)? That should not make a difference. If you replaced it by dq then you changed the timing which suggests there is still a mistake somewhere.

It is also very unusual to have a unit root in the real exchange rate as it will introduce a unit root in real variables. Are you sure the modifications you introduced are correct?

Hello
I just linearized the UIP (Uncovered Interest rate Parity) expression to get the equation as follows:

q(+)-q=r-pie(+1)-(rforeign-pieforeign(+1).  of q(+1)-q=(r-pie(+1))-(r_f-pie_w(+1))+e_q.

However, I got the code run but with some message stating that there is singularity problem for the static problem because at steady state, the term (r-pie) appears in many equations. So the command model_diqgnostics flags this issue albeit, the code runs successfully.
The next step is the identification and sensitivity analysis before the estimation. I got stock in identification step when i try to perform it with the relevant commands.
I got the following:

Prior distribution for parameter phiy has unbounded density!
Prior distribution for parameter phiy has unbounded density!
Prior distribution for parameter phiy has unbounded density!
 2.0% of the prior support gives unique saddle-path solution.
98.0% of the prior support gives explosive dynamics.
 Smirnov statistics in driving unique solution
Parameter            d-stat         p-value
phipi                 0.868           0.000
phie                  0.586           0.000

No correlation term with pvalue <1e-05 and |corr. coef.| >0 found for unique Stable Saddle-Path

No correlation term with pvalue <1e-05 and |corr. coef.| >0 found for NO unique Stable Saddle-Path
Smirnov statistics in driving instability
Parameter            d-stat         p-value
phipi                 0.868           0.000
phie                  0.586           0.000

No correlation term with pvalue <1e-05 and |corr. coef.| >0 found for NO explosive solution

No correlation term with pvalue <1e-05 and |corr. coef.| >0 found for explosive solution

Prior distribution for parameter phiy has unbounded density!

==== Identification analysis ====

Prior distribution for parameter phiy has unbounded density!
Testing prior mean

----------- 
Parameter error:
The model does not solve for prior_mean with error code info = 3

info==3 %! Blanchard & Kahn conditions are not satisfied: no stable equilibrium.
----------- 

Try sampling up to 50 parameter sets from the prior.

----------- 
Identification stopped:
The model did not solve for any of 50 attempts of random samples from the prior

Finally the estimation (bayesian) could not run. I would appreciate if you could provide me with any hint.
Thanks

Please do not cross-post. See my reply at Identification and sensitivity