Mode_check plots with flat lines

Dear all,

I am trying to estimate a log-linearized small open economy model using the following data:

  • real domestic output (quarterly data, I log the data, then substracted the HP filtered data)
  • domestic inflation (monthly data, I log the data, then get the mean of the log(data), then get pi_c_obs = log(inflation) - mean(log(inflation))
  • real exports (monthly data , I log the data, then substracted the HP filtered data)
  • real imports (monthly data , I log the data, then substracted the HP filtered data)
  • terms of trade (delta_obs) (monthly data, I log the data, then substracted the HP filtered data)
  • real foreign output (quarterly data , I log the data, then substracted the HP filtered data)

I also use measurement errors. I get weird mode_check plots where many parameters have flat lines. I tried to change many times the priors but I still end up stuck with bad mode_check plots. Ones of the best I got are attached.
Here is the message I got from using the identification command (saying that most of my parameters aren’t identified. I tried many different priors and dont know what to do now.):

======== Identification Analysis ========

Testing prior mean
Evaluating simulated moment uncertainty … please wait
Doing 102 replicas of length 300 periods.
Simulated moment uncertainty … done!

Note that differences in the criteria could be due to numerical settings,
numerical errors or the method used to find problematic parameter sets.
Settings:
Derivation mode for Jacobians: Analytic using sylvester equations
Method to find problematic parameters: Nullspace and multicorrelation coefficients
Normalize Jacobians: Yes
Tolerance level for rank computations: robust
Tolerance level for selecting nonzero columns: 1e-08
Tolerance level for selecting nonzero singular values: 1e-03

REDUCED-FORM:
!!!WARNING!!!
The rank of Tau (Jacobian of steady state and reduced-form solution matrices) is deficient by 4 (rank(Tau) = 6 < 10 with tol = robust)!

s_igma is not identified!
eta is not identified!
a is not identified!
theta is not identified!

MINIMAL SYSTEM (KOMUNJER AND NG, 2011):
!!!WARNING!!!
The rank of Deltabar (Jacobian of steady state and minimal system) is deficient by 4 (rank(Deltabar) = 51 < 55 with tol = robust)!

s_igma is not identified!
eta is not identified!
a is not identified!
theta is not identified!

SPECTRUM (QU AND TKACHENKO, 2012):
!!!WARNING!!!
The rank of Gbar (Jacobian of mean and spectrum) is deficient by 4 (rank(Gbar) = 6 < 10 with tol = robust)!

s_igma is not identified!
eta is not identified!
a is not identified!
theta is not identified!

MOMENTS (ISKREV, 2010):
!!!WARNING!!!
The rank of J (Jacobian of first two moments) is deficient by 8 (rank(J) = 2 < 10 with tol = robust)!

SE_eps_y_ME is not identified!
SE_eps_pi_ME is not identified!
SE_eps_tot_ME is not identified!
SE_eps_ystar_ME is not identified!
s_igma is not identified!
eta is not identified!
a is not identified!
theta is not identified!

==== Identification analysis completed ====

Can anyone help me ? Thanks a lot.

SOEMData.xlsx (94.1 KB)
Model.mod (3.6 KB)
Model_steadystate.m (12.5 KB)
ModeCheck1.pdf (6.6 KB) ModeCheck2.pdf (2.3 KB)

As Dynare tells you

The steady state file internally changed the values of the following estimated parameters:
s_igma
eta   
a     
theta 
This will override the parameter values drawn from the proposal density and may lead to wrong results.
Check whether this is really intended.

I actually tried to fix that but if I dont set my parameters in the steady state file I get an error message. Should I just use a steady state block and delete my steady state file ? Or is there a way to keep my steady state file but not have this problem ?

Thank you for your help.

No, you need to think about what you are trying to achieve. Either those parameters are independent objects to be estimated or they can be fixed due to steady state restrictions. It cannot be both.

So what I am trying to do is to estimate some of the parameters (the measurement errors and eta, s_igma and a). I used the steady state file because some parameters depend on the values of eta, s_igma and a. Many of my parameters depend on these 3 estimated parameters. Do I need to do another step to declare the parameters that depend on eta, s_igma and a as dependent ?

No, having that dependence in the steady state file is fine, but your steady state file also internally changes eta, s_igma and a. That is not ok, because you declared them to be independent objects.

I changed the Steady state file by taking out s_igma, eta and a. I dont get the following message anymore:

The steady state file internally changed the values of the following estimated parameters:
s_igma
eta
a
theta
This will override the parameter values drawn from the proposal density and may lead to wrong results.
Check whether this is really intended.

However I still get the following from the identification command which is a bit confusing to me:


======== Identification Analysis ========

Testing prior mean
The number of moments with non-zero derivative is smaller than the number of parameters
Try increasing ar = 2
The number of moments with non-zero derivative is smaller than the number of parameters
Try increasing ar = 3
The number of moments with non-zero derivative is smaller than the number of parameters
Try increasing ar = 4
The number of moments with non-zero derivative is smaller than the number of parameters
Try increasing ar = 5
The number of moments with non-zero derivative is smaller than the number of parameters
Try increasing ar = 6
The number of moments with non-zero derivative is smaller than the number of parameters
Try increasing ar = 7
The number of moments with non-zero derivative is smaller than the number of parameters
Try increasing ar = 8
The number of moments with non-zero derivative is smaller than the number of parameters
Try increasing ar = 9
The number of moments with non-zero derivative is smaller than the number of parameters
Try increasing ar = 10
WARNING: Order condition for dMOMENTS failed: There are not enough moments and too many parameters.
The number of moments with non-zero derivative is smaller than the number of parameters up to 10 lags.
Either reduce the list of parameters, or further increase ar, or increase number of observables.
Skip identification analysis based on moments.

Note that differences in the criteria could be due to numerical settings,
numerical errors or the method used to find problematic parameter sets.
Settings:
Derivation mode for Jacobians: Analytic using sylvester equations
Method to find problematic parameters: Nullspace and multicorrelation coefficients
Normalize Jacobians: Yes
Tolerance level for rank computations: robust
Tolerance level for selecting nonzero columns: 1e-08
Tolerance level for selecting nonzero singular values: 1e-03

REDUCED-FORM:
!!!WARNING!!!
The rank of Tau (Jacobian of steady state and reduced-form solution matrices) is deficient by 3 (rank(Tau) = 4 < 7 with tol = robust)!

s_igma is not identified!
eta is not identified!
a is not identified!

MINIMAL SYSTEM (KOMUNJER AND NG, 2011):
!!!WARNING!!!
The rank of Deltabar (Jacobian of steady state and minimal system) is deficient by 3 (rank(Deltabar) = 56 < 59 with tol = robust)!

s_igma is not identified!
eta is not identified!
a is not identified!

SPECTRUM (QU AND TKACHENKO, 2012):
!!!WARNING!!!
The rank of Gbar (Jacobian of mean and spectrum) is deficient by 3 (rank(Gbar) = 4 < 7 with tol = robust)!

s_igma is not identified!
eta is not identified!
a is not identified!

Reference to non-existent field ‘si_dMOMENTSnorm’.

Error in plot_identification (line 50)
si_dMOMENTSnorm = idemoments.si_dMOMENTSnorm;

Error in dynare_identification (line 506)
plot_identification(params, ide_moments_point, ide_hess_point, ide_reducedform_point, ide_dynamic_point,
options_ident.advanced, parameters, name, IdentifDirectoryName, parameters_TeX, name_tex);

Error in Model.driver (line 488)
dynare_identification(options_ident);

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;


But my mode check plots seem okay. I attach my new mod and steady state files and my mode_check plots.

Thank you for your help!

Model.mod (3.3 KB)
Model_steadystate.m (12.5 KB)
prior and post .pdf (57.8 KB)
mode check.pdf (7.0 KB)

@wmutschl Do you have an idea what is going on?

1 Like

The thing is that even when I don’t use a steady state file but rather a steady state block I get the same problem. I really have no idea what is going on. There is no similar error message in the dynare forum so it’s hard to correct it. The mode is computed and the results seem fine but I dont feel like I can go on if there is a big identification issue.

The file without a steady state file as well as the mode_check and the priors and posteriors graphs are attached.
Model.mod (13.7 KB)
Mode_check.pdf (5.7 KB)
Priors and posteriors .pdf (42.4 KB)

The pictures look fine, so it might be a problem with the identification-command. That’s why I asked @wmutschl

Sorry, I am currently busy and could only have a quick look at the model with the steady_state_model block. I think the problem with your current mod file is actually very simple, as you are trying to estimate parameters that don’t enter your model equations!

That is exactly what the identification output tells you:

REDUCED-FORM:
    !!!WARNING!!!
    The rank of Tau (Jacobian of steady state and reduced-form solution matrices) is deficient by 3 (rank(Tau) = 2 < 5 with tol = robust)!

    s_igma is not identified!
    eta is not identified!
    a is not identified!

The problem is that you declared the following parameters

parameters delta temp pi_c pi_h psi y w ystar c n ex im a1 a2 theta b_eta eta s_igma g_amma a omega rho_y rho_d sigma_y sigma_d a51 a52 a53 a57 a58 a61 a62 a63 a67 a69 a71 a82 a93 b12 b13 b14 b22 b23 b25 b32 b33 b36 b41 b43 b47 b48 b49 b52 b53 b54 b58 b62 b63 b64 b69 b73 b82 b93;

and the following model block

0 = b12*ystar_h + b13*delta_h + b14*y_h;
0 = b22*ystar_h + b23*delta_h + b25*ex_h; 
0 = b32*ystar_h + b33*delta_h + b36*im_h; 
0 = b41*temp_h + b43*delta_h + b47*pi_c_h + b48*a1_h + b49*a2_h; 
a51*temp_h(+1) + a52*ystar_h(+1) + a53*delta_h(+1) + a57*pi_c_h(+1) + a58*a1_h(+1) = b52*ystar_h + b53*delta_h + b54*y_h + b58*a1_h;
a61*temp_h(+1) + a62*ystar_h(+1) + a63*delta_h(+1) + a67*pi_c_h(+1) + a69*a2_h(+1) = b62*ystar_h + b63*delta_h + b64*y_h + b69*a2_h;
a71*temp_h = b73*delta_h(-1);
a82*ystar_h = b82*ystar_h(-1) + epsy;
a93*delta_h = b93*delta_h(-1) + epsd; 

Now, obviously, s_igma, eta and a do not enter your model equations, so there is no way to estimate them. Of course, in your steady_state_model block I can see that a51 a52 a53 a57 a58 a61 a62 a63 a67 a69 a71 a82 a93 b12 b13 b14 b22 b23 b25 b32 b33 b36 b41 b43 b47 b48 b49 b52 b53 b54 b58 b62 b63 b64 b69 b73 b82 b93 are all auxiliary parameters that depend on structural parameters (i.e. on s_igma, eta and a) and on steady state values, but Dynare does not now this. So the solution to your problem is to not define these parameters in the steady_state_model block but define them as model local variables, i.e.

model(linear);
#a51 = 
#a52 = 
#a53 =
....
#b93 =
end;

0 = b12*ystar_h + b13*delta_h + b14*y_h;
0 = b22*ystar_h + b23*delta_h + b25*ex_h; 
0 = b32*ystar_h + b33*delta_h + b36*im_h; 
0 = b41*temp_h + b43*delta_h + b47*pi_c_h + b48*a1_h + b49*a2_h; 
a51*temp_h(+1) + a52*ystar_h(+1) + a53*delta_h(+1) + a57*pi_c_h(+1) + a58*a1_h(+1) = b52*ystar_h + b53*delta_h + b54*y_h + b58*a1_h;
a61*temp_h(+1) + a62*ystar_h(+1) + a63*delta_h(+1) + a67*pi_c_h(+1) + a69*a2_h(+1) = b62*ystar_h + b63*delta_h + b64*y_h + b69*a2_h;
a71*temp_h = b73*delta_h(-1);
a82*ystar_h = b82*ystar_h(-1) + epsy;
a93*delta_h = b93*delta_h(-1) + epsd; 

If these parameters depend on a steady state value of a certain endogenous variable, you simply make use of the steady_state operator, e.g. steady_state(y_h) and so on. Make sure that in your steady_state_model block you only focus on the variables you declared with var.
I hope this helps, if not, let me know, and I can help you out more.

PS: Also, there is one little bug in the identification command, as the identification strength plots depend on the Jacobian of the moments which cannot be computed. Dynare tries to add lags, but is not able to find non-zero derivatives for the moment Jacobian. So, in this case, we should overwrite and set the no_identification_strength flag. I will open an issue on gitlab for that. Until then, simply run

identification(no_identification_strength);

and you won’t get the error.

Thank you very much for your help I will try to implement your suggestions. I just have a few questions:

  • You wrote:
    model(linear);
    #a51 =
    #a52 =
    #a53 =

    #b93 =
    end;

0 = b12ystar_h + b13delta_h + b14y_h;
0 = b22
ystar_h + b23delta_h + b25ex_h;
0 = b32ystar_h + b33delta_h + b36im_h;
0 = b41
temp_h + b43delta_h + b47pi_c_h + b48a1_h + b49a2_h;
a51temp_h(+1) + a52ystar_h(+1) + a53delta_h(+1) + a57pi_c_h(+1) + a58a1_h(+1) = b52ystar_h + b53delta_h + b54y_h + b58a1_h;
a61
temp_h(+1) + a62ystar_h(+1) + a63delta_h(+1) + a67pi_c_h(+1) + a69a2_h(+1) = b62ystar_h + b63delta_h + b64y_h + b69a2_h;
a71temp_h = b73delta_h(-1);
a82ystar_h = b82ystar_h(-1) + epsy;
a93delta_h = b93delta_h(-1) + epsd;

But shouldn’t the “end” be after "a93delta_h = b93delta_h(-1) + epsd; " ?

  • the steady state values of my endogenous variables are declared in this block:

steady_state_model;
ex_h=0;
y_h=0;
im_h=0;
pi_c_h=0;
a1_h=0;
a2_h=0;
temp_h=0;
ystar_h=0;
delta_h=0;

delta=1;
temp=1;
pi_c=1;
pi_h=1;
psi=(theta-1)/theta;
y=psi^(1/(eta+s_igma));
w=psi;
ystar=y;
c=y;
n=y;
ex=g_ammaystar;
im=g_amma
ystar;
a1=ypsi/(1-omegab_eta);
a2=y/(1-omega*b_eta);
end;

If I refer to one of them in the model should I really write steady_state() ? (example: the steady state value of “y_h” in my model is named “y” so should I just leave “y” in the model block or write steady_state(y) ? )

  • you say that in the steady_state_model block I should only write the steady states of the declared endogenous variables. So should I write the following in the parameter block? :
    delta=1;
    temp=1;
    pi_c=1;
    pi_h=1;
    psi=(theta-1)/theta;
    y=psi^(1/(eta+s_igma));
    w=psi;
    ystar=y;
    c=y;
    n=y;
    ex=g_ammaystar;
    im=g_amma
    ystar;
    a1=ypsi/(1-omegab_eta);
    a2=y/(1-omega*b_eta);

Thank you for your help!

  1. Yes, the end belongs at the end of the block.
  2. The steady_state() operator circumvents the need of defining the steady states as separate parameters. You can use it, but strictly speaking there is no need to.

Thank you very much for your help !
I ran the new code and now i get the following error message:

======== Identification Analysis ========

Testing prior mean
Error using svd
Input to SVD must not contain NaN or Inf.

Error in identification_analysis (line 468)
[~, S, V] = svd(dMOMENTS(ind_dMOMENTS,:),0);

Error in dynare_identification (line 461)
identification_analysis(params, indpmodel, indpstderr, indpcorr, options_ident, dataset_info,
prior_exist, 1); %the 1 at the end implies initialization of persistent variables

Error in Model.driver (line 368)
dynare_identification(options_ident);

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;

Should I worry about it or can I move on with my analysis ?

I forgot to attach my new file:

Model.mod (12.4 KB)

Given that the mode-check-plots and the prior posterior plots look fine, I would move on. Meanwhile, we will investigate this from a programming perspective: https://git.dynare.org/Dynare/dynare/-/issues/1733

Great thanks again for your help!!