Model comparison from same initial point (Steady State) with histval

Hi,

I want to obtain and compare the conditional welfare of two models (that differ by policy frameworks).

They have different steady states (and hence initial values for predetermined variables). Thus I want to make a fair comparison by simulating and obtaining the mean of the welfare departing from the same Steady State. I have been checking the manual and other forum entries and it looks like I can do this with histval.

I’ve been trying to find a working example but the one in the manual is missing 1 equation in the model block (page 37).

I have some questions about its implementation:

1. For setting the initial point should I use something like:

histval;

Rdc(-1) = 1.0101;
Bc(-1) = 0;
Ba(-1) = 0;
Bb(-1) = 0;
Kc(-1) = 41.0521;
Ka(-1) = 55.5583;
Kb(-1) = 55.5583;

end;

where the declared variables are the state variables of the model (that Dynare usually sets as the SS of the model).

or

histval;

Rdc(0) = 1.0101;
Bc(0) = 0;
Ba(0) = 0;
Bb(0) = 0;
Kc(0) = 41.0521;
Ka(0) = 55.5583;
Kb(0) = 55.5583;

end;

(My Decision Rule only has states with 1 lag. My hunch is that it should be X(0) then and that X(-1) is used when I need higher order lags to begin with, e.g., if I have some X(-2) in my decision rule)

2. In the histval block: Should I declare the steady state I want to depart from, or instead, deviations from such steady state ? (i.e., my intended departing point minus the actual steady state of the model in the file).

3. If I set in the model:

#Utilc = Cc^(1-siggma)/(1-siggma) - Hc^(1+pssi)/(1+pssi)
Wc = Utilc + betta*Wc(+1)

And at the end I set:

stoch_simul(order=2,periods=200) Wc

Would this output correspond to the conditional (on the same SS) welfare I am looking for comparing models?

MOMENTS OF SIMULATED VARIABLES
VARIABLE              MEAN       STD. DEV.        VARIANCE        SKEWNESS        KURTOSIS
Wc               -53.537709        0.896102        0.802998       -0.028222       -0.804784

Finally:

4. Is there any example file/link where the conditional welfare of two models is compared, hopefully using histval to achieve this?

In the case I am missing something and misinterpreting the manual and other entries in the forum, I’d also appreciate if someone indicates whether is wrong to do the Conditional Welf comparison with histval.

Best,

Camilo

1 Like

To follow up, I found this on another reply:

It’s a bit dated (from 2011). When I use histval now (version 4.6.1) together with stoch_simul I get different Moments (mean etc).

Does this mean that in recent versions histval can indeed be used to obtain the Welfare conditional on beginning where I indicate in histval?

  1. I would recommend using the simult_-function to simulate welfare at the starting point you desire. See https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Born_Pfeifer_2018/Welfare/get_consumption_equivalent_conditional_welfare.m
  2. What do you mean with

?
Could you provide me with the codes to check?

Hi Johannes, thank you for your reply. I will use simult_ while declaring the initial steady state vector I want to depart from in all models.

What I meant is that if I use histval and run the simulations with stoch_simul(…,periods=200) I obtain different means of the simulated variables. Since I am only changing the initial values I was thinking it could be a way to get the conditional welfare.

Although, maybe one issue is that for Welfare I only need the first period of the simulation and not the mean based on the whole simulated sample.

Here’s with histval:

MOMENTS OF SIMULATED VARIABLES
VARIABLE              MEAN       STD. DEV.        VARIANCE        SKEWNESS        KURTOSIS
W               -51.606379        1.992855        3.971469        0.435371       -0.769530

And here’s without it:

MOMENTS OF SIMULATED VARIABLES
VARIABLE              MEAN       STD. DEV.        VARIANCE        SKEWNESS        KURTOSIS
W               -53.533470        0.899157        0.808483       -0.027257       -0.811852

These are the files I used (just the usual example files with some modifications).

example1_histval.mod (1.7 KB) example1_nohistval.mod (1.7 KB)

Thanks again for your reply and link to your code, I will use these lines to get it:

shock_matrix = zeros(1,M_.exo_nbr); %create shock matrix with number of time periods in rows
y_sim = simult_(M_,options_,initial_condition_states,oo_.dr,shock_matrix,options_.order); 
outvalue=y_sim(strmatch('W',M_.endo_names,'exact'),2)*100;

best,

Camilo

I have a final question here (maybe trivial). Why are you multiplying the Welfare times 100 in your code?:

outvalue=y_sim(strmatch(‘W’,M_.endo_names,‘exact’),2)*100;

is this important?
I wonder because without multiplying the units already look more similar to the moments reported by the usual output.

Thanks