Steady state values in log-linearized model: Problem

In the log-linearized model, the steady state values of endogenous variables should be by definition equal to zero, i.e. x_hat=0, for a generic variable x, where x_hat=x_t-x_ss/x_ss. When running my model and using the command steady, I find out that the variables are indeed equal to 0 in steady state. But the situation changes when I augment my model with observation equations. In this case, Dynare reports the values like:
2,34243973622698e-19
1,70213121107874e-32
3,40106887162279e-20
-1,22850493604168e-21
7,18850716504149e-21
-6,62816032754152e-21
-6,16297582203916e-33

I know that these numbers are very small, but nevertheless I’m wondering why Dynare does not report the values that would be equal to 0.

What could be the reason for that?

Please provide the files.

You have some linear equations with a constant term, namely the observation equations. Given that you have 70 equations or so, there is some numerical imprecision. You should provide initial values for the non-zero variables, i.e.

initval; // Domestic inflation pi_obs = 100*(pi - 1); // CPI inflation pi_c_obs = 100*(pi - 1); // GDP dy_obs = 100*ln(mu_z); // Consumption dc_obs = 100*ln(mu_z); // Investment di_obs = 100*ln(mu_z); // Imports dm_obs = 100*ln(mu_z); // Exports dx_obs = 100*ln(mu_z); // Government spending dg_obs = 100*ln(mu_z); // CPI based real exchange rate reer_obs = x; // Employment e_obs = E; // Real wage dw_obs = 100*ln(mu_z); // Domestic interest rate r_obs = 400*(((pi*mu_z-tau_k*beta)/((1-tau_k)*beta))-1)*((pi*mu_z-tau_k*beta)/((1-tau_k)*beta)); // Foreign output dyfor_obs = 100*ln(mu_z); // Foreign inflation pifor_obs = 100*(pi - 1); // Foreign interest rate rfor_obs = 400*((pi*mu_z-tau_k*beta)/((1-tau_k)*beta) - 1)*(pi*mu_z-tau_k*beta)/((1-tau_k)*beta); end;

Dear prof. Pfeifer,

first of all, thank you for your reply.

Does this also apply to
// CPI based real exchange rate
reer_obs = x;
// Employment
e_obs = E;

? There is no constant term in this observation equation.

No, they have mean 0 and stay mean 0.

Ok. Another question:

Why did you use
// Domestic interest rate
r_obs = 4*(((pimu_z-tau_kbeta)/((1-tau_k)beta))-1)((pimu_z-tau_kbeta)/((1-tau_k)*beta));

and not only
r_obs = 4*(((pimu_z-tau_kbeta)/((1-tau_k)*beta))-1);

I did not check which terms belong to variables and parameters. You only need the constant terms.

As you suggested, I provided initial values for all non zero variables, i.e.

initval;
pi_obs = (pi-1);
dy_obs = ln(mu_z);

etc.

end;

but the problem still persists. Steady state is not equal to zero whereas the steady state for non zero variables is equal to constant term (which is OK). But what is interesting, when I compute Ramsey policy (I know that using a linear model with a quadratic objective in the Ramsey command is generally not OK) the steady state is equal to zero and the steady state for non zero variables (obs. variables) is equal to constant term.

Use the steady_state_model-block and make sure you provide all values in terms of the deep parameters. I had only 0 residuals.

In this way?

initval;

// Domestic inflation
pi_obs = (pi - 1);
// CPI inflation
pi_c_obs = (pi - 1);
// GDP
dy_obs = ln(mu_z);
// Consumption
dc_obs = ln(mu_z); 
// Investment
di_obs = ln(mu_z); 
// Imports
dm_obs = ln(mu_z);
// Exports
dx_obs = ln(mu_z); 
// Government spending
dg_obs = ln(mu_z); 
// Real wage
dw_obs = ln(mu_z); 
// Domestic interest rate
r_obs = 4*(((pi*mu_z-tau_k*beta)/((1-tau_k)*beta))-1);
// Foreign output
dyfor_obs =  ln(mu_z);
// Foreign inflation
pifor_obs = (pi - 1);
// Foreign interest rate
rfor_obs = 4*((pi*mu_z-tau_k*beta)/((1-tau_k)*beta) - 1);
end;


steady_state_model;
// Domestic inflation
pi_obs = (pi - 1);
// CPI inflation
pi_c_obs = (pi - 1);
// GDP
dy_obs = ln(mu_z);
// Consumption
dc_obs = ln(mu_z); 
// Investment
di_obs = ln(mu_z); 
// Imports
dm_obs = ln(mu_z);
// Exports
dx_obs = ln(mu_z); 
// Government spending
dg_obs = ln(mu_z); 
// Real wage
dw_obs = ln(mu_z); 
// Domestic interest rate
r_obs = 4*(((pi*mu_z-tau_k*beta)/((1-tau_k)*beta))-1);
// Foreign output
dyfor_obs =  ln(mu_z);
// Foreign inflation
pifor_obs = (pi - 1);
// Foreign interest rate
rfor_obs = 4*((pi*mu_z-tau_k*beta)/((1-tau_k)*beta) - 1);
end;

What do I need to do additionally?

I used

steady_state_model; x=0; E=0; // Domestic inflation pi_obs = (pi - 1); // CPI inflation pi_c_obs = (pi - 1); // GDP dy_obs = ln(mu_z); // Consumption dc_obs = ln(mu_z); // Investment di_obs = ln(mu_z); // Imports dm_obs = ln(mu_z); // Exports dx_obs = ln(mu_z); // Government spending dg_obs = ln(mu_z); // CPI based real exchange rate reer_obs = x; // Employment e_obs = E; // Real wage dw_obs = ln(mu_z); // Domestic interest rate r_obs = 4*(((pi*mu_z-tau_k*beta)/((1-tau_k)*beta))-1)*((pi*mu_z-tau_k*beta)/((1-tau_k)*beta)); // Foreign output dyfor_obs = ln(mu_z); // Foreign inflation pifor_obs = (pi - 1); // Foreign interest rate rfor_obs = 4*((pi*mu_z-tau_k*beta)/((1-tau_k)*beta) - 1)*(pi*mu_z-tau_k*beta)/((1-tau_k)*beta); end;

Thank you very much for your help. Now it works…

To see how well the model fits the data figure (file attached) plots the original data and one-sided predictions from the model (oo_.Filtered_Variables_1_step_ahead.Mean.variablename). It is evident that in some cases there exists a shift. Is this ok given the fact that we have obs. equations with constant terms? I would appreciate any comment on this matter.
Fit.pdf (255 KB)

If I remember correctly, the filtered variables are in deviations from their mean, i.e. they are always centered. That would explain the vertical shift.