Smet and Wouter(2007) model

Why do we need to separately input the equations for the flexible economy and the sticky price-wage economy in the Dynare code for the Smets and Wouters (2007) model? Wouldn’t it be sufficient to only input the equations for the sticky price-wage economy?

No, because in the Taylor rule there is a deviation of output from its flex price counterpart. That requires computing flex price output.

thank you for your response, then Then, should we obtain the equations for the variables in a flexible economy by adjusting only the parameters representing price and wage rigidity (e.g., setting the parameter value for the fraction of firms able to set prices to 1)?

Yes, effectively that’s what they are doing.

Thank you for your response. I have one more question. In some papers, equations are detrended before being linearized, while in others, the optimal conditions are linearized directly without detrending. Why are these approaches treated differently? My understanding is that if the model has labor-augmenting technology with a balanced growth path (BGP), detrending is used to incorporate shocks that affect long-term growth into the equations. On the other hand, if there is no interest in the impact of shocks on long-term growth, the BGP is not considered. Is this correct?

This indeed depends on whether the model explicitly models source of long-run growth. If yes, then the model is nonstationary and you first need to detrend it. If you write down a stationary model, you can directly solve it without detrending (as there is no trend).

Thank you for your response. In a business cycle model designed to study the effects of monetary policy, if the labor-augmenting shock is assumed to be stationary (i.e., it does not contain a unit root), the model is already stationary, and there is no need for detrending. However, if I want to examine the response to a technology shock that follows a unit root process, detrending the model would be appropriate to account for the non-stationary nature of the shock and ensure that the model focuses on deviations from the growth path. Is this correct?

Yes, that is correct. See also Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”