Weird diagnostic plots


My diagnostic plots and priors and posterior plots doesn’t look well behaved (attached below). Any clue as to why this is the case. Im using NK_baseline.mod and four observables; (1) real output per capita
growth, (2) real wages per capita, (3) the consumer price index, and (4) Overnight rate. Happy to provide more ifo if required.

NK_baseline_udiag1.eps (231.9 KB)
NK_baseline_udiag2.eps (231.5 KB)
NK_baseline_udiag3.eps (232.0 KB)
NK_baseline_udiag4.eps (232.4 KB)
NK_baseline_udiag5.eps (232.5 KB)
NK_baseline_udiag6.eps (232.9 KB)
NK_baseline_udiag7.eps (231.4 KB)
NK_baseline_udiag8.eps (216.9 KB)
NK_baseline_udiag9.eps (235.8 KB)
NK_baseline_udiag10.eps (195.4 KB)
NK_baseline_PriorsAndPosteriors1.eps (295.0 KB)
NK_baseline_PriorsAndPosteriors2.eps (305.6 KB)
NK_baseline_PriorsAndPosteriors3.eps (241.2 KB)
NK_baseline_PriorsAndPosteriors4.eps (185.3 KB)

How did the mode_check-plots look like. It looks like a corner solution.

Hello Professor,

I didnt have the mode_check option on in this run. I have a suspicion that my data has a trend (see attached)
dataset.csv (8.1 KB)

There doesn’t seem to be an obvious trend, but you need to make sure the means of the data match the steady states of the variables.

Does this imply that I should have exact steady state values as the means of the observable data?

Not exactly, but in the same range. In-sample, shocks can cause deviation from the average, i.e. the steady state. But if these deviations are too large, you force the shocks to have extreme persistence.

Hello Professor,

I’m getting better results after I adjusted data to be in the neighborhood of the Steady state values. Thank you.

I have one question regarding the observable equations in NK baseline model. Can I use GDP per capita growth directly? In other words should the observable equation for yd should be

yd_obs = yd


yd_obs =log(yd)-log(yd(-1))+mu_A 

It should be the second option. The first one is not a growth rate.

Thank you professor.

In that case, do I need to add following equation to the external steady state file?

yd_obs = mu_A;

Yes, that is correct.

data_x.csv (1.3 KB)
NK_baseline.mod (11.9 KB)
NK_baseline_steadystate.m (4.9 KB)
NK_baseline_mdiag.eps (188.8 KB)
NK_baseline_udiag8.eps (214.1 KB)
NK_baseline_udiag7.eps (235.0 KB)
NK_baseline_udiag6.eps (235.1 KB)

Hello Professor,

When I did above changes, convergence diagnostics charts show a peculiar pattern (two horizontal lines) in all charts (few charts attached herewith for your perusal). What could be the cause of this? I’ve provided the mod. file and the steady state file. Your guidance in resolving this would be of immense help.

Have a look at the mode_check-plots. For example, the standard deviations are not identified as they do not even show up in the model.

The issue seems to prompt as soon as I add the yd_obs = mu_A; to the steady state file. Do I need to do any other modifications to the steady state file?

Did you fix the other issues?

Hello Professor,

I was able fix the issue by adding yd_obs = mu_A to the steady state values specified at the beginning of the model in the steady state file.

I have few questions to clarify;

  1. In the NK_baseline model there are three growth rates

    mu_z (trend growth rate of the economy (from neutral and investment specific technology)')
    mu_I (‘growth rate of investment-specific technology growth’)
    mu_A (‘growth rate of neutral technology’)

Does this mean the observation equation should be yd_obs = ln(yd)-ln(yd(-1))+mu_z?

  1. Do I have to scale the observed dataset mean to match the steady state values?

  2. Does getting a negative Initial value of the log posterior (or likelihood) is a bad sign?

  1. That depends on what you observe. But yes, output growth should have that representation.
  2. What do you mean with “scale”? The mean of the data and the model equivalent should coincide by construction.
  3. See Bayesian estimation question - #5 by jpfeifer

Thanks for clarification.

What I meant by scaling is that for example, steady state value of yd_obs (my observable) is 1.0028. But the mean of my dataset is 0.220188. If I multiply all the values in the dataset by 5, then the mean of the dataset becomes 1.1001 (closer to the steady state value). So my question is whether this is necessary to obtain a better estimation?

Step back for a moment. What is the reason the scaling is different? What is the economic meaning of the two numbers?

Seeing all the steady state growth values mu_z, mu_I, mu_A, R, PI are over 1 was quite surprising for me. So I thought they were scaled up by 100. So that I presumed they were percentage values (eg. mu_A is 1.0028%).

Given below is the steady state result (I’ve used original parameter values given in the NK_baseline.mod file as it is) ;


d                        1
c                        0.40819
mu_z                     1.00446
mu_I                     1.00341
mu_A                     1.0028
lambda                   2.58777
R                        1.01654
PI                       1.01
r                        0.0348988
x                        0.0884579
u                        1
q                        1
f                        2.55673
ld                       0.317845
w                        1.11127
wstar                    1.13352
PIstarw                  1.02002
PIstar                   1.01869
g1                       7.64784
g2                       8.4976
yd                       0.496648
yd_obs                   1.0028
mc                       0.89825
k                        2.71161
vp                       1.00222
vw                       1.00305
l                        0.318814
phi                      1
F                        0.0495432

And my observation equation is;

yd_obs =ln(yd)-ln(yd(-1))+ mu_A; 

Along with this I’ve included following in the steadystate file

yd_obs =mu_A; 

I’ve uploaded mod file, steadystate file, and my dataset for your inspection as well. Dataset.xlsx (32.5 KB)
NK_baseline.mod (12.3 KB)
NK_baseline_steadystate.m (4.9 KB)

Have I made a mistake in specifying the observation equation?

The mu are the gross growth rates. 1.00446 is 0.446% per quarter. I think it should be

yd_obs =ln(yd)-ln(yd(-1))+ ln(mu_z);