It seems that estimating Smets and Wouters (2007) model using Bayesian methods is currently a quite standard task, including finding the posterior mode. But that is conditional on the particular set of observable variables and the particular way in which people calibrate parameters and solve for the steady states. If the calibrated parameters are changed to some other parameters, the way of solving steady states would also change. This is equivalent to changing the parameter space on which the estimation is based. I am concerned that changing the parameter space would change the posterior kernel and may make the searching of the posterior mode a difficult task. I have encountered this kind of situation. But I am not sure where the problem is from. From my code? or it is not a problem at all? Would anyone give me some hints? Thanks a lot!
You should post your code for us to see. In my brief experience, a surprising amount of problems in running the program are due to the stringency of the code itself, i.e. using a variable name that Dynare has already prespecified or forgetting a semicolon.
My conjecture is that changing the parameter values will – as you said – change all the posteriors necessarily, and thus the parameter space, but that as long as you provide some initial values that are in the right direction, it should work. Even more generally, there are ways (though I am not sure how to do them in Dynare), like Markov monte carlo, to mitigate the problem of incorrect initial conditions. Have you tried using homotopy in Dynare?
 Changing the calibration is typically not a problem. But you have to make sure that all parameters that depend on the changed calibration are correctly updated, including the steady state values.
 Yes, it will change the posterior. The major problem is that finding the mode in finite time might be hard. This is a very common problem. See the paper by Chib/Ramamurthy (2010): ideas.repec.org/a/eee/econom/v155y2010i1p1938.html
Thanks for all your reply, macroresearch123 and jpfeifer! Actually I am a newcomer to Dynare. So I haven’t tried homotopy yet. Regarding our discussion, I have a few more clarificatioins and further questions.

The reason why I had asked the questions in my previous post is because in my work, I did not fix the values of the elasticities of substitutions between different labor types and intermediate goods as Smets and Wouters (2007) do. So I estimate the elasticity of substitution between different labor types along with other parameters and calculate (implictly calibrate) the elasticity of substitution between different intermediate goods from the system of steady states. When solving the steady state system, I encountered some cases when the values of steady state variables and the elasticity of substitution between different intermediate goods are complex. This is obviously because of the parameters that I draw. To guarantee the solved values to be real, I need to restrict the parameter space by imposing some checking in finding the mode and simulating the posterior. Every time I draw an invalid set of parameters, I will automatically assign a very unlikely value to the posterior density so that this set of parameters is automatically penalized in finding the mode which is based on the optimization routine like csminwel. When simulating the posterior using MCMC, if I draw an invalid set of parameters, I will discard this set and draw again. Because I don’t know how to incorporate this kind of checking into Dynare, I don’t have Dynare code now, but I definitely would like to try in Dynare. Do you have any suggestions?

By the way, if I want to impose the restriction that the model has a unique stationary solution, can Dynare check this automatically?

People mention that the elasticities of substitutions between different labor types and intermediate goods are fixed because they cannot be identified from data. If these parameters are estimated instead and they are truly not identified, would the identification problem create challenges to the mode search process?

According to Chib/Ramamurthy (2010), many public results currently in the literature may not be reliable, even including Smets and Wouters (2007). Maybe this is a common problem for the whole profession, right? jpfeifer, has Dynare already incorporated the algorithm in Chib/Ramamurthy (2010)? It seems to be very time consuming. Since you said “finding the mode in finite time might be hard”, what would your suggestion be?
Again, I really appreciate your kind replies!
Although understanding the nuances of smetswouters is beyond my current knowledge base, here are two comments:

On Matlab, one trick I have used, not always successful, is defining the objective function “F” at the end of the commands as follows: F=[real(F(:,:)), imag(F(:,:))]. What this does is partition the solutions into the real and imaginary roots; sometimes the real solutions will be the “right” ones. However, since this does not always work, Dynare can be a great mechanism to solve it differently. If you are familiar with Matlab (which you are), the transition is easy “more or less”; there are some quirks Dynare has, but jpfeifer is great at answering a range of questions and the Dynare manual is also relatively comprehensive.

Regarding identification of elasticity parameters: these are indeed not deep parameters in the sense of depreciation, discount rates, risk aversion parameters, etc; elasticities are endogenous to technological change. However, for certain durations, we can treat them as fixed. For example, Per Krussel, Hassler, and Olovsson have a 2012 NBER working paper that incorporates energy into a general equilibrium context and shows that Cobb Douglas is a poor approximation for matching US energy / growth facts, point being that the results may not be robust to functional form. This is not necessarily a bad thing per se, but just a reality. One of the best ways to handle this is to estimate or calibrate based on some reasonable assumptions, then just test the model under a very conservative elasticity estimate.
Thanks for the comments of macroresearch123!
According to my experience, whenever a complex number is obtained during the calculation of the steady state, I can always get back to the set of parameters that has been drawn. So I can always restrict the parameter space to the region that delivers realvalued steady states. I did this numerically by acceptance/rejection rather than analytically.
I am just curious if Dynare can handle this kind of restrictions and what jpfeifer’s opinions are on this.